Ask Your Question
0

see number of free floating ips?

asked 2015-01-29 06:34:58 -0600

Peter Jenkins gravatar image

Is there a way to see how many floating IP addresses are unallocated?

I'd like to check how many floating IP's are:

  1. Available for any tenant to take from the the shared pool
  2. Assigned to tenants but not used (stranded)
  3. In use (allocated)

I have found nothing helpful on the cli or using python neutron api's. The following will give me an approximate view of 3, but it's not clear if the unallocated IPs are stranded with one tenant or in the shared pool. How do I check when we are going to run out?

neutron floatingip-list

Do I need to use the neutron api to work this out?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-01-29 14:43:37 -0600

dbaxps gravatar image

updated 2015-01-29 14:49:13 -0600

  1. Available for any tenant to take from the the shared pool

    MariaDB [neutron]> select * from ipavailabilityranges ;
    +--------------------------------------+---------------+---------------+
    | allocation_pool_id | first_ip | last_ip |
    +--------------------------------------+---------------+---------------+
    | 41a13f3d-517b-4259-af19-6f4d88edd295 | 30.0.0.16 | 30.0.0.254 |
    | d141f7a6-e548-4921-87a7-6f2c4944574e | 192.168.1.158 | 192.168.1.254 |
    | f78db537-81ae-4dd6-8ecb-467d40467147 | 70.0.0.24 | 70.0.0.254 |
    +--------------------------------------+---------------+---------------+


  1. In use (allocated) for particular tenant

    [root@juno01svc ~(keystone_demo)]# nova list
    +--------------------------------------+--------------+-----------+------------+-------------+----------------------------------+
    | ID | Name | Status | Task State | Power State | Networks |
    +--------------------------------------+--------------+-----------+------------+-------------+----------------------------------+
    | b5585e10-86af-4930-9836-504ec461befe | UbuntuRSX001 | SUSPENDED | - | Shutdown | private=70.0.0.13, 192.168.1.152 |
    | 9d0300e5-2f1b-4571-bdaa-9535e8b49d7a | UbuntuRSX005 | SUSPENDED | - | Shutdown | private=70.0.0.21, 192.168.1.155 |
    | a16238b2-2a7f-4984-ae08-60be0a61641f | VF21RSX001 | ACTIVE | - | Running | private=70.0.0.12, 192.168.1.151 |
    | 0d92b906-9d9c-4c50-9c06-e177b959700c | VF21RSX009 | SUSPENDED | - | Shutdown | private=70.0.0.23, 192.168.1.157 |
    +--------------------------------------+--------------+-----------+------------+-------------+----------------------------------+
    [root@juno01svc ~(keystone_demo)]# nova list | awk '{print $13}' | grep -v ^$ | grep -v ^"|"
    192.168.1.152
    192.168.1.155
    192.168.1.151
    192.168.1.157

edit flag offensive delete link more

Comments

Do I really need to query the database directly?!

Peter Jenkins gravatar imagePeter Jenkins ( 2015-02-04 05:40:58 -0600 )edit
0

answered 2018-05-28 21:00:07 -0600

Hi there!. Just to leave a straight answer for this (I know someday I will need to find it again). Neutron can display all the amount of floating IP in the pools on each network. You only need to list and see all the IP on the networks with:

 - neutron net-ip-availability-list

If you need to check an specific network on a massive list, you can list and run grep using pipe with the network name.

If you want more info like the project id or the subnet availability (if you have more of 1 pool) you can use the following command:

 - neutron net-ip-availability-show <Network ID>
edit flag offensive delete link more

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

1 follower

Stats

Asked: 2015-01-29 06:34:58 -0600

Seen: 1,059 times

Last updated: Jan 29 '15