Get Disk
The Get Disk operation retrieves information about the specified disk.
Request
The Get Disk request may be specified as follows. Replace <subscription-id> with the subscription ID and <disk-name> with the name of the disk.
Method |
Request URI |
---|---|
GET |
https://management.core.windows.net/<subscription-id>/services/disks/<disk-name> |
URI Parameters
None.
Request Headers
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. |
Request Body
None.
Response
The response includes an HTTP status code, a set of response headers, and a response body.
Status Code
A successful operation returns status code 200 (OK).
Response Headers
The response for this operation includes the following headers. The response may also include additional standard HTTP headers.
Response Header |
Description |
---|---|
x-ms-request-id |
A value that uniquely identifies a request made against the management service. |
Response Body
The format of the response body is as follows:
<Disk xmlns="https://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<AffinityGroup>name-of-affinity-group</AffinityGroup>
<AttachedTo>
<DeploymentName>name-of-deployment</DeploymentName>
<HostedServiceName>name-of-cloud-service</HostedServiceName>
<RoleName>name-of-virtual-machine</RoleName>
</AttachedTo>
<IsCorrupted>indicator-of-corrupted-disk</IsCorrupted>
<OS>operating-system-type</OS>
<Location>geo-location-of-disk</Location>
<LogicalSizeInGB>size-of-disk</LogicalSizeInGB>
<MediaLink>uri-of-vhd</MediaLink>
<Name>name-of-disk</Name>
<SourceImageName>name-of-source-image</SourceImageName>
<CreatedTime>creation-time-of-disk</CreatedTime>
</Disk>
The following table describes the elements of the response body.
Element name |
Description |
---|---|
AffinityGroup |
Specifies the affinity group in which the disk is located. The AffinityGroup value is derived from storage account that contains the blob in which the vhd is located. If the storage account does not belong to an affinity group, this element is not returned. |
AttachedTo |
Specifies information about the Virtual Machine that is currently using the disk. A disk cannot be deleted as long as it is attached to a Virtual Machine. |
DeploymentName |
Specifies the deployment in which the disk is being used. |
HostedServiceName |
Specifies the cloud service in which the disk is being used. |
RoleName |
Specifies the Virtual Machine that the disk is attached to. |
IsCorrupted |
Indicates that the disk is corrupted. This element is only returned if the value is true. |
OS |
The operating system type of the image on the disk. Possible Values are:
|
Location |
Specifies the geo-location in which the disk is located. The Location value is derived from storage account that contains the blob in which the disk is located. If the storage account belongs to an affinity group, this element is not returned. |
LogicalSizeInGB |
Specifies the size, in GB, of the disk. |
MediaLink |
Specifies the location of the blob in the blob store in which the media for the disk is located. The blob location belongs to a storage account in the subscription specified by the <subscription-id> value in the operation call. Example: http://example.blob.core.windows.net/disks/mydisk.vhd |
Name |
Specifies the name of the disk. This is the name that is used when you create a Virtual Machine using the disk. |
SourceImageName |
Specifies the name of the OS Image from which the disk was created. This property is populated automatically when a disk is created from an OS image by calling the Add Role or Create Virtual Machine Deployment operations. |
CreatedTime |
Specifies in UTC format when the disk was created. |