ooi

Floating IP association issue with OpenStack Neutron

Bug #1709249 reported by Jerome Pansanel on 2017-08-08
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ooi
High
Luís Filipe Sequeira Alves

Bug Description

Since the upgrade of our Cloud infrastructure to Newton, the users cannot associate floating IP using the OCCI interface.

The following command:
occi --endpoint https://controller:8787/occi1.1 -n x509 -x
/tmp/x509up_u1001 -a describe -X -r network

returns:
F, [2017-08-08T08:28:33.929019 #937] FATAL -- : [rOCCI-cli] An error occurred! Message: Net::HTTP::Get failed! HTTP Response status: [404] Not Found : "Subnet d4a0d188-7c02-11e7-b14e-9f82b16afbbe could not be found."

The d4a0d188-7c02-11e7-b14e-9f82b16afbbe subnet corresponds to the external subnet.

We have a per-tenant router infrastructure, with one external flat network. As it should only be used to give floating ip in the allocation range, it has not been set as shared.

We have switch to the neutron backend in the OOI configuration, as the nova network backend is not supported anymore in Newton.

Alvaro Lopez (aloga) on 2017-08-08
Changed in ooi:
importance: Undecided → High
status: New → Confirmed
Alvaro Lopez (aloga) wrote :

The problem is in this method from ooi/api/helpers_neutron.py

    def get_network_details(self, req, id):
        """Get info from a network.

        It returns json code from the server

        :param req: the incoming network
        :param id: net identification
        """
        if id == os_helpers.PUBLIC_NETWORK:
            id = self._get_public_network(req)
        path = "/networks/%s" % id
        req = self._make_get_request(req, path)
        response = req.get_response()
        net = self.get_from_response(response, "network", {})
        # subnet
        if "subnets" in net:
            path = "/subnets/%s" % net["subnets"][0]
            req_subnet = self._make_get_request(req, path)
            response_subnet = req_subnet.get_response()
            net["subnet_info"] = self.get_from_response(
                response_subnet, "subnet", {})

        ooi_networks = self._build_networks([net])

        return ooi_networks[0]

The conditional there is requesting information from each of the
subnets, even if the user does not have access to them (as it may be in
the case of a external and not shared network).

Should we just remove the subnet listing in this case (maybe catch the exception and skip that subnet)?

Looking into it.

Changed in ooi:
assignee: nobody → Luís Filipe Sequeira Alves (luisfsalves)
status: Confirmed → In Progress
Changed in ooi:
status: In Progress → Fix Committed
Changed in ooi:
status: Fix Committed → In Progress

Patch committed: https://review.openstack.org/#/c/492189/3/ooi/api/helpers_neutron.py

And tested:

# Command: occi --endpoint https://nimbus.ncg.ingrid.pt:8787/occi1.1 -a describe -X -r network --auth token -q $TID

# Partial output:
(...)
################################################################################################################################################################################################################
[[ http://schemas.ogf.org/occi/infrastructure#network ]]
>> location: /occi1.1/network/496cac2f-d45b-49d5-9ab4-66792fe10673
occi.core.id = 496cac2f-d45b-49d5-9ab4-66792fe10673
occi.core.title = indigo_private_net
occi.network.state = active
occi.network.address = 192.168.1.0/24
occi.network.gateway = 192.168.1.254
org.openstack.network.ip_version = 4

Links:

Mixins:

    [[ http://schemas.ogf.org/occi/infrastructure/network#ipnetwork ]]
    title: IP Networking Mixin
    term: ipnetwork
    location: /mixin/ipnetwork/

    [[ http://schemas.openstack.org/infrastructure/network#osnetwork ]]
    title: openstack network
    term: osnetwork
    location: /mixin/osnetwork/

Actions:

    [[ http://schemas.ogf.org/occi/infrastructure/network/action#up ]]

    [[ http://schemas.ogf.org/occi/infrastructure/network/action#down ]]
################################################################################################################################################################################################################
[[ http://schemas.ogf.org/occi/infrastructure#network ]]
>> location: /occi1.1/network/PUBLIC
occi.core.id = PUBLIC
occi.core.title = public_net
occi.network.state = active

Links:

Mixins:

    [[ http://schemas.ogf.org/occi/infrastructure/network#ipnetwork ]]
    title: IP Networking Mixin
    term: ipnetwork
    location: /mixin/ipnetwork/

    [[ http://schemas.openstack.org/infrastructure/network#osnetwork ]]
    title: openstack network
    term: osnetwork
    location: /mixin/osnetwork/

Actions:

    [[ http://schemas.ogf.org/occi/infrastructure/network/action#up ]]

    [[ http://schemas.ogf.org/occi/infrastructure/network/action#down ]]
(...)

# /var/log/nova/nova-api.log

2017-08-10 10:10:15.991 15712 INFO nova.ooi.wsgi.server [req-60f312fd-f96f-4b5d-8042-80d73bf95b2f 6de2ec5e6c16439c98a3d8251dc3c305 2712d6a5a05f403899e3cd019644e9dc - - -] 194.210.119.252,10.197.6.149 "GET /occi1.1/network/496cac2f-d45b-49d5-9ab4-66792fe10673 HTTP/1.1" status: 200 len: 1397 time: 0.2676220
2017-08-10 10:10:16.525 15712 ERROR ooi.api.helpers_neutron [req-3758b4c7-0bd5-4909-9aae-665968fee947 6de2ec5e6c16439c98a3d8251dc3c305 2712d6a5a05f403899e3cd019644e9dc - - -] No details from the requested subnet can be fetched
2017-08-10 10:10:16.529 15712 INFO nova.ooi.wsgi.server [req-3758b4c7-0bd5-4909-9aae-665968fee947 6de2ec5e6c16439c98a3d8251dc3c305 2712d6a5a05f403899e3cd019644e9dc - - -] 194.210.119.252,10.197.6.149 "GET /occi1.1/network/PUBLIC HTTP/1.1" status: 200 len: 1134 time: 0.3647342

Changed in ooi:
status: In Progress → Fix Committed
Alvaro Lopez (aloga) on 2017-08-24
Changed in ooi:
milestone: none → 1.2.0
Alvaro Lopez (aloga) on 2017-08-24
Changed in ooi:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers