Getting the port ID from the heat server addresses attribute is not discoverable

Bug #1406391 reported by Steve Baker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Sergey Kraynev
openstack-manuals
Fix Released
Undecided
Sergey Kraynev

Bug Description

The following is possible but basically nobody knows about it as it is not well documented:

  server:
    type: OS::Nova::Server
    properties:
      image: {get_param: image}
      flavor: {get_param: flavor}
      key_name: {get_param: key_name}
      security_groups:
      - {get_resource: the_sg}
      networks:
      - network: {get_param: private_network}

  server_floating_ip_assoc:
    type: OS::Neutron::FloatingIPAssociation
    properties:
      floatingip_id: {get_resource: floating_ip}
      port_id: {get_attr: [server, addresses, {get_param: private_network}, 0, port]}

  floating_ip:
    type: OS::Neutron::FloatingIP
    properties:
      floating_network: {get_param: public_network}

Specifically, it is possible to create a floating IP association without creating an explicit port resource (avoiding all the problems that causes with stack updates)

This situation could be improved by:
- demonstrating the above example the hot-guide as the recommended way to associate a server port with a floating IP
- improving the server addresses attribute reference to make it obvious that you can do the following:
  {get_attr: [server, addresses, {get_param: private_network}, 0, port]}

Changed in heat:
status: New → Triaged
Changed in openstack-manuals:
assignee: nobody → Sergey Kraynev (skraynev)
Changed in heat:
assignee: nobody → Sergey Kraynev (skraynev)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-manuals (master)

Fix proposed to branch: master
Review: https://review.openstack.org/147849

Changed in openstack-manuals:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/148245

Changed in heat:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-manuals (master)

Reviewed: https://review.openstack.org/147849
Committed: https://git.openstack.org/cgit/openstack/openstack-manuals/commit/?id=29bf88fb1532021f12d03209b92bb97c8d2956a5
Submitter: Jenkins
Branch: master

commit 29bf88fb1532021f12d03209b92bb97c8d2956a5
Author: Sergey Kraynev <email address hidden>
Date: Fri Jan 16 08:37:43 2015 -0500

    Add example how to associate FIP via neutron

    This patch adds example, that demonstrate preferable way to associate
    Floating IP via neutron resources in HOT template.

    Change-Id: Id4c5fcf2bac86b32b9527ec668b01caef607f2d5
    Closes-Bug: #1406391

Changed in openstack-manuals:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/148245
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=fc23757d92021b548842313716df806ac363c71f
Submitter: Jenkins
Branch: master

commit fc23757d92021b548842313716df806ac363c71f
Author: Sergey Kraynev <email address hidden>
Date: Mon Jan 19 10:42:27 2015 -0500

    Improve address description by example

    Example how to get port id was added for 'address' attribute
    description.

    Change-Id: I84faab4c85d005956216f608a40f67f62b1eeade
    Closes-Bug: #1406391

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-2 → 2015.1.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-manuals 15.0.0

This issue was fixed in the openstack/openstack-manuals 15.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.