Add Data Disk
Updated: July 10, 2015
The Add Data Disk operation adds a data disk to a Virtual Machine.
The Add Data Disk request may be specified as follows. Replace <subscription-id> with the subscription ID, <service-name> with the name of the cloud service, <deployment-name> with the name of the deployment, and <role-name> with the name of the role to which the data disk is to be added.
The following table describes the request headers.
Required. Specifies the version of the operation to use for this request. This header should be set to 2012-03-01 or higher.
The format of the request body is as follows:
<DataVirtualHardDisk xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <HostCaching>caching-mode</HostCaching> <DiskLabel>identifier-of-disk</DiskLabel> <DiskName>name-of-disk</DiskName> <Lun>lun-number</Lun> <LogicalDiskSizeInGB>size-in-gb-of-the-disk</LogicalDiskSizeInGB> <MediaLink>uri-vhd-file</MediaLink> <SourceMediaLink>uri-of-disk</SourceMediaLink> </DataVirtualHardDisk>
The following table describes the elements of the request body
Optional. Specifies the caching behavior of data disk.
Possible values are:
The default vault is None.
Optional. Specifies the identifier of the data disk. This value is only available programmatically and is not shown in the Management Portal.
Optional. Specifies the name of the disk. If this value matches an existing registered disk, the existing disk is attached to the Virtual Machine. If this element is not specified, a name is automatically generated.
Optional when adding the first data disk to a Virtual Machine. Specifies the Logical Unit Number (LUN) for the disk. The LUN specifies the slot in which the data drive appears when mounted for usage by the Virtual Machine. Valid LUN values are 0 through 31.
Optional. Specifies the size, in GB, of an empty disk to be attached to the Virtual Machine. If SourceMediaLink is specified or DiskName refers to an existing disk in the subscription, then this element is ignored.
Required. Specifies the location of the blob in storage where the vhd file for the disk is located. The storage account where the vhd is located must be associated with the specified subscription. If SourceMediaLink is not specified, an empty disk is created at the location specified by this element.
If DiskName refers to an existing registered disk, this element is ignored.
Optional. Specifies the location of a blob in storage which where a vhd file is located that is imported and registered as a disk. If this element is specified, MediaLink is not used.
The response includes an HTTP status code and a set of response headers.
A successful operation returns status code 202 (Accepted).
The response for this operation includes the following headers. The response may also include additional standard HTTP headers.
A value that uniquely identifies a request made against the management service.