How to get cinder volume mountpoint in output?

Asked by Damir Besic

I'm trying to automate volume attachments to VM, and i can attach a volume, no problem, but how do i get the mountpoint which i can use as a parameter?

When i try:

outputs:
  "Volume":
    value: { get_attr: [ VM1_volume, attachments ] }

I get:
[{u'server_id': u'49e504aa-3442-43fa-b024-321855a402a7', u'attachment_id': u'c7a24688-6f84-491f-b6a7-aaaf1aee3b0c', u'attached_at': u'2017-01-24T13:19:32.000000', u'host_name': None, u'volume_id': u'595d33cc-2457-47a3-8fe9-5b04385008e1', u'device': u'/dev/vdb', u'id': u'595d33cc-2457-47a3-8fe9-5b04385008e1'}]

I need u'device', but how do i parse it out?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu heat Edit question
Assignee:
No assignee Edit question
Solved by:
Damir Besic
Solved:
Last query:
Last reply:
Revision history for this message
Damir Besic (dbesic) said :
#1

Found it:

 value: { get_attr: [ VM1_volume, show, attachments,0,device ] }