This API is used to create one or multiple EVS disks.
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
volume |
Object |
Yes |
Specifies the information of the disks to be created. For details, see Parameters in the volume field. |
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
backup_id |
String |
No |
Specifies the ID of the backup that can be used to create a disk. This parameter is mandatory when you use a backup to create the disk. NOTE:
For how to obtain the backup ID, see Querying All Backups in the Cloud Backup and Recovery API Reference. |
availability_zone |
String |
Yes |
Specifies the AZ where you want to create the disk. If the AZ does not exist, the disk will fail to create. NOTE:
For details about how to obtain the AZ, see Querying All AZs. |
description |
String |
No |
Specifies the disk description. The value can contain a maximum of 255 bytes. |
size |
Integer |
No |
Specifies the disk size, in GB. Its value can be as follows:
This parameter is mandatory when you create an empty disk. You can specify the parameter value as required within the value range. This parameter is mandatory when you create the disk from a snapshot. Ensure that the disk size is greater than or equal to the snapshot size. This parameter is mandatory when you create the disk from an image. Ensure that the disk size is greater than or equal to the minimum disk capacity required by min_disk in the image attributes. This parameter is optional when you create the disk from a backup. If this parameter is not specified, the disk size is equal to the backup size. NOTE:
If the specified parameter value is a decimal, the integral part of the value is used by default when the request is sent. |
name |
String |
No |
Specifies the disk name.
|
snapshot_id |
String |
No |
Specifies the snapshot ID. If this parameter is specified, the disk is created from a snapshot. NOTE:
For details about how to obtain the snapshot ID, see Querying Details About EVS Snapshots. |
imageRef |
String |
No |
Specifies the image ID. If this parameter is specified, the disk is created from an image. NOTE:
BMS system disks cannot be created from BMS images. For how to obtain the image ID, see Querying Images in the Image Management Service API Reference. |
volume_type |
String |
Yes |
Specifies the disk type. Currently, the value can be SSD, SAS, SATA, co-p1, or uh-l1.
If the specified disk type is not available in the AZ, the disk will fail to create. NOTE:
|
count |
Integer |
No |
Specifies the number of disks to be created in a batch. If this parameter is not specified, only one disk is created. You can create a maximum of 100 disks in a batch. If disks are created from a backup, batch creation is not supported, and this parameter must be set to 1. NOTE:
If the specified parameter value is a decimal, the integral part of the value is used by default when the request is sent. |
shareable |
String |
No |
Specifies whether the disk is shareable. The value can be true (shared disk) or false (common disk). NOTE:
This field is no longer used. Use multiattach. |
metadata |
Object |
No |
Specifies the metadata of the created disk. The length of the key or value in the metadata cannot exceed 255 bytes. For details about metadata, see Parameters in the metadata field. Only the listed parameters can be specified when creating a disk. NOTE:
Parameter values under metadata cannot be null. |
multiattach |
Boolean |
No |
Specifies whether the disk is shareable. The default value is false.
|
tags |
Object |
No |
Specifies the tags added to the disk during the disk creation. A maximum of 10 tags can be created for a disk. Tag keys of a tag must be unique. Deduplication will be performed for duplicate keys. Therefore, only one tag key in the duplicate keys is valid.
|
Specifying either two of the backup_id, snapshot_id, and imageRef fields is not supported.
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
__system__encrypted |
String |
No |
Specifies the encryption field in metadata. The value can be 0 (not encrypted) or 1 (encrypted). If this parameter does not exist, the disk will not be encrypted by default. |
__system__cmkid |
String |
No |
Specifies the encryption CMK ID in metadata. This parameter is used together with __system__encrypted for encryption. The length of cmkid is fixed at 36 bytes. NOTE:
For details about how to obtain the CMK ID, see Querying the List of CMKs in the Key Management Service API Reference. |
hw:passthrough |
String |
No |
|
full_clone |
String |
No |
If the disk is created from a snapshot and linked cloning needs to be used, set this parameter to 0. |
When creating a disk, you can only specify the fields of metadata listed in the preceding table.
{ "volume": { "backup_id": null, "count": 1, "availability_zone": "az-dc-1", "description": "test_volume_1", "size": 120, "name": "test_volume_1", "volume_type": "SSD", "metadata": { "__system__encrypted": "1", "__system__cmkid": "37b0d52e-c249-40d6-83cb-2b93f22445bd" } } }
Parameter |
Type |
Description |
---|---|---|
job_id |
String |
Specifies the task ID. NOTE:
For details about how to query the task status, see Querying Task Status. |
error |
Object |
Specifies the error message returned when an error occurs. For details, see Parameters in the error field. |
Parameter |
Type |
Description |
---|---|---|
message |
String |
Specifies the error message returned when an error occurs. |
code |
String |
Specifies the error code returned when an error occurs. For details about the error code, see Error Codes. |
{ "job_id": "70a599e0-31e7-49b7-b260-868f441e862b" }
or
{ "error": { "message": "XXXX", "code": "XXX" } }
For details, see Error Codes.