Get-SCStorageVolume

Applies To: System Center 2012 - Virtual Machine Manager

Get-SCStorageVolume

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

Syntax

Parameter Set: NoFilter
Get-SCStorageVolume [[-Name] <String> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: FilterByVMHost
Get-SCStorageVolume [[-Name] <String> ] -VMHost <Host> [ <CommonParameters>]

Detailed Description

The Get-SCStorageVolume cmdlet gets one or more storage volume objects from a host managed by System Center 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.

For more information about Get-SCStorageVolume, type: "Get-Help Get-SCStorageVolume -online".

Parameters

-Name<String>

Specifies the name of a VMM object.

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMHost<Host>

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, type: "Get-Help Add-SCVMHost -detailed". See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • StorageVolume

Examples

1: Get all volumes on the specified host server.

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

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

2: Get the specified volume on a host.

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.

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

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

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

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

Get-SCVMHost

Set-SCStorageVolume