All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::ECS::Disks

最終更新日:Nov 20, 2024

DATASOURCE::ECS::Disks is used to query the Elastic Block Storage (EBS) devices that you created, including cloud disks and local disks.

Syntax

{
  "Type": "DATASOURCE::ECS::Disks",
  "Properties": {
    "Status": String,
    "DiskIds": List,
    "EnableShared": String,
    "Category": String,
    "KMSKeyId": String,
    "ResourceGroupId": String,
    "ZoneId": String,
    "InstanceId": String,
    "Encrypted": Boolean,
    "DeleteWithInstance": Boolean,
    "DeleteAutoSnapshot": String,
    "EnableAutomatedSnapshotPolicy": Boolean,
    "DiskChargeType": String,
    "EnableAutoSnapshot": Boolean,
    "AutoSnapshotPolicyId": String,
    "DiskName": String,
    "MultiAttach": String,
    "DiskType": String,
    "SnapshotId": String,
    "Portable": String,
    "Filters": List,
    "AdditionalAttributes": List,
    "Tags": List,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Status

String

No

Yes

The status of the cloud disk.

Valid values:

  • In_use: The cloud disk is in use.

  • Available: The cloud disk can be attached.

  • Attaching: The cloud disk is being attached.

  • Detaching: The cloud disk is being detached.

  • Creating: The cloud disk is being created.

  • ReIniting: The cloud disk is being initialized.

  • All (default): all states.

DiskIds

List

No

Yes

The IDs of the cloud disks or local disks.

You can specify up to 100 IDs. Separate multiple IDs with commas (,).

Example: ["d-bp67acfmxazb4p****", "d-bp67acfmxazb4g****", … "d-bp67acfmxazb4d****"].

EnableShared

String

No

Yes

Specifies whether the disk is a Shared Block Storage device.

Valid values:

  • true

  • false (default)

Category

String

No

Yes

The category of the cloud disk or local disk.

Valid values:

  • all: all disk categories

  • cloud: basic disk

  • cloud_efficiency: ultra disk

  • cloud_ssd: standard SSD

  • cloud_essd: Enterprise SSD (ESSD)

  • local_ssd_pro: I/O-intensive local disk

  • local_hdd_pro: throughput-intensive local disk

KMSKeyId

String

No

Yes

The ID of the Key Management Service (KMS) key that is used for the cloud disk.

None.

ResourceGroupId

String

No

Yes

The ID of the resource group to which the cloud disk or local disk belongs.

None.

ZoneId

String

No

Yes

The zone ID.

None.

InstanceId

String

No

Yes

The ID of the instance to which the cloud disk or local disk is attached.

None.

Encrypted

Boolean

No

Yes

Specifies whether the disk is an encrypted cloud disk.

Valid values:

  • true

  • false (default)

DeleteWithInstance

Boolean

No

Yes

Specifies whether to release the cloud disk when the associated instance is released.

Valid values:

  • true: releases the cloud disk when the associated instance is released.

  • false (default): retains and converts the cloud disk into a pay-as-you-go data disk when the associated instance is released.

DeleteAutoSnapshot

String

No

Yes

Specifies whether to delete the automatic snapshot of the cloud disk when the disk is released.

Valid values:

  • true

  • false (default)

EnableAutomatedSnapshotPolicy

Boolean

No

Yes

Specifies whether an automatic snapshot policy is configured for the cloud disk.

Valid values:

  • true

  • false (default)

DiskChargeType

String

No

Yes

The billing method of the cloud disk or local disk.

Valid values:

  • PrePaid: subscription

  • PostPaid: pay-as-you-go

EnableAutoSnapshot

Boolean

No

Yes

Specifies whether the automatic snapshot policy feature is enabled for the cloud disk.

Valid values:

  • true

  • false (default)

AutoSnapshotPolicyId

String

No

Yes

The ID of the automatic snapshot policy that is applied to the cloud disk.

None.

DiskName

String

No

Yes

The name of the cloud disk or local disk.

None.

MultiAttach

String

No

Yes

Specifies whether the multi-attach feature is enabled.

Valid values:

  • Disabled: The multi-attach feature is disabled.

  • Enabled: The multi-attach feature is enabled.

  • LegacyShared: This value is used to query Shared Block Storage devices.

DiskType

String

No

Yes

The type of the cloud disk or local disk that you want to query.

Valid values:

  • all (default): system disk and data disk

  • system: system disk

  • data: data disk

SnapshotId

String

No

Yes

The ID of the snapshot that is used to create the cloud disk.

None.

Portable

String

No

Yes

Specifies whether the cloud disk or local disk is removable.

Valid values:

  • true

  • false

Filters

List

No

Yes

The filters that you want to use to query resources.

You can specify one to two filters.

For more information, see Filters properties.

AdditionalAttributes

List

No

Yes

The additional attributes.

Set the value to IOPS. A value of IOPS specifies the maximum IOPS of the disk that you want to query.

Tags

List

No

Yes

The tags of the cloud disk or local disk.

For more information, see Tags properties.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

Filters syntax

"Filters": [
  {
    "Value": String,
    "Key": String
  }
]

Filters properties

Property

Type

Required

Editable

Description

Constraint

Value

String

No

No

The filter value.

Example: 2021-12-12T12:12Z.

Key

String

Yes

No

The filter key.

Example: CreationStartTime.

Tags syntax

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags properties

Property

Type

Required

Editable

Description

Constraint

Value

String

No

No

The tag value.

None.

Key

String

Yes

No

The tag key.

None.

Return values (Fn::GetAtt)

  • DiskIds: the IDs of the cloud disks or local disks.

  • Disks: details of the cloud disks or local disks.

Property

Type

Description

Constraint

DiskIds

List

The IDs of the cloud disks or local disks.

Example: ['d-bp180bogui4ky7o4****','d-bp180bogui4ky7o4****'].

Disks

List

Details of the cloud disks or local disks.

None.

Type

String

The type of the cloud disk or local disk.

None.

Status

String

The status of the cloud disk.

None.

SerialNumber

String

The serial number of the cloud disk or local disk.

Example: bp18um4r4f2fve2****.

PerformanceLevel

String

The performance level (PL) of the ESSD.

Valid values:

  • PL0: An ESSD can deliver up to 10,000 random read/write IOPS.

  • PL1: An ESSD can deliver up to 50,000 random read/write IOPS.

  • PL2: An ESSD can deliver up to 100,000 random read/write IOPS.

  • PL3: An ESSD can deliver up to 1,000,000 random read/write IOPS.

EnableAutoSnapshot

Boolean

Indicates whether the automatic snapshot policy feature is enabled for the cloud disk.

None.

StorageSetId

String

The ID of the storage set.

Example: ss-i-bp1j4i2jdf3owlhe****.

DiskId

String

The ID of the cloud disk or local disk.

Example: d-bp18um4r4f2fve24****.

StorageSetPartitionNumber

Integer

The maximum number of partitions in the storage set.

None.

MultiAttach

String

Indicates whether the multi-attach feature is enabled.

None.

DeleteAutoSnapshot

Boolean

Indicates whether the automatic snapshot of the cloud disk is deleted when the disk is released.

None.

Encrypted

Boolean

Indicates whether the disk is an encrypted cloud disk.

None.

IOPSRead

Integer

The number of read operations per second.

MountInstanceNum

Integer

The number of instances to which the Shared Block Storage device is attached.

None.

Description

String

The description of the cloud disk or local disk.

None.

Device

String

The device name of the instance to which the cloud disk or local disk is attached.

This property is returned if Status is set to In_use. This property is empty for cloud disks that have the multi-attach feature enabled.

Example: /dev/xvda.

DiskName

String

The name of the cloud disk or local disk.

None.

Portable

Boolean

Indicates whether the cloud disk or local disk is removable.

None.

StorageClusterId

String

The ID of the dedicated block storage cluster to which the cloud disk belongs.

This property is empty if your cloud disk belongs to a public block storage cluster.

ImageId

String

The ID of the image that is used to create the Elastic Compute Service (ECS) instance.

This property is returned only if cloud disks are created by using images. Otherwise, this property is empty.

DeleteWithInstance

Boolean

Indicates whether the cloud disk is released when the associated instance is released.

None.

KMSKeyId

String

The ID of the KMS key that is used for the cloud disk.

None.

DetachedTime

String

The most recent time when the cloud disk was detached. The time is displayed in UTC.

Example: 2021-06-07T21:01:22Z.

SourceSnapshotId

String

The ID of the snapshot that is used to create the cloud disk.

This property is empty if the cloud disk is not created by using a snapshot.

AutoSnapshotPolicyId

String

The ID of the automatic snapshot policy that is applied to the cloud disk.

None.

EnableAutomatedSnapshotPolicy

Boolean

Indicates whether an automatic snapshot policy is configured for the cloud disk.

None.

IOPSWrite

Integer

The number of write operations per second.

InstanceId

String

The ID of the instance to which the cloud disk or local disk is attached.

None.

IOPS

Integer

The number of read and write operations per second.

ExpiredTime

String

The expiration time of the subscription cloud disk. The time is displayed in UTC.

Example: 2021-07-07T16:00Z.

Size

Integer

The size of the cloud disk or local disk.

Example: 60.

ResourceGroupId

String

The ID of the resource group to which the cloud disk or local disk belongs.

None.

ZoneId

String

The zone ID of the cloud disk or local disk.

None.

DiskChargeType

String

The billing method of the cloud disk or local disk.

None.

Category

String

The category of the cloud disk or local disk.

None.

AttachedTime

String

The most recent time when the cloud disk was attached. The time is displayed in UTC.

Example: 2021-06-05T21:01:22Z.

ProductCode

String

The product code of the disk in Alibaba Cloud Marketplace.

None.

OperationLocks

List

The reasons why the cloud disk or local disk is locked.

None.

Tags

List

The tags of the cloud disk or local disk.

Example:

[
      {
        "Value": "value_test",
        "Key": "key_test"
      },
      {
        "Value": "value_test2",
        "Key": "key_test2"
      }
    ]

Attachments

List

The attachment information about the cloud disk.

The value is a list that consists of Attachment values, and is not returned if Shared Block Storage devices are queried.

Example:

 [
      {
        "AttachedTime": "2022-02-14T09:13:39Z",
        "InstanceId": "i-bp1evllqxw6b1srq****",
        "Device": "/dev/xvda"
      }
    ],

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "Disks": {
      "Type": "DATASOURCE::ECS::Disks",
      "Properties": {
        "Filters": [
          {
            "Key": "CreationStartTime",
            "Value": "2021-12-12T12:12Z"
          }
        ]
      }
    }
  },
  "Outputs": {
    "Disks": {
      "Value": {
        "Fn::GetAtt": [
          "Disks",
          "Disks"
        ]
      }
    },
    "DisksIds": {
      "Value": {
        "Fn::GetAtt": [
          "Disks",
          "DiskIds"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  Disks:
    Type: DATASOURCE::ECS::Disks
    Properties:
      Filters:
        - Key: CreationStartTime
          Value: 2021-12-12T12:12Z
Outputs:
  Disks:
    Value:
      Fn::GetAtt:
        - Disks
        - Disks
  DisksIds:
    Value:
      Fn::GetAtt:
        - Disks
        - DiskIds