Ask Your Question
1

How attach a volume via openstack sdk?

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

Vitec gravatar image

I use common openstack python sdk:http://developer.openstack.org/sdks/python/openstacksdk/users/index.html#api-documentation.(Not 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

2 answers

Sort by ยป oldest newest most voted
0

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

kinde gravatar image

Refer the guidelines in https://docs.openstack.org/python-openstacksdk/latest/user/proxies/block_storage.html (https://docs.openstack.org/python-ope...) 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
0

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

sumant-murke gravatar image

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

You can refer http://docs.openstack.org/developer/python-cinderclient/#python-api (http://docs.openstack.org/developer/p...) for using python cinderclient

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

Stats

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

Seen: 169 times

Last updated: Jan 10 '17