Can't display port list on a shared network in "Manage Floating IP Associations" page

Bug #1394051 reported by Samuel Chen
68
This bug affects 14 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Kevin Benton
Juno
Fix Released
Medium
Kevin Benton

Bug Description

I used below command to configure floating IP. Juno on CentOS 7.

neutron net-create public --shared --router:external True --provider:network_type vlan --provider:physical_network physnet2 --provider:segmentation_id 125

neutron subnet-create public --name public-subnet \
  --allocation-pool start=125.2.249.170,end=125.2.249.248 \
  --disable-dhcp --gateway 125.2.249.1 --dns-nameserver 125.1.166.20 125.2.249.0/24

neutron net-create --shared OAM120 \
  --provider:network_type vlan --provider:physical_network physnet2 --provider:segmentation_id 120

neutron subnet-create --name oam120-subnet \
  --allocation-pool start=192.168.120.1,end=192.168.120.200 \
  --gateway 192.168.120.254 --dns-nameserver 10.1.1.1 --dns-nameserver 125.1.166.20 OAM120 192.168.120.0/24

neutron router-create my-router

neutron router-interface-add my-router oam120-subnet

neutron router-gateway-set my-router public

Just checked the dashborad code, It seems that there are some errors in below code.

/usr/share/openstack-dashboard/openstack_dashboard/api/neutron.py
    def _get_reachable_subnets(self, ports):
        # Retrieve subnet list reachable from external network
        ext_net_ids = [ext_net.id for ext_net in self.list_pools()]
        gw_routers = [r.id for r in router_list(self.request)
                      if (r.external_gateway_info and
                          r.external_gateway_info.get('network_id')
                          in ext_net_ids)]
        reachable_subnets = set([p.fixed_ips[0]['subnet_id'] for p in ports
                                 if ((p.device_owner ==
                                      'network:router_interface')
                                     and (p.device_id in gw_routers))])
        return reachable_subnets

Why only list "device_owner = 'network:router_interface'", I guess it should list all "device_owner = 'compute:xxx'"

Here is my work around:
diff output:
/usr/share/openstack-dashboard
[root@jn-controller openstack-dashboard]# diff ./openstack_dashboard/api/neutron.py.orig ./openstack_dashboard/api/neutron.py
413,415c415
< if ((p.device_owner ==
< 'network:router_interface')
< and (p.device_id in gw_routers))])
---
> if (p.device_owner.startswith('compute:'))])

Tags: neutron
Revision history for this message
Vincent Untz (vuntz) wrote :

I think this is likely a regression introduced by the fix from https://bugs.launchpad.net/horizon/+bug/1388305

Revision history for this message
Vincent Untz (vuntz) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

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

Changed in horizon:
assignee: nobody → Vincent Untz (vuntz)
status: New → In Progress
Julie Pichon (jpichon)
tags: added: juno-backport-potential
tags: added: neutron
Revision history for this message
Akihiro Motoki (amotoki) wrote : Re: Can't display port list in "Manage Floating IP Associations" page

It seems the problem only occurs when the internal network is a shared network.
If so, the bug reported is correct. The logic implemented in bug 1388305 does not consider the case.
I will update the bug title.

summary: - Can't display port list in "Manage Floating IP Associations" page
+ Can't display port list on a shared network in "Manage Floating IP
+ Associations" page
Revision history for this message
ofer blaut (oblaut) wrote :

Hi, This bug happnes also when not using shared network

to reproduce :

1. create external network
2. create a router
3. set router gw
4. create network for NEW tenant

on NEW tenant :
5. create subnet

On admin tenant:
6. add subnet to router
on NEW tenant :
7. create VM and try to add floating ip to it .

issue doesn't reproduce on kilo

Changed in horizon:
assignee: Vincent Untz (vuntz) → Thomas Bechtold (toabctl)
Revision history for this message
Toni Freger (tfreger) wrote :

The same issue reproduces when trying to associate VIP (LBaaS) to FloatingIP via non-admin user.
Admin user works properly.
Association via CLI (non-admin user) also works correctly.

Toni Freger (tfreger)
Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
Toni Freger (tfreger) wrote :

I accidentally changed the bug status from In Progress to Fix Released , unfortunately I don't have a permissions to change it back.

So the correct state should be "In Progress" instead of "Fix Released".

Cindy Lu (clu-m)
Changed in horizon:
status: Fix Released → In Progress
Changed in horizon:
assignee: Thomas Bechtold (toabctl) → Akihiro Motoki (amotoki)
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Kevin proposed a good fix: https://review.openstack.org/#/c/163728/

Changed in horizon:
assignee: Akihiro Motoki (amotoki) → Kevin Benton (kevinbenton)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

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

commit be9f5738d563a8b2444cbdf283c0884bd2f37ab4
Author: Kevin Benton <email address hidden>
Date: Wed Mar 11 23:25:52 2015 -0700

    Show ports from shared nets in floating IP assoc

    Ports from shared networks should be included in the list
    of 'Ports to be associated' even though a router interface
    connecting to the external network might not be visible to
    the tenant.

    Change-Id: Iba141b51371b955c3cfdcc52c0bf279466131713
    Closes-Bug: #1394051

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/165994

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/juno)

Reviewed: https://review.openstack.org/165994
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=75c88f3da0568f833ce57e6fecf4d3765e6f7150
Submitter: Jenkins
Branch: stable/juno

commit 75c88f3da0568f833ce57e6fecf4d3765e6f7150
Author: Kevin Benton <email address hidden>
Date: Wed Mar 11 23:25:52 2015 -0700

    Show ports from shared nets in floating IP assoc

    Ports from shared networks should be included in the list
    of 'Ports to be associated' even though a router interface
    connecting to the external network might not be visible to
    the tenant.

    Conflicts:
     openstack_dashboard/api/neutron.py
     openstack_dashboard/test/api_tests/network_tests.py

    Change-Id: Iba141b51371b955c3cfdcc52c0bf279466131713
    Closes-Bug: #1394051
    (cherry picked from commit be9f5738d563a8b2444cbdf283c0884bd2f37ab4)

tags: added: in-stable-juno
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-3 → 2015.1.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by David Lyle (<email address hidden>) on branch: master
Review: https://review.openstack.org/142605
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Alan Pevec (apevec)
tags: removed: in-stable-juno juno-backport-potential
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.