SALG : 1-800-867-1389
EN
Dette indhold er ikke tilgængeligt på dit sprog, men her er den engelske version.

Add Data Disk

Updated: August 21, 2014

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

POST

https://management.core.windows.net/<subscription-id>/services/hostedservices/<service-name>/deployments/<deployment-name>/roles/<role-name>/DataDisks

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

x-ms-version

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="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

 

Element name Description

HostCaching

Optional. Specifies the caching behavior of data disk.

Possible values are:

  • None

  • ReadOnly

  • ReadWrite

The default vault is None.

DiskLabel

Optional. Specifies the identifier of the data disk. This value is only available programmatically and is not shown in the Management Portal.

DiskName

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.

Lun

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 15.

LogicalDiskSizeInGB

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.

MediaLink

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.

Example:

http://example.blob.core.windows.net/disks/mydisk.vhd

If DiskName refers to an existing registered disk, this element is ignored.

SourceMediaLink

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

x-ms-request-id

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

Syntes du, dette var nyttigt?
(1500 tegn tilbage)
Tak for din feedback
Vis:
© 2014 Microsoft