Ask Your Question
0

get availability_zone/compute host details in heat

asked 2017-01-16 02:47:02 -0500

roshin-adukkath gravatar image

updated 2017-01-18 09:45:58 -0500

zaneb gravatar image

How do I get the availability_zone /compute host of an instance from another instance in heat template . Tried using get_attribute. But not working.

insatnce_1:    
    type: OS::Nova::Server
    properties:      
      name: inst_1     
insatnce_2:    
    type: OS::Nova::Server
    properties:      
    name:inst_2
      availability_zone: { get_attr: [insatnce_1, availability_zone ] }
edit retag flag offensive close merge delete

Comments

That is the correct way (the indenting of the second server name is a little messed us, but I don't know if that's just an artifact of pasting it here). Can you describe in what way it isn't working?

zaneb gravatar imagezaneb ( 2017-01-18 09:49:25 -0500 )edit

Thanks for your comment. The above code was not working. The issue is fixed by assigning the compute node like below. availability_zone: list_join: [':', [ 'nova', {get_attr: [insatnce_1, show, 'OS-EXT-SRV-ATTR:host']}]]

roshin-adukkath gravatar imageroshin-adukkath ( 2017-01-18 10:05:15 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-01-18 10:06:13 -0500

roshin-adukkath gravatar image

updated 2017-01-20 08:49:09 -0500

zaneb gravatar image

The issue is fixed by assigning the compute node like below.

availability_zone:
    list_join: [':', [ 'nova', {get_attr: [insatnce_1, show, 'OS-EXT-SRV-ATTR:host']}]]
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-16 02:47:02 -0500

Seen: 162 times

Last updated: Jan 20 '17