In admin/instances page can't show floating ip that belong to other tenants

Bug #1319669 reported by kennychu
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
Akihiro Motoki

Bug Description

Reproduce step:

1.Switch to demo project and launch instance.
2.Then associate floating ip for this instance.
3.Switch to admin project and also launch instance and associate floating ip.
4.Visit admin/instances page will find the instance that belong to demo project doesn't show floating ip.

related https://bugs.launchpad.net/horizon/+bug/1265032
Because get instance networking information from Neutron.
The neutron client can't get all floating IPs.
Nova client can get all floating IPs by set "all_tenants=True".
Horizon's Neutron API servers_update_addresses method doesn't set the setting.
Does FloatingIpManager list search_opts support the setting?

Tags: neutron
Revision history for this message
kennychu (kenny-chu123) wrote :

class FloatingIpManager(network_base.FloatingIpManager):
    def __init__(self, request):
        self.request = request
        self.client = neutronclient(request)

    def list_pools(self):
        search_opts = {'router:external': True}
        return [FloatingIpPool(pool) for pool
                in self.client.list_networks(**search_opts).get('networks')]

    def list(self, **search_opts):
        tenant_id = self.request.user.tenant_id
        # In Neutron, list_floatingips returns Floating IPs from all tenants
        # when the API is called with admin role, so we need to filter them
        # with tenant_id.
        fips = self.client.list_floatingips(tenant_id=tenant_id, **search_opts)
        fips = fips.get('floatingips')
        # Get port list to add instance_id to floating IP list
        # instance_id is stored in device_id attribute

The comment said " In Neutron, list_floatingips returns Floating IPs from all tenants when the API is called with admin role".
But we try the result is return the ones that belong to admin tenant.
We remove the tenant_id argument will get all floating IP.
Was the method comment correct?

Akihiro Motoki (amotoki)
tags: added: neutron
Changed in horizon:
importance: Undecided → Low
Changed in horizon:
assignee: nobody → Akihiro Motoki (amotoki)
status: New → In Progress
Revision history for this message
Akihiro Motoki (amotoki) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/116564
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=198c7dcd5f5f19b90c0ec165f97068441fe65b56
Submitter: Jenkins
Branch: master

commit 198c7dcd5f5f19b90c0ec165f97068441fe65b56
Author: Akihiro Motoki <email address hidden>
Date: Mon Aug 25 16:06:43 2014 +0900

    Show floating IPs from other projects of admin instance table

    Change-Id: I36e1c7a3808994d1481463ed6b595506e579ae28
    Closes-Bug: #1319669

Changed in horizon:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in horizon:
milestone: none → juno-rc1
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: juno-rc1 → 2014.2
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.