Ask Your Question

attach volume, how to post `os-initialize_connection`

asked 2017-03-15 09:42:01 -0600

Honghe gravatar image

In the Official Document ( , there is only one step to attach a volume to server:

POST /v2/{tenant_id}/volumes/{volume_id}/action
    "os-attach": {
        "instance_uuid": "95D9EF50-507D-11E5-B970-0800200C9A66",
        "mountpoint": "/dev/vdc"

But if I only call this API to attach a volume to server, the attachment will be failed, cause the server does not really attach the volume.

So I test the attachment via Horizon/CLI, find that there are two more steps need to be done before attachment:

Action body: {"os-reserve": null} from (pid=1986) get_method /opt/stack/cinder/cinder/api/openstack/

Action body: {"os-initialize_connection": {"connector": {"platform": "x86_64", "host": "bogon", "do_local_attach": false, "ip": "", "os_type": "linux2", "multipath": false, "initiator": ""}}} from (pid=1986) get_method /opt/stack/cinder/cinder/api/openstack/

Action body: {"os-attach": {"instance_uuid": "a68806a6-b67d-4c48-9bc1-7af018d8f81b", "mountpoint": "/dev/vdb", "mode": "rw"}} from (pid=1986) get_method /opt/stack/cinder/cinder/api/openstack/

I can't find document about the POST os-initialize_connection, so how to construct this POST?

Any help appreciated!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-03-22 06:31:55 -0600

Honghe gravatar image

updated 2017-03-22 06:49:36 -0600

OK, I answer this question myself.
The Cinder APIs asked above is for Nova. And the endpoint of attaching volume which Horizon/CLI can call is from Nova:

POST /os-volume_attachments

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-03-15 09:42:01 -0600

Seen: 193 times

Last updated: Mar 22 '17