• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Cinder V2 Interfaces
  5. Volumes
  6. Attach volume to server (Abandoned and not Recommended)

Attach volume to server (Abandoned and not Recommended)

Function Description

This interface is used to attach volumes to a VM.

Interface Format

Method

URI

Description

POST

/v2/{tenant_id}/volumes/{volume_id}/action

action='os-attach'

Attaches volumes to a VM.

Restrictions

This interface can only be used to change the volume status from available to in-use and cannot be used to attach volumes to a VM.

To attach volumes to a VM, you are advised to call the Attach Volume API of Nova.

Expanded Interface

N/A

Request Parameter

Parameter

Type

Mandatory

Remarks

instance_uuid

String

Yes

Specifies the VM UUID.

host_name

String

No

Specifies the ID of the host accommodating the VM.

mountpoint

String

Yes

Specifies the mount point.

mode

String

No

Specifies the mounting mode.

Response Parameters

N/A

Request Example

POST 
https://volume.localdomain.com:8776/v2/fa9acd30b02d4704bbd62cd6fb24fe01/volumes/ff9920a4-8d7a-49a9-9991-e28e355588cf/actionhttps://volume.localdomain.com:8776/v2/fa9acd30b02d4704bbd62cd6fb24fe01/volumes/ff9920a4-8d7a-49a9-9991-e28e355588cf/action
{
" os-attach ": {
           " instance_uuid ": " afff4ef7-eae8-49e8-b968-1e3dff327392 ", 
           " mountpoint": " /dev/sda",
            " mode": " rw"
           }
}

Response Example

N/A

Error Code

See section Processing Return Code.