[integration-tests] BadRequest: Unable to associate floating IP in nova live-migration tests

Bug #1584732 reported by Georgy Dyuldin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Fix Released
High
Alexander Koryagin

Bug Description

Test result:

https://mirantis.testrail.com/index.php?/tests/view/6048710

Exception:

BadRequest: Unable to associate floating IP 10.109.4.165 to fixed IP 192.168.1.5 for instance 930dbc71-b39e-45c3-bcdd-c58bff323473. Error: External network 4fc0e324-a1e8-4cb9-8ba5-b0b3140c9f91 is not reachable from subnet 252ec8fe-b5ed-4f25-bb02-16f90497befa. Therefore, cannot associate Port dcec7c4e-686a-4376-90de-0989527c7d7e with a Floating IP. Neutron server returns request_ids: ['req-59623878-b4c9-498f-9f7f-62258d40f49f'] (HTTP 400) (Request-ID: req-59e8159e-7762-4f90-a84e-20b9208b3cad)

Trace:

self = <mos_tests.nova.nova_test.NovaIntegrationTests testMethod=test_network_connectivity_to_v_m_during_live_migration[(542823)]>

    @pytest.mark.testrail_id('542823')
    def test_network_connectivity_to_v_m_during_live_migration(self):
        """This test checks network connectivity to VM during Live Migration

                Steps:
                 1. Create a floating ip
                 2. Create an instance from an image with 'm1.micro' flavor
                 3. Add the floating ip to the instance
                 4. Ping the instance by the floating ip
                 5. Execute live migration
                 6. Check current hypervisor and status of instance
                 7. Check that packets loss was minimal
            """
        networks = self.neutron.list_networks()['networks']
        net = [net['id'] for net in networks if not net['router:external']][0]
        image_id = [image.id for image in self.nova.images.list() if
                    image.name == 'TestVM'][0]
        flavor = [flavor for flavor in self.nova.flavors.list() if
                  flavor.name == 'm1.micro'][0]
        floating_ip = self.nova.floating_ips.create()
        self.floating_ips.append(floating_ip)
        self.assertIn(floating_ip.ip, [fip_info.ip for fip_info in
                                       self.nova.floating_ips.list()])
        inst = common_functions.create_instance(self.nova,
                                                "inst_2238776_{}"
                                                .format(flavor.name),
                                                flavor.id, net,
                                                [self.sec_group.name],
                                                image_id=image_id,
                                                inst_list=self.instances)
        self.instances.append(inst.id)
> inst.add_floating_ip(floating_ip.ip)

mos_tests/nova/nova_test.py:427:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/nova/local/lib/python2.7/site-packages/novaclient/v2/servers.py:154: in add_floating_ip
    return self.manager.add_floating_ip(self, address, fixed_address)
.tox/nova/local/lib/python2.7/site-packages/novaclient/v2/servers.py:806: in add_floating_ip
    return self._action('addFloatingIp', server, {'address': address})
.tox/nova/local/lib/python2.7/site-packages/novaclient/v2/servers.py:1691: in _action
    info=info, **kwargs)
.tox/nova/local/lib/python2.7/site-packages/novaclient/v2/servers.py:1702: in _action_return_resp_and_body
    return self.api.client.post(url, body=body)
.tox/nova/local/lib/python2.7/site-packages/keystoneauth1/adapter.py:179: in post
    return self.request(url, 'POST', **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <novaclient.client.SessionClient object at 0x7f005224edd0>
url = '/servers/930dbc71-b39e-45c3-bcdd-c58bff323473/action', method = 'POST'
kwargs = {'body': {'addFloatingIp': {'address': '10.109.4.165'}}, 'headers': {'Accept': 'application/json', 'Content-Type': 'ap...cNhYFMgLnOOg1ebGotcuPHBsauSQG-jm38Q0fFj24TBOmFznetof-GEuM7ZQ7IG87D1bHXwT2wTmMDzCke9E2x9FAMgyA8bKqJngokW1Mu9Ktc4Zax_A'}}
raise_exc = True, resp = <Response [400]>
body = {'badRequest': {'code': 400, 'message': "Unable to associate floating IP 10.109.4.165 to fixed IP 192.168.1.5 for inst...de-0989527c7d7e with a Floating IP.
Neutron server returns request_ids: ['req-59623878-b4c9-498f-9f7f-62258d40f49f']"}}

    def request(self, url, method, **kwargs):
        kwargs.setdefault('headers', kwargs.get('headers', {}))
        api_versions.update_headers(kwargs["headers"], self.api_version)
        # NOTE(jamielennox): The standard call raises errors from
        # keystoneauth1, where we need to raise the novaclient errors.
        raise_exc = kwargs.pop('raise_exc', True)
        with utils.record_time(self.times, self.timings, method, url):
            resp, body = super(SessionClient, self).request(url,
                                                            method,
                                                            raise_exc=False,
                                                            **kwargs)
        # TODO(andreykurilin): uncomment this line, when we will be able to
        # check only nova-related calls
        # api_versions.check_headers(resp, self.api_version)
        if raise_exc and resp.status_code >= 400:
> raise exceptions.from_response(resp, body, url, method)
E BadRequest: Unable to associate floating IP 10.109.4.165 to fixed IP 192.168.1.5 for instance 930dbc71-b39e-45c3-bcdd-c58bff323473. Error: External network 4fc0e324-a1e8-4cb9-8ba5-b0b3140c9f91 is not reachable from subnet 252ec8fe-b5ed-4f25-bb02-16f90497befa. Therefore, cannot associate Port dcec7c4e-686a-4376-90de-0989527c7d7e with a Floating IP.
E Neutron server returns request_ids: ['req-59623878-b4c9-498f-9f7f-62258d40f49f'] (HTTP 400) (Request-ID: req-59e8159e-7762-4f90-a84e-20b9208b3cad)

.tox/nova/local/lib/python2.7/site-packages/novaclient/client.py:100: BadRequest

Tags: area-qa
Changed in mos:
assignee: nobody → MOS QA Team (mos-qa)
Changed in mos:
milestone: 10.0 → 9.0
Changed in mos:
assignee: MOS QA Team (mos-qa) → Alexander Koryagin (akoryagin)
Revision history for this message
Alexander Koryagin (akoryagin) wrote :
Changed in mos:
status: Confirmed → Fix Committed
Revision history for this message
Timur Nurlygayanov (tnurlygayanov) wrote :

Thank you for the fix! Marked as Fix Released.

Changed in mos:
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.