nova absolute-limits floating ip count is incorrect in a neutron based deployment

Bug #1376316 reported by Ryan Harper
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Low
Unassigned
neutron
Invalid
Undecided
Unassigned
nova (Ubuntu)
In Progress
Low
Satyanarayana Patibandla

Bug Description

1.
$ lsb_release -rd
Description: Ubuntu 14.04 LTS
Release: 14.04

2.
$ apt-cache policy python-novaclient
python-novaclient:
  Installed: 1:2.17.0-0ubuntu1
  Candidate: 1:2.17.0-0ubuntu1
  Version table:
 *** 1:2.17.0-0ubuntu1 0
        500 http://nova.clouds.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

3. nova absolute-limits should report the correct value of allocated floating ips
4. nova absolute-limits shows 0 floating ips when I have 5 allocated

$ nova absolute-limits | grep Floating
| totalFloatingIpsUsed | 0 |
| maxTotalFloatingIps | 10 |

$ nova floating-ip-list
+---------------+-----------+------------+---------+
| Ip | Server Id | Fixed Ip | Pool |
+---------------+-----------+------------+---------+
| 10.98.191.146 | | - | ext_net |
| 10.98.191.100 | | 10.5.0.242 | ext_net |
| 10.98.191.138 | | 10.5.0.2 | ext_net |
| 10.98.191.147 | | - | ext_net |
| 10.98.191.102 | | - | ext_net |
+---------------+-----------+------------+---------+

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: python-novaclient 1:2.17.0-0ubuntu1
ProcVersionSignature: User Name 3.13.0-24.47-generic 3.13.9
Uname: Linux 3.13.0-24-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: amd64
Date: Wed Oct 1 15:19:08 2014
Ec2AMI: ami-00000001
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.small
Ec2Kernel: aki-00000002
Ec2Ramdisk: ari-00000002
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: python-novaclient
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Ryan Harper (raharper) wrote :
Revision history for this message
James Page (james-page) wrote :

It looks like nova is only accounting for floating ip's its directly managing (nova-network) rather than those being managed by neutron as in this deployment.

Marking 'Confirmed' - I see the same thing on an icehouse deployment; I suspect this is in nova, not the client.

Changed in python-novaclient (Ubuntu):
status: New → Confirmed
James Page (james-page)
Changed in python-novaclient (Ubuntu):
importance: Undecided → Medium
Revision history for this message
James Page (james-page) wrote :

Re-verified this on Kilo:

(tempest)ubuntu@james-page-bastion:~/tools/openstack-charm-testing⟫ nova floating-ip-create
+--------------------------------------+------------+-----------+----------+---------+
| Id | IP | Server Id | Fixed IP | Pool |
+--------------------------------------+------------+-----------+----------+---------+
| b4c00015-d1e7-49cd-9b34-1dc20a955df5 | 10.5.150.1 | - | - | ext_net |
+--------------------------------------+------------+-----------+----------+---------+
(tempest)ubuntu@james-page-bastion:~/tools/openstack-charm-testing⟫ nova absolute-limits
+--------------------+------+-------+
| Name | Used | Max |
+--------------------+------+-------+
| Cores | 0 | 20 |
| FloatingIps | 0 | 10 |
| ImageMeta | - | 128 |
| Instances | 0 | 10 |
| Keypairs | - | 100 |
| Personality | - | 5 |
| Personality Size | - | 10240 |
| RAM | 0 | 51200 |
| SecurityGroupRules | - | 20 |
| SecurityGroups | 0 | 10 |
| Server Meta | - | 128 |
| ServerGroupMembers | - | 10 |
| ServerGroups | 0 | 10 |
+--------------------+------+-------+

affects: python-novaclient (Ubuntu) → nova (Ubuntu)
summary: - nova absolute-limits floating ip count is incorrect
+ nova absolute-limits floating ip count is incorrect in a neutron based
+ deployment
Changed in nova (Ubuntu):
status: Confirmed → Triaged
importance: Medium → Low
Changed in nova (Ubuntu):
assignee: nobody → Satyanarayana Patibandla (satya-patibandla)
Revision history for this message
Marian Horban (mhorban) wrote :

The root cause of this problem is that we have different quota drivers for nova and for neutron. These quota drivers could use different DB tables.
When we run command
    nova absolute-limits
nova uses it own quota driver. But when we allocate floating ip neutron's quota driver is used to decide if quota is exceeded.
Right now in nova we using nova quota driver directly nova/api/openstack/compute/contrib/used_limits.py:
    quotas = QUOTAS.get_project_quotas(context, project_id, usages=True)
This is not correct behavior for parameters like totalFloatingIpsUsed.
Interface class NetworkAPI(nova/network/base_api.py) should be used to get info about network configuration. Method NetworkAPI::get_floating_ips_by_project() clould be used to get totalFloatingIpsUsed parameter.
To return of maxTotalFloatingIps parameter I suppose additional method should be added in NetworkAPI class. Something like
    get_floating_ip_quota()
This method should be implemented for nova-network and for neutron.

Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Marian Horban (mhorban)
Changed in nova:
status: Confirmed → Triaged
Changed in nova (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

This bug is > 172 days without activity. We are unsetting assignee and milestone and setting status to Incomplete in order to allow its expiry in 60 days.

If the bug is still valid, then update the bug status.

Changed in neutron:
status: New → Incomplete
Revision history for this message
Ivo (kotev-) wrote :

We are developing internal project that works with quotas on project/tenant level. We are using REST API's for that purpose.
Right now we are trying to calculate usage of floating IP's. So I found this thread. I can confirm that this issue is still valid in Liberty release.

Does anyone found any workaround to get totalFloatingIpsUsed via REST API?
For maxTotalFloatingIps we used http://developer.openstack.org/api-ref-networking-v2-ext.html#quotas-ext
but cannot find anything similar for totalFloatingIpsUsed

Any hints what can be used or are there any plans this to be fixed soon?

@Marian Horban (mhorban)

information type: Public → Public Security
information type: Public Security → Private Security
information type: Private Security → Public Security
Jeremy Stanley (fungi)
information type: Public Security → Public
Changed in nova:
assignee: nobody → Anusha Unnam (anusha-unnam)
Changed in nova:
assignee: Anusha Unnam (anusha-unnam) → nobody
Revision history for this message
Sivasathurappan Radhakrishnan (siva-radhakrishnan) wrote :

we should not be tracking usage of security groups in Nova when using Neutron. Below patch is filtering out network related limits from API response.

https://review.openstack.org/#/c/344947/7

you can check this by trying out curl request with OpenStack-API-Version: compute 2.36
curl -g -i -X GET http://192.168.0.31:8774/v2.1/limits -H "OpenStack-API-Version: compute 2.36" -H "Accept: application/json" -H "X-OpenStack-Nova-API-Version: 2.32" -H "X-Auth-Token: $OS_TOKEN"

Changed in nova:
status: Triaged → Invalid
Revision history for this message
Sorin Sbarnea (ssbarnea) wrote :

Can someone explain me how am I supposed to read totalFloatingIpsUsed value using the API? At this moment I get these:
```
openstack limits show --absolute | grep Floating
| totalFloatingIpsUsed | 0 |
| maxTotalFloatingIps | 300 |
```
While I do know for sure that I do have already allocated floating IPs, which are visible in horizon. Still, using the openstack cli (not old nova cli), I only get a valid value only for maxTotal but total is wrongly reported as zero.

Changed in neutron:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.