This API is used to attach a disk to an ECS.
POST /v2.1/{project_id}/servers/{server_id}/os-volume_attachments
POST /v2/{project_id}/servers/{server_id}/os-volume_attachments
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
volumeAttachment |
Yes |
Object |
Specifies the volumes to be attached. For details, see Table 3. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
volumeId |
Yes |
String |
Specifies the ID of the disk to be attached. The value is in UUID format. |
device |
No |
String |
Specifies the device name, such as /dev/sda or /dev/sdb. The new disk device name cannot be the same as an existing one. The device name must be specified based on the sequence of existing device names. Otherwise, the system automatically generates one. NOTE:
VBD disk device names can only be /dev/vdb through /dev/vdx. You are advised to attach the VBD disks in alphabetical order. Otherwise, the disk drive letters may be incorrect on the ECS. |
POST https://{endpoint}/v2/{project_id}/servers/{server_id}/os-volume_attachments POST https://{endpoint}/v2.1/{project_id}/servers/{server_id}/os-volume_attachments
{ "volumeAttachment": { "volumeId": "54667652-3029-4af8-9222-2d53066fd61c", "device": "/dev/sdb" } }
{ "volumeAttachment": { "device": "/dev/vdb", "serverId": "ab258e25-e351-47c7-b6e3-0749c5d9ed6a", "id": "54667652-3029-4af8-9222-2d53066fd61c", "volumeId": "54667652-3029-4af8-9222-2d53066fd61c" } }