Expand VMware VM Hard Disk

This object will increase the size of a virtual machine when needed.

The policy using this object will fail if snapshots are found on the virtual machine, since a disk cannot be resized when snapshots are present.

The policy using this object will fail if the size requested is smaller than the current disk size, as resizing can only increase the size, not decrease it.

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.

Requires PowerShell 5.0

Before using this VMware Automation Manager Object, you must install PowerShell 5.0.

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 Yes The name of the virtual machine on which to expand a hard disk.

The field does not support wildcards.

Hard Disk Name String Yes The name of the hard disk to be resized.

This field does not support wildcards.

Requested Disk Capacity (GB) Number Yes The desired capacity of the disk, in GB.

Output Parameters

Name Type Description
Old Disk Size (GB) Number The size of the disk prior to the expansion.
New Disk Size (GB) Number The size of the disk after the expansion, if successful.
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 Yes Vmwin10
Hard Disk Name String Yes Hard Disk 1
Requested Disk Capacity (GB) Number Yes 50