Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating EVS Disks

Function

This API is used to create EVS disks.

Calling Method

For details, see Calling APIs.

URI

POST /v2/{project_id}/volumes

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

The project ID.

For details about how to obtain the project ID, see Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

The user token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

volume

Yes

CinderCreateVolumeOption object

The information of the disk to be created. Note: Specifying any two of the source_volid, snapshot_id, and imageRef fields together is not supported.

OS-SCH-HNT:scheduler_hints

No

CinderCreateVolumeSchedulerHints object

The scheduling parameter. The dedicated_storage_id field is supported, indicating that disks can be created in DSS storage pools.

Table 4 CinderCreateVolumeOption

Parameter

Mandatory

Type

Description

availability_zone

Yes

String

The AZ where you want to create the disk. If the specified AZ does not exist or is different from the AZ to which the backup belongs, the disk will fail to be created.

consistencygroup_id

No

String

The ID of the consistency group. If this parameter is specified, the disk belongs to this consistency group. This function is currently not available.

description

No

String

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

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.

metadata

No

VolumeMetadata object

The disk metadata. The length of key or value under metadata can contain no more than 255 bytes.

The metadata field only shows some parameters. You can specify other parameters based on your requirements.

value of a key-value pair in metadata cannot be null.

multiattach

No

Boolean

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.

name

No

String

The disk name. You can enter up to 64 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.

snapshot_id

No

String

The snapshot ID. If this parameter is specified, the disk is created from a snapshot.

source_replica

No

String

This parameter indicates that the disk is cloned from another disk. This function is currently not available.

source_volid

No

String

The source disk ID. If this parameter is specified, the disk is cloned from an existing disk. This function is currently not supported.

volume_type

Yes

String

The disk type.

The value can be SATA, SAS, GPSSD, SSD, ESSD, GPSSD2, or ESSD2.

  • SATA: the common I/O type

  • SAS: the high I/O type

  • GPSSD: the general purpose SSD type

  • SSD: the ultra-high I/O type

  • ESSD: the extreme SSD type

  • GPSSD2: the general purpose SSD V2 type

  • ESSD2: the extreme SSD V2 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.

Enumeration values:

  • ESSD2

  • GPSSD2

  • ESSD

  • SSD

  • GPSSD

  • SAS

  • SATA

iops

No

Integer

The configured IOPS. This parameter is mandatory only when a general purpose SSD V2 or an extreme SSD V2 disk is created.

NOTE:
  • To learn the IOPS ranges of general purpose SSD V2 and extreme SSD V2 disks, see the EVS performance data table in Disk Types and Performance.

  • Only pay-per-use billing is supported.

throughput

No

Integer

The configured throughput, in the unit of MiB/s. This parameter is mandatory only when a general purpose SSD V2 disk is created.

NOTE:

-To learn the throughput range of general purpose SSD V2 disks, see the EVS performance data table in Disk Types and Performance.

  • Only pay-per-use billing is supported.

Table 5 VolumeMetadata

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.

NOTE:

Use an HTTPS request to obtain the key ID. For details, see Querying the Key List.

__system__encrypted

No

String

The encryption field in metadata. The value can be 0 (no encryption) or 1 (encryption). If this parameter does not appear, the disk is not encrypted.

full_clone

No

String

If the disk is created from a snapshot and linked cloning needs to be used, set this parameter to 0.

hw:passthrough

No

String

If this parameter is set to true, the disk device type is SCSI, which allows ECS OSs to directly access the underlying storage media. SCSI reservation commands are supported.

If this parameter is set to false, the disk device type is VBD, which is also the default type. VBD supports only simple SCSI read/write commands.

If this parameter is not available, the disk device type is VBD.

Table 6 CinderCreateVolumeSchedulerHints

Parameter

Mandatory

Type

Description

dedicated_storage_id

No

String

The dedicated storage pool ID.

Response Parameters

Status code: 202

Table 7 Response body parameters

Parameter

Type

Description

volume

CreateVolumeDetail object

The created disk information.

Table 8 CreateVolumeDetail

Parameter

Type

Description

id

String

The disk ID.

links

Array of Link objects

The disk URI.

name

String

The disk name.

status

String

The disk status. For details, see EVS Disk Status.

attachments

Array of VolumeAttachment objects

The attachment information.

availability_zone

String

The AZ to which the disk belongs.

bootable

String

Whether the disk is bootable. true: The disk is bootable. false: The disk is not bootable.

encrypted

Boolean

This field is currently not supported.

created_at

String

The time when the disk was created.

Time format: UTC YYYY-MM-DDTHH:MM:SS.XXXXXX

description

String

The disk description.

volume_type

String

The disk type.

The value can be SATA, SAS, GPSSD, SSD, ESSD, GPSSD2, or ESSD2.

  • SATA: the common I/O type

  • SAS: the high I/O type

  • GPSSD: the general purpose SSD type

  • SSD: the ultra-high I/O type

  • ESSD: the extreme SSD type

  • GPSSD2: the general purpose SSD V2 type

  • ESSD2: the extreme SSD V2 type If the specified disk type is not available in the AZ, the disk will fail to be created.

replication_status

String

The reserved field.

consistencygroup_id

String

The ID of the consistency group where the disk belongs.

source_volid

String

The source disk ID.

This field is currently not supported.

snapshot_id

String

The snapshot ID.

metadata

VolumeMetadata object

The metadata.

size

Integer

The disk size, in GiB.

user_id

String

The ID of the user that uses the disk.

updated_at

String

The time when the disk was updated.

shareable

Boolean

Whether the disk is shareable. Note: This field has been deprecated. Use multiattach.

multiattach

Boolean

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

storage_cluster_id

String

The reserved field.

Table 10 VolumeAttachment

Parameter

Type

Description

attached_at

String

The time when the disk was attached.

Time format: UTC YYYY-MM-DDTHH:MM:SS.XXXXXX

attachment_id

String

The attachment ID.

device

String

The device name.

host_name

String

The name of the physical host housing the cloud server to which the disk is attached.

id

String

The ID of the attached disk.

server_id

String

The ID of the server to which the disk is attached.

volume_id

String

The disk ID.

Table 11 VolumeMetadata

Parameter

Type

Description

__system__cmkid

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.

NOTE:

Use an HTTPS request to obtain the key ID. For details, see Querying the Key List.

__system__encrypted

String

The encryption field in metadata. The value can be 0 (no encryption) or 1 (encryption). If this parameter does not appear, the disk is not encrypted.

full_clone

String

If the disk is created from a snapshot and linked cloning needs to be used, set this parameter to 0.

hw:passthrough

String

If this parameter is set to true, the disk device type is SCSI, which allows ECS OSs to directly access the underlying storage media. SCSI reservation commands are supported.

If this parameter is set to false, the disk device type is VBD, which is also the default type. VBD supports only simple SCSI read/write commands.

If this parameter is not available, the disk device type is VBD.

Status code: 400

Table 12 Response body parameters

Parameter

Type

Description

error

Error object

The error message returned if an error occurs.

Table 13 Error

Parameter

Type

Description

code

String

The error code returned if an error occurs.

For details about error codes and their meanings, see Error Codes.

message

String

The error message returned if an error occurs.

Example Requests

Creating an EVS disk (Use an image to create a non-shared EVS disk in the DSS storage pool. Set the disk type to common I/O, device type to SCSI, and disk size to 40 GiB.)

POST https://{endpoint}/v2/{project_id}/volumes

{
  "volume" : {
    "name" : "openapi_vol01",
    "imageRef" : "027cf713-45a6-45f0-ac1b-0ccc57ac12e2",
    "availability_zone" : "xxx",
    "description" : "create for api test",
    "volume_type" : "SATA",
    "metadata" : {
      "hw:passthrough" : "true"
    },
    "consistencygroup_id" : null,
    "source_volid" : null,
    "snapshot_id" : null,
    "multiattach" : false,
    "source_replica" : null,
    "size" : 40
  },
  "OS-SCH-HNT:scheduler_hints" : {
    "dedicated_storage_id" : "eddc1a3e-4145-45be-98d7-bf6f65af9767"
  }
}

Example Responses

Status code: 202

Accepted

{
  "volume" : {
    "attachments" : [ ],
    "availability_zone" : "xxx",
    "bootable" : "false",
    "created_at" : "2016-05-25T02:38:40.392463",
    "description" : "create for api test",
    "encrypted" : false,
    "id" : "8dd7c486-8e9f-49fe-bceb-26aa7e312b66",
    "links" : [ {
      "href" : "https://volume.localdomain.com:8776/v2/5dd0b0056f3d47b6ab4121667d35621a/volumes/8dd7c486-8e9f-49fe-bceb-26aa7e312b66",
      "rel" : "self"
    }, {
      "href" : "https://volume.localdomain.com:8776/5dd0b0056f3d47b6ab4121667d35621a/volumes/8dd7c486-8e9f-49fe-bceb-26aa7e312b66",
      "rel" : "bookmark"
    } ],
    "metadata" : {
      "__system__encrypted" : 0
    },
    "name" : "openapi_vol01",
    "replication_status" : "disabled",
    "multiattach" : false,
    "size" : 40,
    "status" : "creating",
    "user_id" : "39f6696ae23740708d0f358a253c2637",
    "volume_type" : "SATA"
  }
}

Status code: 400

Bad Request

{
  "error" : {
    "message" : "XXXX",
    "code" : "XXX"
  }
}

Status Codes

Status Code

Description

202

Accepted

400

Bad Request

Error Codes

See Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback