nova floating_ips table doesn't seem to get populated

Bug #1376462 reported by Aaron Rosen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
congress
Fix Released
Medium
Zhenzan Zhou

Bug Description

nicira@Ubuntu1404Server:~/devstack$ nova list --all-tenants
+--------------------------------------+------+--------+------------+-------------+-------------------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+--------+------------+-------------+-------------------------------+
| c3849872-4f6b-42f3-855f-7d6a64ea09b3 | vm1 | ACTIVE | - | Running | private=10.0.0.2, 172.24.4.75 |
+--------------------------------------+------+--------+------------+-------------+-------------------------------+

nicira@Ubuntu1404Server:~/devstack$ openstack congress datasource row list nova floating_IPs

nicira@Ubuntu1404Server:~/devstack$ openstack congress datasource row list nova servers
+--------------------------------------+------+----------------------------------------------------------+--------+----------------------------------+----------------------------------+--------------------------------------+------+
| Col0 | Col1 | Col2 | Col3 | Col4 | Col5 | Col6 | Col7 |
+--------------------------------------+------+----------------------------------------------------------+--------+----------------------------------+----------------------------------+--------------------------------------+------+
| c3849872-4f6b-42f3-855f-7d6a64ea09b3 | vm1 | 935cd96d4d2b696667abea50992d3dadd6684ee3d54506f3a1973b1a | ACTIVE | 67e985672c10492cb6970b895bf8753a | 344a3b4a80024784912f10f6bb4b14f9 | 3d5664db-2846-4e2c-bb5b-30fbb5333343 | 1 |
+--------------------------------------+------+----------------------------------------------------------+--------+----------------------------------+----------------------------------+--------------------------------------+------+

Tim Hinrichs (thinrichs)
Changed in congress:
importance: Undecided → Medium
Revision history for this message
Zhenzan Zhou (zhenzan-zhou) wrote :

Current nova_driver uses Nova API '/v2/<id>//os-floating-ips' without enabling all_tenants. And this API seems to not populate floating ips which are already attached to instances. E.g.

stack@stack-cnt11:~/workspace/python-congressclient$ nova floating-ip-list
+----+-----------+----------+------+
| Ip | Server Id | Fixed Ip | Pool |
+----+-----------+----------+------+
+----+-----------+----------+------+
stack@stack-cnt11:~/workspace/python-congressclient$ nova floating-ip-list --all-tenants
+----+-----------+----------+------+
| Ip | Server Id | Fixed Ip | Pool |
+----+-----------+----------+------+
+----+-----------+----------+------+
stack@stack-cnt11:~/workspace/python-congressclient$ neutron floatingip-list
+--------------------------------------+------------------+---------------------+--------------------------------------+
| id | fixed_ip_address | floating_ip_address | port_id |
+--------------------------------------+------------------+---------------------+--------------------------------------+
| 7a0d6c41-3b8a-40e8-af80-ec08037742bc | 172.16.0.6 | 192.0.2.46 | dc3f3c75-c741-43cb-9dfa-1859c61b10ab |
+--------------------------------------+------------------+---------------------+--------------------------------------+
stack@stack-cnt11:~/workspace/python-congressclient$ nova floating-ip-create
+------------+-----------+----------+---------+
| Ip | Server Id | Fixed Ip | Pool |
+------------+-----------+----------+---------+
| 192.0.2.48 | - | - | ext-net |
+------------+-----------+----------+---------+
stack@stack-cnt11:~/workspace/python-congressclient$ nova floating-ip-list
+------------+-----------+----------+---------+
| Ip | Server Id | Fixed Ip | Pool |
+------------+-----------+----------+---------+
| 192.0.2.48 | - | - | ext-net |
+------------+-----------+----------+---------+
stack@stack-cnt11:~/workspace/python-congressclient$ nova floating-ip-list --all-tenants
+------------+-----------+----------+---------+
| Ip | Server Id | Fixed Ip | Pool |
+------------+-----------+----------+---------+
| 192.0.2.48 | - | - | ext-net |

After I created a new floating ip, I can see it's populated:

stack@stack-cnt11:~/workspace/python-congressclient$ openstack congress datasource row list nova floating_IPs
+----------+--------------------------------------+------------+---------+---------+
| fixed_ip | id | ip | host_id | pool |
+----------+--------------------------------------+------------+---------+---------+
| None | 2a694a76-f684-4a1d-be0b-d36cdc10488f | 192.0.2.48 | None | ext-net |
+----------+--------------------------------------+------------+---------+---------+

Revision history for this message
Zhenzan Zhou (zhenzan-zhou) wrote :

Correct one thing for the previous comment: Nova os-floating-ips API doesn't support listing all tenants and each tenant can only see floating ips created by itself.
API url: http://docs.openstack.org/api/openstack-compute/2/content/GET_os-floating-ips-v2_ListFloatingIPs__v2__tenant_id__os-floating-ips_ext-os-floating-ips.html

E.g.
GET /v2/f5aafb6e39494077bfeb6ecb14f3bb53/os-floating-ips

only returns floating ips for tenant f5aafb6e39494077bfeb6ecb14f3bb53 which is admin for this case.

stack@stack-cnt11:~/workspace/python-congressclient$ . ../tripleo-incubator/overcloudrc-user
stack@stack-cnt11:~/workspace/python-congressclient$ nova floating-ip-create
+------------+-----------+----------+---------+
| Ip | Server Id | Fixed Ip | Pool |
+------------+-----------+----------+---------+
| 192.0.2.49 | - | - | ext-net |
+------------+-----------+----------+---------+
stack@stack-cnt11:~/workspace/python-congressclient$ nova floating-ip-list
+------------+-----------+------------+---------+
| Ip | Server Id | Fixed Ip | Pool |
+------------+-----------+------------+---------+
| 192.0.2.46 | - | 172.16.0.6 | ext-net |
| 192.0.2.49 | - | - | ext-net |
+------------+-----------+------------+---------+
stack@stack-cnt11:~/workspace/python-congressclient$ . ../tripleo-incubator/overcloudrc
stack@stack-cnt11:~/workspace/python-congressclient$ nova floating-ip-list
+------------+-----------+----------+---------+
| Ip | Server Id | Fixed Ip | Pool |
+------------+-----------+----------+---------+
| 192.0.2.48 | - | - | ext-net |
+------------+-----------+----------+---------+

Changed in congress:
assignee: nobody → Zhenzan Zhou (zhenzan-zhou)
status: New → In Progress
Revision history for this message
Zhenzan Zhou (zhenzan-zhou) wrote :

Submitted Nova bug https://bugs.launchpad.net/nova/+bug/1402514 to address the all_tenants support.
For nova_driver in congress, we can add all_tenants=True:

self._translate_floating_ips(self.nova_client.floating_ips.list(all_tenants=True))

With this change, the request becomes to:

GET./v2/f5aafb6e39494077bfeb6ecb14f3bb53/os-floating-ips?all_tenants=1.HTTP/1.1

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to congress (master)

Fix proposed to branch: master
Review: https://review.openstack.org/146799

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to congress (master)

Reviewed: https://review.openstack.org/146799
Committed: https://git.openstack.org/cgit/stackforge/congress/commit/?id=edc09cdbeec1807970a2644cf873f86758580582
Submitter: Jenkins
Branch: master

commit edc09cdbeec1807970a2644cf873f86758580582
Author: Zhenzan Zhou <email address hidden>
Date: Tue Jan 13 16:39:24 2015 +0800

    Set all_tenants=True to populate all floating ips

    This patch still relies on Nova bug #1402514 to expose all
    floating ips.

    Change-Id: I671665436deacff449c5c578e57ed62e454ca37e
    Closes-Bug: #1376462

Changed in congress:
status: In Progress → Fix Committed
Tim Hinrichs (thinrichs)
Changed in congress:
milestone: none → kilo-3
status: Fix Committed → Fix Released
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.