• Bare Metal Server

bms
  1. Help Center
  2. Bare Metal Server
  3. API Reference
  4. API
  5. BMS Disk Management (Native OpenStack APIs)
  6. Attaching an EVS Disk to a BMS (Native OpenStack API)

Attaching an EVS Disk to a BMS (Native OpenStack API)

Function

This interface is used to attach an EVS disk to a BMS.

Constraints

  • A bootable disk cannot be attached to a BMS.
  • A disk cannot be attached to a BMS when the BMS is in the SUSPENDED or PAUSED state, which is specified using the OS-EXT-STS:vm_state parameter.
  • Only a shared disk or a disk in the available state can be attached to a BMS.
  • Only EVS disks whose device type is SCSI can be attached to a BMS.

URI

POST /v2.1/{project_id}/servers/{server_id}/os-volume_attachments

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

server_id

Yes

Specifies the BMS ID.

Request Message

  • Request parameters

    Parameter

    Type

    Mandatory

    Description

    volumeAttachment

    Dict

    Yes

    Specifies information about the disk to be attached to the BMS. For details, see [1] volumeAttachment field data structure description.

    [1] volumeAttachment field data structure description

    Parameter

    Type

    Mandatory

    Description

    volumeId

    UUID

    Yes

    Specifies the ID of the disk to be attached to a BMS.

    device

    String

    No

    Specifies the mount point, such as /dev/sda and /dev/sdb.

    The new disk mount point cannot be the same as an existing one.

    The mount point must be specified based on the sequence of existing device names. Otherwise, the system automatically generates a mount point.

  • Example request
    {
        "volumeAttachment": {
            "volumeId": "b53f23bd-ee8f-49ec-9420-d1acfeaf91d6",
            "device": "/dev/sdb"
        }
    }

Response Message

  • Response parameters

    Parameter

    Type

    Description

    volumeAttachment

    Dict

    Specifies information about disks attached to BMSs. For details, see [2] volumeAttachment field data structure description.

    [2] volumeAttachment field data structure description

    Parameter

    Type

    Description

    device

    String

    Specifies the device name.

    serverId

    UUID

    Specifies the BMS to which the disk is to be attached.

    id

    String

    Specifies the disk UUID.

    volumeId

    String

    Specifies the attaching ID, which is the same as the UUID.

  • Example response
    {
        "volumeAttachment": {
            "id": "b53f23bd-ee8f-49ec-9420-d1acfeaf91d6",
            "volumeId": "b53f23bd-ee8f-49ec-9420-d1acfeaf91d6",
            "serverId": "820abbd0-2d8e-4bc5-ae46-69cacfd4fbaa",
            "device": "/dev/vdb"
        }
    }

Returned Values

See section Common Returned Values.