get availability_zone/compute host details in heat
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 ] }
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?
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']}]]