Ask Your Question
0

Auto assign floating ip

asked 2014-02-25 11:37:39 -0500

xuelinlin88 gravatar image

Hi,

I've modified my nova.conf, so that it can auto assign floating ip with my openstack instance.

Due to requirement, I wrote a small script which contains mainly two parts: first, boot instance and auto assign floating ip second, embedded floating ip as a variable and run several commands.

In this situation, I'm curious how can I obtain floating ip of my instance via commands?

is there any openstack command like nova show floating ip?

Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-02-26 05:59:53 -0500

KeithJ gravatar image

updated 2014-02-26 06:04:40 -0500

Note: I am on the Grizzly Release.

I think you can do it as follows:

export OS_TENANT_NAME=<tenant_name>
export OS_USERNAME=<username>
export OS_PASSword=<password>

nova floating-ip-list

   +---------------+--------------------------------------+-------------+---------+
    | Ip            | Instance Id                          | Fixed Ip    | Pool    |
    +---------------+--------------------------------------+-------------+---------+
    | 10.126.97.107 | e4f76f99-a6f3-49f5-a084-3143bb6d51ac | 50.50.1.1   | ext_net |
    | 10.126.98.234 | d31c5e83-b370-47ab-8f28-aca628767b82 | 50.50.1.250 | ext_net |
    | 10.126.98.235 | 6355bc1e-ab62-4d8c-b148-1af60a9db6b3 | 50.50.1.249 | ext_net |
    +---------------+--------------------------------------+-------------+---------+

The floating IP's are in the left column. The first instance-id is actually the router_id rather than a vm.

edit flag offensive delete link more

Comments

Appreciated your reply. Actually, I don't need truly know the assigned floating ip of my newly-created instance. Because I define a variable (e.g. flotip), and embed it in the second part of my script. So I need to get floating ip and pass it to that variable. As for this ip, I don't really care Thanks

xuelinlin88 gravatar imagexuelinlin88 ( 2014-02-26 09:23:47 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2014-02-25 11:37:39 -0500

Seen: 229 times

Last updated: Feb 26 '14