DescribeDisks
Queries the details of one or more block storage devices, including disks, local disks, and elastic ephemeral disks.
Operation description
-
Request parameters such as RegionId, ZoneId, DiskIds, and InstanceId act as filters and are connected by the logical AND operator.
-
The DiskIds parameter is a JSON array. If this parameter is not specified, the filter does not take effect. However, if DiskIds is specified as an empty array, the filter takes effect and an empty result is returned.
-
Token-based paging is supported. You can use NextToken to specify the query token, which is the NextToken value returned from the previous call to the DescribeDisks operation. You can also use MaxResults to specify the maximum number of entries to return on each page.
-
A disk for which the multi-attach feature is enabled can be attached to multiple instances. You can view all attachment information of the disk in the
Attachmentlist of the response.
When you call API operations by using Alibaba Cloud CLI, the values of request parameters of different data types must follow the format requirements. For more information, see CLI parameter format description.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeDisks |
list |
Disk
Disk
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the block storage device. You can call the DescribeRegions operation to query the most recent region list. |
cn-hangzhou |
| ZoneId |
string |
No |
The zone ID. |
cn-hangzhou-g |
| DiskIds |
string |
No |
The IDs of the disks, local disks, or elastic ephemeral disks. The value is a JSON array that supports up to 100 IDs, which are separated by commas (,). |
["d-bp67acfmxazb4p****", "d-bp67acfmxazb4g****", … "d-bp67acfmxazb4d****"] |
| InstanceId |
string |
No |
The ID of the instance to which the disk, local disk, or elastic ephemeral disk is attached. |
i-bp67acfmxazb4q**** |
| DiskType |
string |
No |
The type of the disk, local disk, or elastic ephemeral disk to query. Valid values:
Default value: all. Note
Elastic ephemeral disks cannot be used as system disks. |
all |
| Category |
string |
No |
The category of the disk. Valid values:
Default value: all. |
all |
| PerformanceLevel |
string |
No |
The performance level of the enterprise SSD. Valid values: PL0, PL1, PL2, and PL3. |
PL0 |
| Status |
string |
No |
The disk status. For more information, see Disk status. Valid values:
Default value: All. |
All |
| SnapshotId |
string |
No |
The ID of the snapshot used to create the disk. |
s-bp67acfmxazb4p**** |
| Portable |
boolean |
No |
Specifies whether the disk can be detached. Valid values:
The
|
false |
| DeleteWithInstance |
boolean |
No |
Specifies whether the disk is released together with the instance. Valid values:
Default value: false. |
false |
| DeleteAutoSnapshot |
boolean |
No |
Specifies whether automatic snapshots are released together with the disk. Valid values:
Default value: false. |
false |
| PageNumber |
integer |
No |
Note
This parameter will be deprecated soon. Use the NextToken and MaxResults parameters for paging. |
1 |
| PageSize |
integer |
No |
Note
This parameter will be deprecated soon. Use the NextToken and MaxResults parameters for paging. |
10 |
| NextToken |
string |
No |
The query token. The value is the For more information about how to configure the returned data for this operation, see the operation description section above. |
AAAAAdDWBF2**** |
| MaxResults |
integer |
No |
The maximum number of entries to return. Valid values: 10 to 500. Default value:
|
50 |
| DiskName |
string |
No |
The name of the disk. The name must be 2 to 128 characters in length and can contain letters and digits in Unicode. It can also contain colons (:), underscores (_), periods (.), and hyphens (-). |
testDiskName |
| AutoSnapshotPolicyId |
string |
No |
The ID of the automatic snapshot policy based on which disks are queried. |
sp-m5e2w2jutw8bv31**** |
| EnableAutoSnapshot |
boolean |
No |
Specifies whether the automatic snapshot policy feature is enabled for the disk. Valid values:
Note
[Deprecated] This parameter is deprecated. The automatic snapshot policy feature is enabled by default for newly created disks. You only need to apply an automatic snapshot policy to the disk to use the feature. |
true |
| EnableAutomatedSnapshotPolicy |
boolean |
No |
Specifies whether an automatic snapshot policy is applied to the disk. Valid values:
Default value: false. |
false |
| DiskChargeType |
string |
No |
The billing method of the disk. Valid values:
|
PostPaid |
| LockReason |
string |
No |
The reason why the disk is locked. Valid values:
|
security |
| Filter.1.Key |
string |
No |
The filter key used to query resources. Set the value to |
CreationStartTime |
| Filter.2.Key |
string |
No |
The filter key used to query resources. Set the value to |
CreationEndTime |
| Filter.1.Value |
string |
No |
The filter value used to query resources. If you specify this parameter, you must also specify the |
2017-12-05T22:40Z |
| Filter.2.Value |
string |
No |
The filter value used to query resources. If you specify this parameter, you must also specify the |
2017-12-06T22:40Z |
| ResourceGroupId |
string |
No |
The ID of the enterprise resource group to which the disk belongs. When you use this parameter to filter resources, the resource count cannot exceed 1,000. Note
Filtering by the default resource group is not supported. |
rg-bp67acfmxazb4p**** |
| EnableShared |
boolean |
No |
Specifies whether the disk is Shared Block Storage. |
false |
| Encrypted |
boolean |
No |
Specifies whether to query only encrypted disks. Valid values:
Default value: false. |
false |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run on this request. Valid values:
Default value: false. |
false |
| KMSKeyId |
string |
No |
The ID of the Key Management Service (KMS) key used by the disk. |
0e478b7a-4262-4802-b8cb-00d3fb40**** |
| MultiAttach |
string |
No |
Specifies whether the multi-attach feature is enabled. Valid values:
|
Disabled |
| Tag |
array<object> |
No |
The tags of the disk. |
|
|
object |
No |
The tag of the disk. |
||
| key |
string |
No |
The tag key of the disk. Note
To improve code compatibility, use the Tag.N.Key parameter. |
null |
| Key |
string |
No |
The tag key of the disk. Valid values of N: 1 to 20. If you use a single tag to filter resources, the number of returned resources cannot exceed 1,000. If you use multiple tags to filter resources, the number of returned resources that are bound to multiple tags cannot exceed 1,000. If the number of resources exceeds 1,000, use the ListTagResources operation to query the resources. |
TestKey |
| Value |
string |
No |
The tag value of the disk. Valid values of N: 1 to 20. |
TestValue |
| value |
string |
No |
The tag value of the disk. Note
To improve code compatibility, use the Tag.N.Value parameter. |
null |
| AdditionalAttributes |
array |
No |
The list of additional attributes. Only Note
Only regional disks have data storage locations. |
IOPS |
|
string |
No |
The additional attribute value. Only |
Placement |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| NextToken |
string |
The pagination token returned by this call. |
AAAAAdDWBF2**** |
| PageSize |
integer |
Note
This parameter will be deprecated soon. Use the |
1 |
| PageNumber |
integer |
Note
This parameter will be deprecated soon. Use the |
1 |
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| TotalCount |
integer |
The total number of queried entries. Note
When you use the |
15 |
| Disks |
object |
||
| Disk |
array<object> |
The collection of disk information. |
|
|
array<object> |
The disk information. |
||
| SerialNumber |
string |
The serial number of the disk. |
bp18um4r4f2fve2**** |
| CreationTime |
string |
The creation time. The time follows the ISO 8601 standard and is in the UTC time zone. |
2021-06-07T06:08:54Z |
| Status |
string |
The disk status. Valid values:
|
In_use |
| Type |
string |
The disk type. Valid values:
|
system |
| PerformanceLevel |
string |
The performance level of the ESSD disk. Valid values:
|
PL0 |
| BdfId |
string |
This parameter is in invitational preview and is not available. |
null |
| EnableAutoSnapshot |
boolean |
Indicates whether the automatic snapshot policy feature is enabled for the disk. Note
[Deprecated] The automatic snapshot policy feature is enabled by default for newly created disks. You only need to apply an automatic snapshot policy to the disk. |
false |
| StorageSetId |
string |
The ID of the storage set. |
ss-i-bp1j4i2jdf3owlhe**** |
| StorageSetPartitionNumber |
integer |
The maximum number of partitions in the storage set. |
11 |
| DiskId |
string |
The ID of the disk. |
d-bp18um4r4f2fve24**** |
| DeleteAutoSnapshot |
boolean |
Indicates whether automatic snapshots are deleted when the disk is deleted. Valid values:
Snapshots created by calling the CreateSnapshot operation or in the console are not affected by this parameter and are always retained. |
false |
| StorageClusterId |
string |
The ID of the dedicated block storage cluster to which the disk belongs. If the disk belongs to a public block storage cluster, an empty string is returned. |
dbsc-j5e1sf2vaf5he8m2**** |
| Encrypted |
boolean |
Indicates whether the disk is encrypted. |
false |
| IOPSRead |
integer |
The maximum number of read operations per second. |
2000 |
| MountInstanceNum |
integer |
The number of instances to which the shared storage is attached. |
1 |
| Description |
string |
The description of the disk. |
testDescription |
| Device |
string |
The device name of the instance to which the disk is attached, such as /dev/xvdb. Take note of the following items:
Note
This parameter will be deprecated soon. To improve code compatibility, we recommend that you do not use this parameter. |
/dev/xvdb |
| DiskName |
string |
The name of the disk. |
testDiskName |
| Portable |
boolean |
Indicates whether the disk is removable. |
false |
| ImageId |
string |
The ID of the image used to create the ECS instance. This parameter has a value only if the disk was created from an image. Otherwise, this parameter is empty. If the image used to create the disk is deleted, this parameter is empty. |
m-bp13aqm171qynt3u*** |
| KMSKeyId |
string |
The ID of the Key Management Service (KMS) key used by the disk. |
0e478b7a-4262-4802-b8cb-00d3fb408*** |
| DeleteWithInstance |
boolean |
Indicates whether the disk is released when its associated instance is released. Valid values:
|
true |
| DetachedTime |
string |
The time when the disk was last detached. The time follows the ISO 8601 standard and is in the UTC time zone. |
2021-06-07T21:01:22Z |
| SourceSnapshotId |
string |
The ID of the snapshot used to create the disk. If no snapshot was specified when the disk was created, this parameter is empty. If the snapshot used to create the disk is deleted, this parameter is empty. |
s-bp67acfmxazb4p**** |
| AutoSnapshotPolicyId |
string |
The ID of the automatic snapshot policy applied to the disk. Note
This parameter will be deprecated soon. If multiple automatic snapshot policies are applied to the disk, only one of them is returned. We recommend that you call the DescribeAutoSnapshotPolicyAssociations operation to query all automatic snapshot policies applied to the disk. |
sp-bp67acfmxazb4p**** |
| EnableAutomatedSnapshotPolicy |
boolean |
Indicates whether an automatic snapshot policy is applied to the disk. |
false |
| IOPSWrite |
integer |
The maximum number of write operations per second. |
2000 |
| InstanceId |
string |
The instance ID to which the disk is attached. Take note of the following items:
|
i-bp67acfmxazb4q**** |
| IOPS |
integer |
The maximum number of read and write operations per second. |
4000 |
| RegionId |
string |
The region ID of the disk. |
cn-hangzhou |
| ExpiredTime |
string |
The expiration time of the subscription disk. The time follows the ISO 8601 standard and is in the UTC time zone. |
2021-07-07T16:00Z |
| Size |
integer |
The size of the disk. Unit: GiB. |
60 |
| ResourceGroupId |
string |
The ID of the resource group to which the disk belongs. |
rg-bp67acfmxazb4p**** |
| DiskChargeType |
string |
The billing method of the disk. Valid values:
|
PrePaid |
| ZoneId |
string |
The zone ID of the disk. |
cn-hangzhou-i |
| AttachedTime |
string |
The time when the disk was last attached. The time follows the ISO 8601 standard and is in the UTC time zone. Format: yyyy-MM-ddThh:mmZ. |
2021-06-07T06:08:56Z |
| Category |
string |
The disk category. Valid values:
|
cloud_ssd |
| ProductCode |
string |
The product code in Alibaba Cloud Marketplace. |
jxsc000204 |
| MultiAttach |
string |
Indicates whether the multi-attach feature is enabled for the disk. |
Disabled |
| OperationLocks |
object |
||
| OperationLock |
array<object> |
The list of reasons why the disk is locked. |
|
|
object |
The reason why the disk is locked. |
||
| LockReason |
string |
The reason why the disk is locked for security reasons. |
security |
| MountInstances |
object |
||
| MountInstance |
array<object> |
The collection of information about the instances to which the shared storage is attached. |
|
|
object |
The information about the instance to which the shared storage is attached. |
||
| AttachedTime |
string |
The time when the disk was attached. The time follows the ISO 8601 standard and is in the UTC time zone. Format: yyyy-MM-ddTHH:mm:ssZ. |
2017-12-05T2340:00Z |
| InstanceId |
string |
The instance ID to which the disk is attached. |
i-bp1j4i2jdf3owlhe**** |
| Device |
string |
The mount point of the disk. |
/dev/xvda |
| Tags |
object |
||
| Tag |
array<object> |
The collection of tags of the disk. |
|
|
object |
The tag of the disk. |
||
| TagValue |
string |
The tag value. |
TestValue |
| TagKey |
string |
The tag key. |
TestKey |
| Attachments |
object |
||
| Attachment |
array<object> |
The attachment information of the disk. This parameter is a list of |
|
|
object |
The attachment information of the disk. |
||
| InstanceId |
string |
The instance ID to which the disk is attached. |
i-bp67acfmxazb4q**** |
| Device |
string |
The device name. |
/dev/xvda |
| AttachedTime |
string |
The time when the disk was attached. The time is in the UTC time zone. |
2021-06-07T06:08:56Z |
| ProvisionedIops |
integer |
The provisioned read and write IOPS of the ESSD AutoPL disk. Valid values: 0 to min{50000, 1000 × Capacity - Baseline performance}. Baseline performance = min{1,800 + 50 × Capacity, 50,000}. This parameter is supported only when the |
40000 |
| BurstingEnabled |
boolean |
Indicates whether performance burst feature is enabled. Valid values:
This parameter is supported only when the |
false |
| Throughput |
integer |
The throughput of the disk. Unit: MB/s. |
100 |
| ThroughputRead |
integer |
The read throughput of the disk. Unit: MB/s. |
100 |
| ThroughputWrite |
integer |
The write throughput of the disk. Unit: MB/s. |
100 |
| Placement |
object |
The collection of data placement information. This parameter is returned only when the Note
Currently, only ESSDs of the zone-redundant type ( |
|
| ZoneIds |
string |
The list of zones where the data is actually stored. |
"["cn-hangzhou-b", "cn-hangzhou-j"]" |
| SourceDiskId |
string |
The ID of the source disk. |
d-123********* |
| DataSource |
object |
The data source information of the disk. |
|
| Id |
string |
The ID of the data source. |
s-bp67acfmxazb4p**** |
| Type |
string |
The type of the data source. |
snapshot |
| ReadWriteMode |
string |
The access mode of the disk. Valid values:
|
ReadWrite |
Examples
Success response
JSON format
{
"NextToken": "AAAAAdDWBF2****",
"PageSize": 1,
"PageNumber": 1,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"TotalCount": 15,
"Disks": {
"Disk": [
{
"SerialNumber": "bp18um4r4f2fve2****",
"CreationTime": "2021-06-07T06:08:54Z",
"Status": "In_use",
"Type": "system",
"PerformanceLevel": "PL0",
"BdfId": "null",
"EnableAutoSnapshot": false,
"StorageSetId": "ss-i-bp1j4i2jdf3owlhe****",
"StorageSetPartitionNumber": 11,
"DiskId": "d-bp18um4r4f2fve24****",
"DeleteAutoSnapshot": false,
"StorageClusterId": "dbsc-j5e1sf2vaf5he8m2****",
"Encrypted": false,
"IOPSRead": 2000,
"MountInstanceNum": 1,
"Description": "testDescription",
"Device": "/dev/xvdb",
"DiskName": "testDiskName",
"Portable": false,
"ImageId": "m-bp13aqm171qynt3u***",
"KMSKeyId": "0e478b7a-4262-4802-b8cb-00d3fb408***",
"DeleteWithInstance": true,
"DetachedTime": "2021-06-07T21:01:22Z",
"SourceSnapshotId": "s-bp67acfmxazb4p****",
"AutoSnapshotPolicyId": "sp-bp67acfmxazb4p****",
"EnableAutomatedSnapshotPolicy": false,
"IOPSWrite": 2000,
"InstanceId": "i-bp67acfmxazb4q****",
"IOPS": 4000,
"RegionId": "cn-hangzhou",
"ExpiredTime": "2021-07-07T16:00Z",
"Size": 60,
"ResourceGroupId": "rg-bp67acfmxazb4p****",
"DiskChargeType": "PrePaid",
"ZoneId": "cn-hangzhou-i",
"AttachedTime": "2021-06-07T06:08:56Z",
"Category": "cloud_ssd",
"ProductCode": "jxsc000204",
"MultiAttach": "Disabled",
"OperationLocks": {
"OperationLock": [
{
"LockReason": "security"
}
]
},
"MountInstances": {
"MountInstance": [
{
"AttachedTime": "2017-12-05T2340:00Z",
"InstanceId": "i-bp1j4i2jdf3owlhe****",
"Device": "/dev/xvda"
}
]
},
"Tags": {
"Tag": [
{
"TagValue": "TestValue",
"TagKey": "TestKey"
}
]
},
"Attachments": {
"Attachment": [
{
"InstanceId": "i-bp67acfmxazb4q****",
"Device": "/dev/xvda",
"AttachedTime": "2021-06-07T06:08:56Z"
}
]
},
"ProvisionedIops": 40000,
"BurstingEnabled": false,
"Throughput": 100,
"ThroughputRead": 100,
"ThroughputWrite": 100,
"Placement": {
"ZoneIds": "\"[\"cn-hangzhou-b\",\n\"cn-hangzhou-j\"]\""
},
"SourceDiskId": "d-123*********",
"DataSource": {
"Id": "s-bp67acfmxazb4p****",
"Type": "snapshot"
},
"ReadWriteMode": "ReadWrite"
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidDiskType.ValueNotSupported | The specified disk type is not supported. | The specified disk type is not supported. |
| 400 | InvalidCategory.ValueNotSupported | The specified value of parameter Category is not supported. Please set Category to a supported value such as cloud_essd and try again. | |
| 400 | InvalidStatus.ValueNotSupported | The specified parameter Status is not valid. Please set it to a supported disk status and try again. | |
| 400 | InvalidTag.Mismatch | The specified Tag.N.Key and Tag.N.Value do not match. Please check the tag key and value pair and try again. | |
| 400 | InvalidTagCount | The specified tags are beyond the permitted range. | The number of specified tags exceeds the upper limit. |
| 400 | InvalidRegion.NotFound | The specified RegionId does not exist. Please call DescribeRegions to query the supported regions and try again. | |
| 400 | InvalidZoneId.NotFound | The specified ZoneId does not exist. Please verify the ZoneId and the current region and try again. | |
| 400 | MissingParamter.RegionId | The specified parameter RegionId is missing. Please specify RegionId and try again. | |
| 400 | InvalidParameter.DiskIds | The specified parameter diskIds is not valid. | The specified DiskIds parameter is invalid. |
| 400 | IncompleteParamter | Some required parameters are missing in this request. Please check the required parameters and try again. | |
| 400 | InvalidParamter | Some parameters are invalid in this request. | The request contains invalid parameters. |
| 400 | InvalidSnapshot.NotFound | The specified SnapshotId does not exist. Please verify the SnapshotId and the current region and try again. | |
| 400 | InvalidPerformanceLevel.Malformed | The specified parameter PerformanceLevel is not valid. Valid values are PL0/PL1/PL2/PL3. | |
| 500 | InternalError | The request processing has failed due to an internal error and you may retry later or contact support with the request ID. | |
| 403 | InvalidDiskIds.Malformed | The amount of specified disk Ids exceeds the limit. | |
| 403 | InvalidCategory.ValueNotSupported | The specified value of parameter Category is not supported. Please set Category to a supported value such as cloud_essd and try again. | |
| 403 | UserNotInTheWhiteList | The current account is not in the allowlist for this operation. Please submit a ticket to apply for access. | |
| 403 | InvalidParameter.MultiAttachAndEnableSharedNotMatch | The parameters MultiAttach and EnableShared do not match. Please check the values of both parameters and try again. | |
| 403 | InvalidParameter.MultiAttach | The specified parameter MultiAttach is not valid. Please set it to Disabled or Enabled and try again. | |
| 404 | InvalidFilterKey.NotFound | The specified Filter.N.Key does not exist. Please verify the Filter.N.Key and try again. | |
| 404 | InvalidFilterValue | The filter value is not valid. | |
| 404 | InvalidDiskIds.ValueNotSupported | The specified parameter "DiskIds" is not supported. | The specified DiskIds parameter is invalid. |
| 404 | InvalidDiskChargeType.NotFound | The specified DiskChargeType does not exist. Please verify the DiskChargeType and try again. | |
| 404 | InvalidLockReason.NotFound | The specified LockReason does not exist. Please verify the LockReason and try again. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.