Get-SCStorageVolume

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

Syntax

Get-SCStorageVolume [[-Name] <String>] -LibraryServer <LibraryServer> [<CommonParameters>]
Get-SCStorageVolume [[-Name] <String>] -StorageArray <StorageArray> [<CommonParameters>]
Get-SCStorageVolume [[-Name] <String>] -VMHost <Host> [<CommonParameters>]
Get-SCStorageVolume [[-Name] <String>] [-VMMServer <ServerConnection>] [<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:



- Name. The name of each host volume (such as C:\, D:\, E:\).

  • StorageVolumeID. The volume ID (a GUID) for each host volume. The host volume ID is unique across your VMM environment.

  • MountPoints. The mount points for each volume. A single volume, such as C:\, can contain multiple mount points.

  • Capacity. The storage capacity of each volume.

  • FreeSpace. The amount of free space on each volume.

  • VolumeLabel. A user-defined label for this volume (if any).

  • IsSANMigrationPossible. A flag indicating whether or not SAN migration is available.

  • IsClustered - A flag indicating whether the volume is local storage or shared storage (that is, uses external storage, such as SAN or iSCSI) and a clustered disk resource exists for this volume.

  • InUse. A flag that is set to True when one of the highly available virtual machines managed by VMM is using this volume.

  • VMHost. The FQDN name of the host on which each volume resides.

  • IsAvailableForPlacement. A flag indicating whether this volume is available as a location on which to deploy virtual machines on this host.

  • ServerConnection. The VMM server connection that is managing the host that this volume belongs to.

  • ID. The ID (a GUID) for each volume.

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".

Parameters

-LibraryServer

Specifies a VMM library server object.

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

Specifies the name of a VMM object.

Type:String
Required:False
Position:0
Default value:None
Accept pipeline input:False
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
Required:True
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
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VMMServer

Specifies a VMM server object.

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

Outputs

StorageVolume

This cmdlet returns a **StorageVolume** object.