List Disks

 

The List Disks operation retrieves a list of the disks in the image repository that is associated with the specified subscription.

Request

The List Disks request may be specified as follows. Replace <subscription-id> with the subscription ID.

Method

Request URI

GET

https://management.core.windows.net/<subscription-id>/services/disks

URI Parameters

None.

Request Headers

The following table describes required and optional 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:

<Disks xmlns="https://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <Disk>
    <AffinityGroup>name-of-affinity-group</AffinityGroup>
    <AttachedTo>
      <HostedServiceName>name-of-cloud-service</HostedServiceName>
      <DeploymentName>name-of-deployment</DeploymentName> 
      <RoleName>name-of-virtual-machine</RoleName>
    </AttachedTo>
    <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>
    <IOType>IO-Type<IOType>
  </Disk>
</Disks>

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 the value is NULL.

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.

HostedServiceName

Specifies the cloud service in which the disk is being used.

DeploymentName

Specifies the deployment in which the disk is being used.

RoleName

Specifies the Virtual Machine that the disk is attached to.

OS

The operating system type of the image on the disk.

Possible Values are:

  • Linux

  • Windows

  • NULL

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 the value is NULL.

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.

The CreatedTime element is only available using version 2014-01-01 or higher.

IOType

This property identifies the type of the storage account for the backing VHD.

If the backing VHD is in an Provisioned Storage account, “Provisioned” is returned otherwise “Standard” is returned.

Note: This value is populated by Azure platform when the disk is created, not by the user.

This property is only returned with a version header of 2014-10-01 or newer.