Get-SCStorageVolume

Gets a storage volume object from a host managed by VMM.

Syntax

Get-SCStorageVolume
   [-VMMServer <ServerConnection>]
   [[-Name] <String>]
   [<CommonParameters>]
Get-SCStorageVolume
   -LibraryServer <LibraryServer>
   [[-Name] <String>]
   [<CommonParameters>]
Get-SCStorageVolume
   -StorageArray <StorageArray>
   [[-Name] <String>]
   [<CommonParameters>]
Get-SCStorageVolume
   -VMHost <Host>
   [[-Name] <String>]
   [<CommonParameters>]

Description

The Get-SCStorageVolume cmdlet gets one or more storage volume objects from a host managed by Virtual Machine Manager (VMM).

The information returned includes, but is not limited to, the following:

Examples

Example 1: Get all volumes on the specified host server

PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com" 
PS C:\> Get-SCStorageVolume -VMHost $VMHost

The first command gets the host object named VMHost01 and stores the object in the $VMHost variable.

The second command gets all drive volume objects from VMHost01 and displays information about these volumes to the user.

Note: To translate the capacity and free space from bytes into larger units of measure, divide the number of bytes by 1024 to get kilobytes (KB); divide the result by 1024 to get megabytes (MB); and divide that result by 1024 to get gigabytes (GB).

Example 2: Get the specified volume on a host

PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost02.Contoso.com" 
PS C:\> Get-SCStorageVolume -VMHost $VMHost -Name "C:\"

The first command gets the host object named VMHost02 and stores the object in the $VMHost variable.

The second command gets the drive volume named C:\ from VMHost02 and displays information about this volume to the user.

Example 3: Get all volumes on VMware ESX hosts that contain the string "SharedStorage" in the volume name

PS C:\> $VMHost = Get-SCVMHost -VMMServer "VMMServer01.Contoso.com" | where { $_.VirtualizationPlatform -eq "VMwareESX" }
PS C:\> $VMHost | Get-SCStorageVolume | select -Property Name, VMHost | where { $_.Name -match "SharedStorage" }

The first command gets all host objects from VMMServer01, selects only those host objects whose virtualization platform is VMware ESX, and then stores those host objects in $VMHost.

Note: This example assumes that the names of all volumes on these ESX Servers include the string "storage", but that only some of those volumes' names include the string "SharedStorage."

The second command passes each ESX host object in $VMHost to the Get-SCStorageVolume cmdlet, which gets the volume objects on these hosts and then, in turn, passes the volume objects to "select" (the alias for the Select-Object cmdlet). The Select-Object cmdlet displays the volume name and the host that volume resides on for those volumes whose name contains the string "SharedStorage".

Required Parameters

-LibraryServer

Specifies a VMM library server object.

Type:LibraryServer
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-StorageArray

Specifies a storage array object. This can be a Fibre Channel or iSCSI storage sub-system that is used to store virtual machine configuration and virtual disks.

Type:StorageArray
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VMHost

Specifies a virtual machine host object. VMM supports Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts.

For more information about each type of host, see the Add-SCVMHost cmdlet.

Type:Host
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-Name

Specifies the name of a VMM object.

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Outputs

StorageVolume

This cmdlet returns a StorageVolume object.