• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. Disk Management
  6. Creating a Disk (Discarded)

Creating a Disk (Discarded)

Function

This API is used to create a disk.

Constraints

  • You are advised to use the EVS API "Creating an EVS Disk (Native OpenStack API V2)".

URI

POST /v2.1/{project_id}/os-volumes

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

Request

Request parameters

Table 2 describes the request parameters.

Table 2 Request parameters

Parameter

Type

Mandatory

Description

availability_zone

String

No

Specifies the AZ to which the volume to be created belongs.

If the specified AZ does not exist, creating the volume failed, and the volume is in error state.

The AZ to which the volume to be created belongs must be specified in the public cloud system.

display_description

String

No

Specifies the volume description.

snapshot_id

String

No

Specifies the snapshot ID.

If this parameter is specified, the volume is to be created from a snapshot.

size

Int

Yes

If the volume is to be created from a snapshot, this parameter is optional.

Specifies the volume size.

Unit: GB

display_name

String

No

Specifies the volume name.

volume_type

String

No

Specifies the volume type.

Currently, the value can be SSD, SAS, SATA, co-p1, or uh-l1.
  • SSD: specifies the ultra-I/O disk type.
  • SAS: specifies the high I/O disk type.
  • SATA: specifies the common I/O disk type.
  • co-p1: specifies the high I/O (performance-optimized I) disk type.
  • uh-l1: specifies the ultra-high I/O (latency-optimized) disk type.
    NOTE:

    EVS disks of the co-p1 and uh-l1 types are used exclusively for high performance computing (HPC) and SAP HANA ECSs.

metadata

Dict

No

Specifies the volume metadata.

Response

Response parameters

Table 3 describes the response parameters.

Table 3 Response parameters

Parameter

Type

Description

id

String

Specifies the disk ID in UUID format.

displayName

String

Specifies the volume name.

status

String

Specifies the volume status.

attachments

List

Specifies the volume attachment information.

availabilityZone

String

Specifies the AZ to which the volume belongs.

createdAt

String

Specifies the time when the volume was created.

displayDescription

String

Specifies the volume description.

volumeType

String

Specifies the volume type.

snapshotId

String

Specifies the snapshot ID.

metadata

Dict

Specifies the volume metadata.

size

Int

Specifies the size of the volume.

Examples

  • Example request
    POST /v2/b84c367e4d1047fc9b54f28b400ddbc2/os-volumes
    POST /v2.1/b84c367e4d1047fc9b54f28b400ddbc2/os-volumes
    {
        "volume": {
            "availability_zone": "az1-dc1",
            "display_description": "test1",
            "snapshot_id": null,
            "size": 1,
            "display_name": "test",
            "volume_type": "SATA",
            "metadata": {
                "testkey": "testvalue"
            }
        }
    }
  • Example response
    {
      "volume": {
        "displayDescription": "test1",
        "volumeType": "SATA",
        "createdAt": "2018-05-18T01:17:03.871808",
        "metadata": {
          "testkey": "testvalue",
          "resourceSpecCode": "SATA"
        },
        "attachments": [
          {}
        ],
        "snapshotId": null,
        "size": 1,
        "displayName": "test",
        "id": "b4fb891c-c665-4478-92b0-8a7fa65a57cd",
        "availabilityZone": "az1.dc1",
        "status": "creating"
      }
    }

Returned Values

See General Request Returned Values.