Add Hard Disk operation
The Add Hard Disk operation enables you to add a hard disk or a virtual disk, using Raw Disk Mapping (RDM) or logical unit number (LUN) mapping, on the specified virtual machine.
The following table describes the elements for this request.
Adapter request elements for the Add Hard Disk operation
Element | Definition | Required |
---|---|---|
<operation-type> | Specifies the type of the operation: Configure_Vm | Yes |
<operation-name> | Specifies the name of the operation: Add_Hard_Disk | Yes |
<soap-url> | Specifies the URL for the remote SOAP service running on the VMware VirtualCenter | No |
<transport> | Specifies the transport protocol for the message | No |
<user-name> | Specifies the user name that is used for HTTP basic authentication on the VMware Virtual Center | No |
<password> | Specifies the password corresponding to <user-name> | Conditional; required if <user-name> is specified |
<parameters> | Contains the elements required to execute the operation | Yes |
<virtual-machine> | Specifies the virtual machine to which to add a hard disk | Yes |
<file-name> | Specifies the name for the host file used in the operation | Yes |
<device> | Contains information about the hard disk that you want to add; contains the controller-type attribute
| No |
<bus-number> | Specifies the bus number associated with the controller as its index
| No |
<backing> | Contains information about the backing of a device in a virtual machine; contains the type attribute, which defines more refined subtypes for device-specific backing information | Yes |
<device-name> | Specifies the host-specific device through which the LUN is accessed | Conditional; required when adding an RDM virtual disk |
<compatibility-mode> | Specifies the compatibility mode of the raw disk mapping (RDM)
| Conditional; required when adding an RDM virtual disk |
<disk-mode> | Specifies the disk persistence mode
| Yes |
<split> | Specifies whether the type of virtual disk file is split or monolithic | No |
<thin-provisioned> | Specifies whether the virtual disk backing file should be allocated using thin provisioning | No |
<write-through> | Specifies whether disk write operations are performed on the file system directly or are buffered | No |
<capacity-inKB> | Specifies the capacity of the virtual disk | Conditional:
|
<shares> | Specifies the number of shares allocated | No |
<level> | Indicates the allocation level
| No |
The following code sample shows a sample adapter request for the Add Hard Disk operation.
Sample adapter request for the Add Hard Disk operation
<soap-url />
<transport />
<user-name />
<password />
<operation-type>Configure_Vm</operation-type>
<operation-name>Add_Hard_Disk</operation-name>
<parameters>
<virtual-machine>VM1</virtual-machine>
<spec>
<device-change>
<device controller-type="VirtualLsiLogicSASController">
<bus-number>1</bus-number>// The value varies from 0 to 3.
<backing type="VirtualDiskRawDiskMappingVer1BackingInfo">
<file-name>[datastore1]</file-name>
<device-name>/vmfs/devices/disks/naa.60a980006e424f4f6c4a656c354c5677</device-name>
<compatibility-mode>physicalMode</compatibility-mode>
<disk-mode>persistent</disk-mode>
<split>false</split>
<write-through>false</write-through>
<thin-provisioned>true</thin-provisioned>
</backing>
<capacity-inKB>2048</capacity-inKB>
<shares>
<shares>1500</shares>
<level>custom</level>
</shares>
</device>
</device-change>
</spec>
</parameters>
</vmware-infrastructure-request>
The following code sample shows the response for the sample Add Hard Disk operation.
Sample adapter response for the Add Hard Disk operation
<metadata>
<status>success</status>
</metadata>
<AddHardDiskResponse>
<Task>task-8218</Task>
</AddHardDiskResponse>
</vmware-infrastructure-response>
The following table describes the response element.
Adapter response element for the Add Hard Disk operation
Element | Definition |
---|---|
<Task> | Specifies the task ID of the submitted task |