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.
POST /v1/{project_id}/baremetalservers/{server_id}/attachvolume
Table 1 lists the parameters.
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 by calling the Querying BMSs (Native OpenStack API). |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
volumeAttachment |
Yes |
Object |
Specifies the disks to be attached. For details, see Table 2. |
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 "Querying EVS Disks" API in Elastic Volume Service API Reference. |
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. |
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": "" } } |
Parameter |
Type |
Description |
---|---|---|
job_id |
String |
Specifies the task ID returned after a task command is issued. The task ID can be used to query the execution status of the task. For details about how to query the task execution status based on job_id, see Querying Task Statuses. |
Parameter |
Type |
Description |
---|---|---|
error |
Dictionary data structure |
Specifies the error returned when a task submission encounters an exception. For details, see Table 5. |
Parameter |
Type |
Description |
---|---|---|
message |
String |
Specifies the error message. |
code |
String |
Specifies the error code. |
1 2 3 | { "job_id": "70a599e0-31e7-49b7-b260-868f441e862b" } |
Returned Value |
Description |
---|---|
202 |
The request has been accepted, but the processing has been delayed. |
For details about other returned values, see Status Codes.
See Error Codes.