Add VHD to VM
Adds a hard disk drive to a virtual machine.
Input Parameters
Virtual Machine Name |
String |
Yes |
Specifies the name of the virtual machine to which the hard disk drive is to be added. |
Controller Type |
Radio Button |
Yes |
Specifies the type of VHD to be added to the virtual machine. |
IDE Controller Number |
String |
Yes |
Specifies the number of the controller to which the hard disk drive is to be added. If not specified, this parameter assumes the value of the first available controller at the location specified in the ControllerLocation parameter. |
IDE Controller Location |
String |
Yes |
Specifies the number of the location on the controller at which the hard disk drive is to be added. If not specified, the first available location in the controller specified with the ControllerNumber parameter is used. |
VHD File Path |
String |
Yes |
Specifies the full path of the hard disk drive file to be added. |
Resource Pool Name |
String |
Yes |
Specifies the friendly name of the ISO resource pool to which this virtual hard disk is to be associated. |
Output Parameters
Result |
Number |
Returns a success value of zero or any value other than zero to indicate failure. |
Example Input Parameters
Virtual Machine Name |
String |
Yes |
Guest001 |
Controller Type |
Radio Button |
Yes |
Specify the type of Controller to be added to the VM |
IDE Controller Number |
Number |
No |
0 |
IDE Controller Location |
Number |
No |
1 |
VHD File Path |
String |
No |
D:\VHDs\disk1.vhdx |
Resource Pool Name |
String |
No |
MainPool |