Ask Your Question

How attach a volume via openstack sdk?

asked 2017-01-05 04:59:43 -0500

Vitec gravatar image

I use common openstack python sdk: special cinder module python sdk) I can't find any functions to attach a volume to an existed instance. Are there any ideas how I can do this using the sdk?

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2017-01-10 15:45:09 -0500

sumant-murke gravatar image

updated 2017-01-10 15:46:31 -0500

You can refer ( for using python cinderclient

edit flag offensive delete link more

answered 2018-08-21 19:48:09 -0500

jjrruu gravatar image

I found conn.compute,create_volume_attachment as the pythone opensdk command BUT, I can not find the attributes to put into the command I have the server[id] and volume[id] and device, but it needs a set of parameters names or something: vol_arg { "volume_id" : " 0000-1111-2222-3333-4444" , "device" : "/dev/sdc"} conn.compute.create_volume_attachment("9999-8888-7777-6666-5555-4444", **vol_args)

where the 9999---- is the instance id.

ANY SUGGESTIONS on the correct parameters to use would be greatly appreciated.

edit flag offensive delete link more

answered 2018-03-20 04:06:05 -0500

kinde gravatar image

Refer the guidelines in ( for python-openstacksdk client.

To do so follow this steps:

from openstack import connection

conn = connection.Connection(cloud='yourCloud')

volumes = conn.volume.volumes(details=True, **query)

To obtain the volumes associated to all the tenants, define query as {'all_tenants' : 1}. The returning value will be object of type openstack.block_storage.v2.volume.VolumeDetail

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-01-05 04:59:43 -0500

Seen: 584 times

Last updated: Jan 10 '17