MSDN Library
Dette indhold er ikke tilgængeligt på dit sprog, men her er den engelske version.

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.


Method Request URI


You must make sure that the request that is made to the management service is secure. For additional details, see Authenticating Service Management Requests.

The following table describes the request headers.


Request Header Description


Required. Specifies the version of the operation to use for this request. This header should be set to 2012-03-01 or higher. For more information about versioning headers, see Service Management Versioning.

The format of the request body is as follows:

<DataVirtualHardDisk xmlns="" xmlns:i="">

The following table describes the elements of the request body


Element name Description


Optional. Specifies the caching behavior of data disk.

Possible values are:

  • None

  • ReadOnly

  • ReadWrite

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. For more information about disk sizes, see Virtual Machine and Cloud Service Sizes for Azure.


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). For information about status codes, see Service Management Status and Error Codes.

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.


Response Header Description


A value that uniquely identifies a request made against the management service.

© 2015 Microsoft