PowerCLI Reference

Get-VMGuestDisk

Synopsis

This cmdlet retrieves storage volumes as seen by the virtual machines' guest operating systems.

Syntax

Get-VMGuestDisk [[-DiskPath] <String[]>] [-VM <VirtualMachine[]>] [-Server <VIServer[]>] [<CommonParameters>]

Get-VMGuestDisk [[-DiskPath] <String[]>] [-VMGuest <VMGuest[]>] [-Server <VIServer[]>] [<CommonParameters>]

Get-VMGuestDisk [[-DiskPath] <String[]>] -HardDisk <HardDisk[]> [<CommonParameters>]

Related Commands

Detailed Description

This cmdlet retrieves storage volumes as seen by the virtual machines' guest operating systems. Optionally, you can filter the results by the virtual machine or the file system path where the storage volume is mounted. Alternatively, this cmdlet allows retrieving the guest storage volumes, backed by a specified virtual disk.


Note: You should run the virtual machine's guest operating system at least once to make the storage volumes information available.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
DiskPathString[]Filters the results based on the file system mount location. For example, "C:\" or "/etc/my-mount-root". This parameter supports wildcards.falseFalse
HardDiskHardDisk[]Limits the results to guest disks that are backed by the specified virtual disks.trueTrue
ServerVIServer[]Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet.falseFalse
VMVirtualMachine[]Limits the results to guest disks on the specified virtual machines.falseTrue
VMGuestVMGuest[]Limits the results to guest disks on the specified virtual machine guests.falseTrue

Return Type

VMGuestDisk objects that represent VM guest storage volumes, matching the specified filters.

Notes

Examples

-------------------------- Example 1 --------------------------

PS C:\> Get-VMGuestDisk -VM $myVM

Retrieves all guest disks for a specified virtual machine.

-------------------------- Example 2 --------------------------

PS C:\> $myVms | Get-VMGuestDisk -DiskPath "C:\"

Retrieves all C: drives on a specified set of virtual machines.


Copyright © VMware, Inc. All rights reserved.