Getting volumes IDs attached to instance

asked 2015-10-15 03:08:23 -0500

Dambre gravatar image

updated 2015-10-16 03:27:14 -0500

Hi, I am testing the openstack and what I need is to detach all attached volumes to instance. How do I find all attached volumes to instance? Code example:

I am using this command to attach volumes:

cinder.volumes.attach(vol,, "/dev/vdb")

These commands to get info about attached volumes:

>>> vm = nova.servers.get(
>>> vm._info['os-extended-volumes:volumes_attached']

I know that if would use nova.volumes.create_server_volume I would have volume IDs in _info['os-extended-volumes:volumes_attached'] but the problem is that I don't want to mix up components and use cinder for attaching, detaching and nova for getting info about volumes attached. Any Ideas how I could get info about attached volumes?

edit retag flag offensive close merge delete


I don't know about the SDK, but the Nova API does have a volume attach request

Bernd Bausch gravatar imageBernd Bausch ( 2015-10-16 06:09:09 -0500 )edit