Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to associate floating IP to specific interface with Heat

i am trying to create a stack using openstack HEAT, one of the VMs (NOVA::Server) needs to have 2 network interfaces

so in my hot template i create 2 ports and associate them to the NOVA::Server and give a floating IP to one of them gw_float_port

     type: "OS::Nova::Server"
       key_name: { get_param: key_name }
       image: { get_param: image_id }
       flavor: { get_param: instance_type }          
       user_data:"#!/bin/sh \necho \"Starting the OVS setup!\" ... "
       user_data_format: RAW
          - port: {get_resource: gw_float_port}
          - port: {get_resource: gw_ovs_port }

   type: "OS::Neutron::Port"
      network_id: {get_resource: "private_net"}

   type: "OS::Neutron::Port"
      network_id: {get_resource: "private_net"}

   type: "OS::Neutron::FloatingIP"
      floating_network_id: {get_param: "public_network"}
      port_id: {get_resource: "gw_float_port"}

And when i do an ifconfig inside the VM i get the following:

 ens3      Link encap:Ethernet  HWaddr fa:16:3e:76:98:82
           inet addr:  Bcast:  Mask:
 ens4      Link encap:Ethernet  HWaddr fa:16:3e:11:9f:ed
           BROADCAST MULTICAST  MTU:1500  Metric:1
 lo        Link encap:Local Loopback
           inet addr:  Mask:

what i want to know is how to map the NICs from the ifconfig with the NICs in the template and control which one gets the floating IP?

within the template (automatically while creating the stack not with manual manipulation after it is created)

thanks for you help in advance.