tencent cloud

APIs

CreateDisks

Download
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-05-12 19:38:02

1. API Description

Domain name for API request: cbs.intl.tencentcloudapi.com.

This API is used to create cloud disks.

  • This API supports creating a cloud disk with a data disk snapshot so that the snapshot data can be copied to the purchased cloud disk.
  • This API is async. A cloud disk ID list will be returned when a request is made successfully, but it does not mean that the creation has been completed. You can call the DescribeDisks API to query cloud disks by DiskId. If a new cloud disk can be found and its status is UNATTACHED or ATTACHED, the cloud disk has been created successfully.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: CreateDisks.
Version Yes String Common Params. The value used for this API: 2017-03-12.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
Placement Yes Placement Location of the instance. You can use this parameter to specify the attributes of the instance, such as its availability zone and project. If no project is specified, the default project will be used.
DiskChargeType Yes String Cloud disk billing mode. POSTPAID_BY_HOUR: Pay-as-you-go by hour
  • CDCPAID: Billed together with the bound dedicated cluster
    For more information on the pricing in each mode, see Pricing Overview.
  • DiskType Yes String Hard disk media type. valid values:
  • CLOUD_PREMIUM: indicates high-performance CLOUD block storage

  • CLOUD_BSSD: indicates universal type SSD CLOUD disk

  • CLOUD_SSD: indicates SSD CLOUD disk

  • CLOUD_HSSD: indicates enhanced SSD CLOUD disk

  • CLOUD_TSSD: indicates ultra-fast SSD cbs.
  • ultra-fast SSD CBS (CLOUD_TSSD) is only supported when purchased with some instances and not currently supported for separate creation.
    DiskName No String Cloud disk name. If it is not specified, "Unnamed" will be used by default. The maximum length is 60 bytes.
    Tags.N No Array of Tag Tags bound to the cloud disk.
    SnapshotId No String Snapshot ID. If this parameter is specified, the cloud disk will be created based on the snapshot. The snapshot must be a data disk snapshot. To query the type of a snapshot, call the DescribeSnapshots API and see the DiskUsage field in the response.
    DiskCount No Integer Number of cloud disks to be created. If it is not specified, 1 will be used by default. There is an upper limit on the maximum number of cloud disks that can be created in a single request. For more information, see Use Limits.
    ThroughputPerformance No Integer Use this parameter to purchase additional performance for CLOUD disk in MB/s.
    currently, only extreme CBS (CLOUD_TSSD) and enhanced SSD CLOUD disk (CLOUD_HSSD) are supported.
    KmsKeyId No String Custom key for purchasing encrypted disks. when this parameter is input, the Encrypt parameter cannot be empty.
    DiskSize No Integer Cloud disk size in GiB.
  • if SnapshotId is input, DiskSize can be omitted. at this point, the new cloud disk size will be the snapshot size.
  • if both SnapshotId and DiskSize are input, the cloud disk size must be greater than or equal to the snapshot size.
  • for the cloud disk size range, please refer to the product type of cloud block storage.
  • .
    Shareable No Boolean When True is entered, the cloud disk will be created as a shared cloud disk. default is False. since shared cloud disk does not support encryption, this parameter cannot be imported simultaneously with the Encrypt parameter.
    ClientToken No String A unique string supplied by the client to ensure that the request is idempotent. Its maximum length is 64 ASCII characters. If this parameter is not specified, the idempotency of the request cannot be guaranteed.
    Encrypt No String This parameter is used to create an encrypted cloud disk, with the value fixed as ENCRYPT. since shared cloud disk does not support encryption, this parameter cannot be imported simultaneously with the Shareable parameter.
    DiskChargePrepaid No DiskChargePrepaid Prepaid mode, that is, the settings for the monthly subscription-related parameters. through this parameter, you can specify the purchase duration of the monthly subscribed cloud disk, whether to enable auto-renewal, and other attributes. this parameter is required for creating a prepaid cloud disk, but no need to specify it when creating an hourly postpaid cloud disk.
    DeleteSnapshot No Integer Delete associated non-permanently retained snapshots when destroying the cloud disk. 0 means non-permanent snapshots are not deleted with cloud disk destruction, 1 means non-permanent snapshots are deleted with cloud disk destruction. default value is 0. whether a snapshot is permanently retained can be determined through the IsPermanent field in the snapshot description returned by the DescribeSnapshots api. True represents a permanent snapshot, False represents a non-permanent snapshot.
    AutoMountConfiguration No AutoMountConfiguration Specifies auto mount and initialization of the data disk when creating a cloud disk. this parameter cannot be imported simultaneously with the Encrypt parameter because encrypted disks do not support auto mount or initialization.
    DiskBackupQuota No Integer Specifies the cloud disk backup point quota.
    BurstPerformance No Boolean Specifies whether to enable burst performance when creating a CLOUD disk. currently only supports extreme cbs (CLOUD_TSSD) and enhanced SSD CLOUD disk (CLOUD_HSSD) with CLOUD disk size greater than or equal to 460GiB.
    EncryptType No String Specifies the CBS encryption type. valid values are ENCRYPT_V1 and ENCRYPT_V2, representing first generation and second generation encryption technology respectively. the two encryption technologies are incompatible. it is recommended to prioritize using second generation encryption technology ENCRYPT_V2. first generation encryption is only supported on some outdated models. this parameter is valid only when creating an encrypted cloud disk.

    3. Output Parameters

    Parameter Name Type Description
    DiskIdSet Array of String ID list of the created cloud disks. Note: This field may return null, indicating that no valid values can be obtained.
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Purchasing with Basic Parameters

    This example shows you how to purchase a cloud disk with the following configuration: location is Guangzhou Zone 3, cloud disk size is 50GiB, type of cloud disk is ordinary cloud disk, project ID is 0, payment mode is prepaid, purchase duration is 1 month, notify and auto-renew on expiration.

    Input Example

    POST / HTTP/1.1
    Host: cbs.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateDisks
    <Common request parameters>
    
    {
        "Placement": {
            "ProjectId": 0,
            "Zone": "ap-guangzhou-2"
        },
        "DiskChargeType": "PREPAID",
        "DiskCount": 1,
        "DiskType": "CLOUD_HSSD",
        "ThroughputPerformance": 100,
        "DiskSize": 500,
        "DiskChargePrepaid": {
            "RenewFlag": "NOTIFY_AND_AUTO_RENEW",
            "Period": 1
        }
    }
    

    Output Example

    {
        "Response": {
            "DiskIdSet": [
                "disk-lzrg2pwi"
            ],
            "RequestId": "6a57da9a-2049-7182-2de3-5a1f8014ccfd"
        }
    }
    

    Example2 Creating a Cloud Disk Based on Snapshot

    This example shows you how to create a cloud disk by importing a snapshot without specifying the DiskSize parameter. At this point, the newly purchased cloud disk size equals the snapshot size, and the cloud disk copies the snapshot data.

    Input Example

    POST / HTTP/1.1
    Host: cbs.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateDisks
    <Common request parameters>
    
    {
        "Placement": {
            "ProjectId": 0,
            "Zone": "ap-guangzhou-2"
        },
        "DiskChargeType": "PREPAID",
        "DiskCount": 1,
        "DiskType": "CLOUD_HSSD",
        "DiskChargePrepaid": {
            "RenewFlag": "NOTIFY_AND_AUTO_RENEW",
            "Period": 1
        },
        "SnapshotId": "snap-iepc4w3h"
    }
    

    Output Example

    {
        "Response": {
            "DiskIdSet": [
                "disk-6rz0ilvu"
            ],
            "RequestId": "5e93a212-ca01-0fdc-eedd-5a1fce5e83e6"
        }
    }
    

    Example3 Creating an Hourly Postpaid Cloud Disk

    This example shows you how to create a cloud disk in Guangzhou Zone 3 with the following configuration: high-performance cloud block storage, 100GiB size, and hourly postpaid payment type.

    Input Example

    POST / HTTP/1.1
    Host: cbs.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: CreateDisks
    <Common request parameters>
    
    {
        "DiskName": "postPayDisk",
        "Placement": {
            "ProjectId": 0,
            "Zone": "ap-guangzhou-3"
        },
        "DiskChargeType": "POSTPAID_BY_HOUR",
        "DiskCount": 1,
        "DiskType": "CLOUD_PREMIUM",
        "DiskSize": 100
    }
    

    Output Example

    {
        "Response": {
            "DiskIdSet": [
                "disk-ecjc4cpw"
            ],
            "RequestId": "fe2274fa-eaec-4009-807b-6ffc00963fec"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InternalError.ComponentError Dependent component request failed. Please contact customer service.
    InvalidAccount.InsufficientBalance Insufficient account balance
    InvalidInstanceId.NotFound The ‘InstanceId’ entered does not exist.
    InvalidParameter.DiskConfigNotSupported Currently configured cloud disk not supported in current region.
    InvalidParameter.InvalidClientToken ClientToken is unavailable.
    InvalidParameter.ProjectIdNotExist The project ID does not exist.
    InvalidParameterValue Invalid parameter value.
    InvalidParameterValue.LimitExceeded Number of parameter values exceeds the limit.
    InvalidSnapshotId.NotFound The ‘SnapshotId’ entered does not exist.
    LimitExceeded.InstanceAttachedDisk Number of instances mounted to cloud disk exceeds the limit.
    LimitExceeded.TagQuotaLimitExceeded HTTP calls to the Tag service exceed the frequency limit.
    MissingParameter Missing parameter.
    ResourceBusy The resource is busy. Try again later.
    ResourceInsufficient Insufficient resources.
    TradeDealConflict Order conflict.
    UnauthorizedOperation The operation is unauthorized.
    UnauthorizedOperation.NotCertification Payment failed as the account has not completed identity verification.
    UnauthorizedOperation.NotHavePaymentRight No payment permission.
    UnauthorizedOperation.RoleNotExists The authorization role does not exist.

    Bantuan dan Dukungan

    Apakah halaman ini membantu?

    masukan