Get ip address of instance

asked 2015-08-01 20:15:53 -0600

Sihan gravatar image

The example below shows how the IP address of a compute resource can be defined as an output parameter:

    type: OS::Nova::Server
    # ...

    description: IP address of the deployed compute instance
    value: { get_attr: [my_instance, first_address] }
    description: Private IP address of the deployed compute instance
   value: { get_attr: [my_instance, networks, private, 0] }

i am wondering where does 'first address' come from? i check the document, i did not find this attribute in OS::Nova::Server

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2015-09-14 16:49:19 -0600

vikomall gravatar image

"first_address" is an attribute of Heat (Orchestration) Nova plugin/resource. It returns the first network address of the server. This attribute ('first_address') was deprecated back in Apr 11, 2014 and correct usage is to explicitly specify the network name. So, following is an example of correct usage.

{ get_attr: [nova_instance, networks, some-valid-network-name, 0] }

edit flag offensive delete link more

answered 2015-08-04 10:30:48 -0600

mpetason gravatar image

updated 2015-08-04 10:31:43 -0600

I believe this is configured in case an instance has multiple network interfaces. The first address is normally going to be the default IP and is in the Network associated with the Instance's gateway. For example:

ip1 :
ip2 :



You could test this out by adding multiple interfaces to an instance and see if the value matches.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-08-01 20:15:53 -0600

Seen: 2,057 times

Last updated: Aug 04 '15