OpenStack Havana - Set Floating IP2013/12/23 |
It's possible to access to Virtual machine Instance to set Floating IP address.
|
|
[1] | Change Nova's setting first to assign Floating IP address automatically. |
[root@dlp ~(keystone)]#
vi /etc/nova/nova.conf # line 999 : uncomment and change auto_assign_floating_ip= True
systemctl restart openstack-nova-network |
[2] | Set Floating IP address. For exmaple, assign 10.0.0.248/29 for Floating IP addresses in internal network 10.0.0.0/24. |
[root@dlp ~(keystone)]# nova-manage floating create --ip_range=10.0.0.248/29 [root@dlp ~(keystone)]# nova-manage floating list None 10.0.0.249 None nova eth0 None 10.0.0.250 None nova eth0 None 10.0.0.251 None nova eth0 None 10.0.0.252 None nova eth0 None 10.0.0.253 None nova eth0 None 10.0.0.254 None nova eth0 |
[3] | Create a new instance and boot it, then Floating IP is assgined automatically like follows. In the example below, The "10.0.0.249" is just the Floating IP. |
# create and boot Instance [root@dlp ~(keystone)]# nova boot --flavor 2 --image Fedora20 --security_group default Fedora20_Pub [root@dlp ~(keystone)]# nova list +------------+--------------+---------+------------+-------------+--------------------------------+ | ID | Name | Status | Task State | Power State | Networks | +------------+--------------+---------+------------+-------------+--------------------------------+ | 79a976b7-3 | Fedora20 | SHUTOFF | None | Shutdown | network01=10.1.0.2 | | f7fded7b-8 | Fedora20_Pub | ACTIVE | None | Running | network01=10.1.0.3, 10.0.0.249 | +------------+--------------+---------+------------+-------------+--------------------------------+ |
[4] | The Instances created before setting Floating IP, Floating IP does not assigned automatically, so it necessarry to set it manually like follows. |
[root@dlp ~(keystone)]# nova list +------------+--------------+---------+------------+-------------+--------------------------------+ | ID | Name | Status | Task State | Power State | Networks | +------------+--------------+---------+------------+-------------+--------------------------------+ | 79a976b7-3 | Fedora20 | SHUTOFF | None | Shutdown | network01=10.1.0.2 | | f7fded7b-8 | Fedora20_Pub | SHUTOFF | None | Shutdown | network01=10.1.0.3, 10.0.0.249 | +------------+--------------+---------+------------+-------------+--------------------------------+ # assign "10.0.0.250" to "Fedora20" [root@dlp ~(keystone)]# nova add-floating-ip Fedora20 10.0.0.250 [root@dlp ~(keystone)]# nova list +------------+--------------+---------+------------+-------------+--------------------------------+ | ID | Name | Status | Task State | Power State | Networks | +------------+--------------+---------+------------+-------------+--------------------------------+ | 79a976b7-3 | Fedora20 | SHUTOFF | None | Shutdown | network01=10.1.0.2, 10.0.0.250 | | f7fded7b-8 | Fedora20_Pub | SHUTOFF | None | Shutdown | network01=10.1.0.3, 10.0.0.249 | +------------+--------------+---------+------------+-------------+--------------------------------+ |
Sponsored Link |
|