From Fedora Project Wiki

Revision as of 15:38, 18 September 2012 by Ndipanov (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Set up Floating IPs with OpenStack


Follow QA:Testcase_launch_an_instance_on_OpenStack

Make sure that nova is configured with the correct public network interface.

$> ifconfig em1
   em1: flags=...
$> sudo openstack-config --set /etc/nova/nova.conf DEFAULT public_interface em1 
$> sudo systemctl restart openstack-nova-network.service

Ensure that ICMP (ping) and SSH are allowed to your instances.

$> nova secgroup-add-rule default icmp -1 -1
$> nova secgroup-add-rule default tcp 22 22 

How to test

If you've followed all of the test cases, the private network used for OpenStack instances is The purpose of this functionality is to be able to assign a pool of floating public IP addresses to instances, as well.

The details of this test case are a bit specific to the environment you are using to test. For this documentation, we're going to assume that the the OpenStack server's public interface is on the subnet. We are going to take an unused address range ( from this subnet and define it as a floating IP address range to be used by OpenStack.

$> sudo nova-manage floating create
$> sudo nova-manage floating list
None	None	nova	em1
None	None	nova	em1

Allocate an address to use for an instance:

$> nova floating-ip-create
|       Ip     | Instance Id | Fixed Ip | Pool |
| |     None    |   None   | nova |

Associate the allocated address with a running instance:

$> INSTANCE=<instance name>
$> nova add-floating-ip $INSTANCE

Expected Results

Verify that the public IP address got assigned to your public network interface on the OpenStack server.

$> ip addr
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:13:20:f5:f9:8d brd ff:ff:ff:ff:ff:ff
    inet brd scope global em1
    inet scope global em1
    inet6 fe80::213:20ff:fef5:f98d/64 scope link 
       valid_lft forever preferred_lft forever

Also see the IP address reported as associated with the instance:

$> nova show $INSTANCE | grep network
|  testnet network  |,  |

Verify that you can now ssh into the instance using the newly assigned address:

$> cd ~/novacreds
$> ssh -i nova_key.priv -o UserKnownHostsFile=/dev/null root@
VM limitations
Note if running openstack within a VM, then the floating address will not be accessible from outside (probably due to the iptables NAT being bypassed by the bridge (ebtables) rules within the VM)

Check for new errors in the logs:

$> grep -i error /var/log/nova/*.log

If you would like, you can now disassociate and release the address assigned for testing.

$> nova remove-floating-ip $INSTANCE
$> nova floating-ip-delete