Updated on 2022-02-22 GMT+08:00

Attaching an EVS Disk to a BMS

Function

This API is used to attach EVS disks to a BMS as data disks after the BMS is created if existing disks are insufficient or cannot meet requirements.

Constraints

  • EVS disks cannot be attached to a BMS in a batch.
  • A maximum of 40 EVS disks can be attached to a BMS.
  • A bootable disk cannot be attached to a BMS.
  • A disk cannot be attached to a BMS 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 /v1/{project_id}/baremetalservers/{server_id}/attachvolume

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

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

server_id

Yes

Specifies the BMS ID.

You can obtain the BMS ID from the BMS console or using the Querying BMSs (Native OpenStack API) API.

Request Message

  • Request parameters

    Parameter

    Mandatory

    Type

    Description

    volumeAttachment

    Yes

    Object

    Specifies the disks to be attached. For details, see Table 2.

    Table 2 volumeAttachment field data structure description

    Parameter

    Mandatory

    Type

    Description

    volumeId

    Yes

    String

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

    You can obtain the disk ID from the EVS console or by calling the .

    device

    No

    String

    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. If this parameter is left blank or set to "", the system automatically generates a mount point.

  • Example request
    1
    POST https://{BMS Endpoint}/v1/bbf1946d374b44a0a2a95533562ba954/baremetalservers/cf2a8b97-b5c6-47ef-9714-eb27adf26e5b/attachvolume
    
    1
    2
    3
    4
    5
    6
    {
        "volumeAttachment": {
            "volumeId": "b53f23bd-ee8f-49ec-9420-d1acfeaf91d6",
            "device": ""
        }
    }
    

Response Message

See Task ID Response.

Returned Values

Normal values

Returned Value

Description

202

The request has been accepted, but the processing has been delayed.

For details about other returned values, see Status Codes.

Error Codes

See Error Codes.