Get VMware Hard Disk Information

This object retrieves information about one or more hard drives.

Install VMware.PowerCLI

Before using this VMware Automation Manager Object, you must install the PowerShell module VMware.PowerCLI.

This VMware Automation Object runs on 64-bit PowerShell, and the module must also be added to 64-bit PowerShell.

Input Parameters

Name Type Required Description
Session ID String Yes The session ID that is generated by the VMware connection object.
This is required for this object to work.
Virtual Machine Name String No The name of the virtual machine to which the hard disk(s) belongs.

Note that this is optional. However, if this is left empty the datastore name must be provided. Also, if the virtual machine name is provided, the datastore will be ignored as only one of the parameters can be used.

This field does not support wildcards.
Datastore Name String No The name of the datastore to which the hard disk(s) belongs.

Note that this is optional. However, if this is left empty the virtual machine name must be provided. Also, if both the virtual machine name and datastore name are provided, the datastore name will be ignored.

This field supports wildcards, so to select all data stores, use "*" as the value.
Disk Type String Yes This represents the type of disk. Select All to get all disk types.

Output Parameters

Name Type Description
HardDisksArray Collection The list of hard disks returned. It contains following host information:

ItemTypeExample
StorageFormatStringThick
PersistenceStringPersistent
DiskTypeStringFlat
FilenameString[tok-esx-01LocalStorage01] SW-LEM-6.3.1/SW-LEM-6.3.1-000022.vmdk
CapacityGBInt250
ParentStringSW-LEM-6.3.1
UidString/VIServer=root@10.199.2.23443/
VirtualMachine=VirtualMachine-10/HardDisk=2000/
IdStringVirtualMachine-10/2000
NameStringHard Disk 1
HardDisksArrayRowCount Number The number of hard disks found.
Result Number Returns a success value of zero or any value other than zero to indicate failure.
Result String String Object execution error details.

Example Input Parameters

Name Type Required Example
Session ID String Yes

ab4c55c1273cb609678a2bb6a15104e927ac8dec

10.199.2.23

Virtual Machine Name String No

Vmwin10

Datastore Name String No

Tok-esx-01:LocalStorage01

*

Disk Type String Yes Flat