AttachDisks

1. API Description

This API is used to attach disks to instance.

Note

  • A maximum of 10 disks can be attached to an instance in one request.

  • Quantity of attached disks cannot exceed available disk numbers of an instance, that is usually 15 disks.

  • The disk and the instance to which you want to attach the disk reside in the same zone.

  • You can only attach disks to the available instance. Please note that status of DEPLOYING or PENDING is not available.

  • Disks must be detachable (portable = true) .

  • This API is an async API. A request ID is returned after the creation request is sent. However, it does not mean the operation has been completed. You can use DescribeDisks to query the status of the disk. If the status changes from AVAILABLE to IN_USE, it means that the disk is attached successfully.

2. Input Parameters

The following request parameter list only provides API request parameters.

3. Output Parameters

4. Code Example

Attach disks to an instance.

POST /api/v2/vm HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: AttachDisks
<Common Request Params>

Request:
{
  "diskIds": [
    "your-disk-id"
  ],
  "instanceId": "your-instance-id"
}

Response:
{
  "requestId": "T425ED37F-1BE5-4274-B068-9A58C51F21A8",
  "response": {
    "requestId": "T425ED37F-1BE5-4274-B068-9A58C51F21A8"
  }
}

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

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

Last updated