Updated on 2024-02-27 GMT+08:00

Creating EVS Disks (Deprecated)

Function

This API is used to create one or multiple EVS disks.

Calling Method

For details, see Calling APIs.

URI

POST /v3/{project_id}/cloudvolumes

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

The project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

A token obtained from IAM is valid for 24 hours. When using a token for authentication, cache it to avoid frequently calling the API.

X-Client-Token

No

String

The idempotence identifier of a request. This parameter value is generated by the client and must be unique among requests. The value is a 36-digit character string in the UUID format and is valid for 8 hours. If multiple requests carry the same idempotent identifier, the requests are considered as an idempotent request and the same response body is returned.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

volume

Yes

CreateVolumeOptionV3 object

The disk to be created.

Table 4 CreateVolumeOptionV3

Parameter

Mandatory

Type

Description

backup_id

No

String

The backup ID. This parameter is mandatory when you create the disk from a backup.

NOTE:

For details about how to obtain the backup ID, see Querying All Backups.

availability_zone

Yes

String

The AZ where you want to create the disk. If the specified AZ does not exist, the disk will fail to be created.

NOTE:

For details about how to obtain the AZ, see Querying All AZs.

description

No

String

The disk description. You can enter up to 85 characters.

size

No

Integer

The disk size, in GiB. The restrictions are as follows: System disk: 1 GiB to 1,024 GiB Data disk: 10 GiB to 32,768 GiB This parameter is mandatory when you create an empty disk.

If you create the disk from a snapshot, this parameter is mandatory, and the disk size must be greater than or equal to the snapshot size.

If you create the disk from an image, this parameter is mandatory, and the disk size must be greater than or equal to the minimum capacity required by the min_disk image attribute.

This parameter is optional if you create the disk from a backup. If not specified, the disk size is the same as the backup size.

NOTE:

If the specified value is a decimal, the number part will be used by default.

name

No

String

The disk name. If you create one disk, the name value is the disk name. You can enter up to 85 characters. If you create multiple disks (the count value greater than 1), the system automatically adds a hyphen followed by a four-digit incremental number, such as -0000, to the end of each disk name. For example, the disk names can be volume-0001 and volume-0002.

snapshot_id

No

String

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

Query Details About EVS Snapshots.

imageRef

No

String

The image ID. If this parameter is specified, the disk is created from an image.

NOTE:

Bare Metal Server (BMS) system disks cannot be created from BMS images.

For details about how to obtain the image ID, see Querying Images.

volume_type

Yes

String

The disk type. The value can be SATA, SAS, GPSSD, or SSD.

  • SATA: the common I/O type (sold out)

  • SAS: the high I/O type

  • GPSSD: the general purpose SSD type

  • SSD: the ultra-high I/O type.

If the specified disk type is not available in the AZ, the disk will fail to be created.

NOTE:

When you create a disk from a snapshot, ensure that the disk type of the new disk is consistent with that of the snapshot's source disk. For details about disk types, see

Disk Types and Performance.

count

No

Integer

The number of disks to be created in a batch. If this parameter is not specified, only one disk will be created. You can create a maximum of 100 disks in a batch.

If disks are created from backups, batch creation is not supported, and this parameter must be set to 1.

NOTE:

If the specified value is a decimal, the number part will be used by default.

shareable

No

String

Whether the disk is shareable. The value can be true (shareable) or false (non-shareable).

NOTE:

This field has been deprecated. Use multiattach.

metadata

No

VolumeMetadataV3 object

The information of the disk to be created.

multiattach

No

String

Whether the disk is shareable. The default value is false. true: The disk is shareable. false: The disk is not shareable.

For details, see Shared EVS Disks and Usage Instructions.

tags

No

Map<String,String>

The tags added to the disk during the disk creation.

A maximum of 10 tags can be added to a disk.

A tag key must be unique. Deduplication will be performed for duplicate keys. So only one key among duplicate keys of a tag is valid.

Tag key: A tag key can contain a maximum of 36 characters. It can contain letters, digits, underscores (_), hyphens (-), and Unicode characters (\u4E00-\u9FFF).

Tag value: A tag value can be 43 characters long and can be an empty string. It can contain letters, digits, underscores (_), periods (.), hyphens (-), and Unicode characters (\u4E00-\u9FFF).

enterprise_project_id

No

String

The enterprise project ID. This ID is associated with the disk during the disk creation. If this parameter is not transferred or its value is set to 0, the disk will be associated with the default enterprise project.

For details, see Enterprise Management User Guide.

Table 5 VolumeMetadataV3

Parameter

Mandatory

Type

Description

__system__cmkid

No

String

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.

__system__encrypted

No

String

The encryption field in metadata. 0: no encryption 1: encryption If this parameter does not appear, the disk is not encrypted.

full_clone

No

String

The method of creation when the disk is created from a snapshot.

  • 0: linked clone

  • 1: full clone

hw:passthrough

No

String

The parameter that describes the disk device type in metadata.

  • If this parameter value is true, the disk device type is SCSI, which allows ECS OSs to directly access the underlying storage media and supports SCSI reservation commands.

  • If this parameter value is false, the disk device type is VBD, which supports only simple SCSI read/write commands.

  • If this parameter does not appear, the disk device type is VBD.

orderID

No

String

The parameter that describes the disk billing mode in metadata.

If this parameter has a value, the disk is billed on a yearly/monthly basis. If not, the disk is billed on a pay-per-use basis.

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

job_id

String

The task ID returned in a normal response.

NOTE:

To query the task status, see section "Querying Task Status".

Example Requests

POST https://{endpoint}/v3/{project_id}/cloudvolumes

{
  "volume" : {
    "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"
    }
  }
}

Example Responses

None

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.