HostNotCompatibleWithFixedIps exception happens when setting router's gateway.

Bug #1637366 reported by changzhi
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Brian Haley

Bug Description

======= Problem Description ======

    I installed a devstack in my local environment. All the code from master branch. After the installation, I have to show you some problems which I met.

    Neutron server log at http://paste.openstack.org/show/587158/.

======= How to reproduce =======

    First of all, I create an external network by this command " neutron net-create public --router:external=True --provider:network_type=flat --provider:physical_network=public ".

    Secondly, I create a subnet with " subnet_type " by this command " neutron subnet-create [net-id] 20.20.20.0/24 --service-types list=true network:router_gateway ".

    Third, create a subnet without service_types:
neutron subnet-create [net-id] 10.10.10.0/24

    At last, I create a router and setting this router's gateway by this command " neutron router-gateway-set [router-id] [net-id]".

    Exception happens in Neutron Server, it says " HostNotCompatibleWithFixedIps: Host devstack is not connected to a segment where the existing fixed_ips on port 0f38ba01-8dd0-43de-92e3-b294bd4ebed8 will function given the routed network topology. ".

   I upload all the network and subnets info at here [1]. Detail exception at here [2].

[1]. http://paste.openstack.org/show/587157/
[2]. http://paste.openstack.org/show/587158/

changzhi (changzhi)
tags: added: neutron-server
Revision history for this message
John Davidge (john-davidge) wrote :

I confirm I'm seeing this as you describe. Note that I updated the description to include creation of a second subnet, as if there's only one subnet a different error is thrown.

description: updated
Changed in neutron:
status: New → Confirmed
tags: added: l3-ipam-dhcp
removed: neutron-server
sireeshak (sireeshak)
Changed in neutron:
assignee: nobody → sireeshak (sireeshak)
Changed in neutron:
assignee: sireeshak (sireeshak) → Brian Haley (brian-haley)
Revision history for this message
Brian Haley (brian-haley) wrote :

There is another failure that can happen in the update_port() code here - if the host binding is being updated but not the fixed_ip, and there are only subnets with service_type set:

ipam_backend_mixin.py", line 700, in _ipam_get_subnets\n raise ipam_exceptions.IpAddressGenerationFailureNoMatchingSubnet()\n', u'IpAddressGenerationFailureNoMatchingSubnet: No valid service subnet for the given device owner.\n'

Looks like the call to _ipam_get_subnets() in this code path fails to pass the existing port's device_owner value along, so the list of subnets returned is []

Think I have a fix that will address both problems.

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

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

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/543612
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=0d4889df41485cece4bef5915753ae7efd808138
Submitter: Zuul
Branch: master

commit 0d4889df41485cece4bef5915753ae7efd808138
Author: Brian Haley <email address hidden>
Date: Mon Feb 12 15:38:24 2018 -0500

    Always pass device_owner to _ipam_get_subnets()

    There was one code path where the existing device_owner
    value, which is used for subnet selection when service_type's
    are in use was not passed to _imap_get_subnets(). This could
    trigger one of two exceptions - HostNotCompatibleWithFixedIps()
    or IpAddressGenerationFailureNoMatchingSubnet() depending
    on the environment. Pass it along if known.

    Also update the IpAddressGenerationFailureNoMatchingSubnet
    exception to print the network_id and service_type values since
    it could aid in debugging the problem quicker.

    Change-Id: Ic13901b92cac05e8ddf1092b66aa5bcc5623fa8a
    Closes-bug: #1637366

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/545613

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/545614

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/545615

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

Reviewed: https://review.openstack.org/545613
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=5b7a1f85b36bb5f4b195c3cb19059966f33112ca
Submitter: Zuul
Branch: stable/queens

commit 5b7a1f85b36bb5f4b195c3cb19059966f33112ca
Author: Brian Haley <email address hidden>
Date: Mon Feb 12 15:38:24 2018 -0500

    Always pass device_owner to _ipam_get_subnets()

    There was one code path where the existing device_owner
    value, which is used for subnet selection when service_type's
    are in use was not passed to _imap_get_subnets(). This could
    trigger one of two exceptions - HostNotCompatibleWithFixedIps()
    or IpAddressGenerationFailureNoMatchingSubnet() depending
    on the environment. Pass it along if known.

    Also update the IpAddressGenerationFailureNoMatchingSubnet
    exception to print the network_id and service_type values since
    it could aid in debugging the problem quicker.

    Change-Id: Ic13901b92cac05e8ddf1092b66aa5bcc5623fa8a
    Closes-bug: #1637366
    (cherry picked from commit 0d4889df41485cece4bef5915753ae7efd808138)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/pike)

Reviewed: https://review.openstack.org/545614
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=51e86150bf298e77d6c12cecb06ccf38ac2f747e
Submitter: Zuul
Branch: stable/pike

commit 51e86150bf298e77d6c12cecb06ccf38ac2f747e
Author: Brian Haley <email address hidden>
Date: Mon Feb 12 15:38:24 2018 -0500

    Always pass device_owner to _ipam_get_subnets()

    There was one code path where the existing device_owner
    value, which is used for subnet selection when service_type's
    are in use was not passed to _imap_get_subnets(). This could
    trigger one of two exceptions - HostNotCompatibleWithFixedIps()
    or IpAddressGenerationFailureNoMatchingSubnet() depending
    on the environment. Pass it along if known.

    Also update the IpAddressGenerationFailureNoMatchingSubnet
    exception to print the network_id and service_type values since
    it could aid in debugging the problem quicker.

    Change-Id: Ic13901b92cac05e8ddf1092b66aa5bcc5623fa8a
    Closes-bug: #1637366
    (cherry picked from commit 0d4889df41485cece4bef5915753ae7efd808138)

tags: added: in-stable-pike
Changed in neutron:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/ocata)

Reviewed: https://review.openstack.org/545615
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=fb5c2ba3390668afeca828681edc54fb544cef11
Submitter: Zuul
Branch: stable/ocata

commit fb5c2ba3390668afeca828681edc54fb544cef11
Author: Brian Haley <email address hidden>
Date: Mon Feb 12 15:38:24 2018 -0500

    Always pass device_owner to _ipam_get_subnets()

    There was one code path where the existing device_owner
    value, which is used for subnet selection when service_type's
    are in use was not passed to _imap_get_subnets(). This could
    trigger one of two exceptions - HostNotCompatibleWithFixedIps()
    or IpAddressGenerationFailureNoMatchingSubnet() depending
    on the environment. Pass it along if known.

    Also update the IpAddressGenerationFailureNoMatchingSubnet
    exception to print the network_id and service_type values since
    it could aid in debugging the problem quicker.

    Change-Id: Ic13901b92cac05e8ddf1092b66aa5bcc5623fa8a
    Closes-bug: #1637366
    (cherry picked from commit 0d4889df41485cece4bef5915753ae7efd808138)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 11.0.3

This issue was fixed in the openstack/neutron 11.0.3 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 12.0.1

This issue was fixed in the openstack/neutron 12.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 13.0.0.0b1

This issue was fixed in the openstack/neutron 13.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 10.0.6

This issue was fixed in the openstack/neutron 10.0.6 release.

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.