how to find the free floatingip per network via postgres?

asked 2017-04-21 03:14:25 -0500

rajivmucheli gravatar image

Hi,

I did research many online blogs / posts but had no luck on how to find the free floatingip per network ?

For example, the below query helps in listing the list of floatingip's based on status: SELECT floating_network_id, COUNT(*) AS gauge, status FROM floatingips WHERE floating_ip_address LIKE '10%' GROUP BY floatingips.floating_network_id, floatingips.status;

it will be great if you could share a command to find free floatingips

  1. is it possible to have a floatingip associated ? whereas fixedip is blank ?
edit retag flag offensive close merge delete

Comments

If you are admin, openstack floating ip list should give you the list of all floating IP addresses in use, including the owning projects and the networks to which they belong. You could then derive the number of IPs that are still available.

Bernd Bausch gravatar imageBernd Bausch ( 2017-04-21 21:39:34 -0500 )edit

The number of free floating IPs is not in the database, afaik. The Neutron database does have a table named floatingips, which contains the above list (Ocata).

Bernd Bausch gravatar imageBernd Bausch ( 2017-04-21 21:41:44 -0500 )edit

Is it possible to have a floating IP assigned where fixed IP is blank? Normally, when you create a port, it automatically gets a fixed IP; while I believe there is a way to change that, I wonder why you would want to? So, my answer is "in 99%, probably 100% of the cases, no".

Bernd Bausch gravatar imageBernd Bausch ( 2017-04-21 21:43:39 -0500 )edit

Thanks, but the o/p of openstack floating ip list to the data in floatingips table is hugely different, any idea why ?

so do we need to consider floating_ip_address or fixed_ip_address to determine free floating ips ?

rajivmucheli gravatar imagerajivmucheli ( 2017-04-24 05:14:28 -0500 )edit

I don't know off the cuff why the DB and the command output are different. Perhaps the DB contains floating IPs that have been deleted, or this is not the correct table.

Bernd Bausch gravatar imageBernd Bausch ( 2017-04-24 06:59:50 -0500 )edit