IPv6 slaac subnet creation causes FixedIpsSubnetsNotOnSameSegment error

Bug #1944948 reported by Elvira García Ruiz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Elvira García Ruiz

Bug Description

When trying to create IPv6 SLAAC subnet in multisegment network Neutron raises the FixedIpsSubnetsNotOnSameSegment error. But the subnet is actually created.

Steps to reproduce:
$ openstack network create --share --provider-network-type geneve --provider-segment 777 test_net
SEGMENT=`openstack network segment list --network test_net | awk '/777/ {print $2}'`
$ openstack network segment set --name segment777 $SEGMENT
$ openstack network segment create --network-type geneve --segment 778 --network test_net segment778
$ openstack subnet create --network test_net --network-segment segment777 --ip-version 4 --subnet-range 10.77.7.0/24 --dhcp segment777-v4
$ openstack subnet create --network test_net --network-segment segment778 --ip-version 4 --subnet-range 10.77.8.0/24 --dhcp segment778-v4
$ openstack subnet create --network test_net --network-segment segment777 --ip-version 6 --subnet-range 2001:10:77:7::/64 --dhcp --ipv6-address-mode slaac segment777-v6

Expected result:
Subnet created with no errors

Actual result:
Subnet created, but API throws an exception:
BadRequestException: 400: Client Error for url: http://10.0.0.105:9696/v2.0/subnets, Cannot allocate addresses from different segments.

Version:
- Devstack (Neutron master)
- OVN 21.03

There's a Bugzilla about this topic [0]

[0] https://bugzilla.redhat.com/show_bug.cgi?id=1939601

description: updated
Changed in neutron:
assignee: nobody → Elvira García Ruiz (elviragr)
Changed in neutron:
importance: Undecided → Medium
tags: added: ipv6 ovn
Changed in neutron:
status: New → In Progress
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/811435

Revision history for this message
Harald Jensås (harald-jensas) wrote :
Download full text (3.4 KiB)

After just the IPv4 subnets in the reproducer there is a port with Device Owner: network:distributed which has IP addresess on both network segments.

openstack network create --share --provider-network-type geneve --provider-segment 777 test_net
SEGMENT=`openstack network segment list --network test_net | awk '/777/ {print $2}'`
openstack network segment set --name segment777 $SEGMENT
openstack network segment create --network-type geneve --segment 778 --network test_net segment778

openstack subnet create --network test_net --network-segment segment777 --ip-version 4 --subnet-range 10.77.7.0/24 --dhcp segment777-v4

> DEBUG print's
> HARALD - _query_filter_by_fixed_ips_segment allow_multiple_segments: True
> HARALD - _query_filter_by_fixed_ips_segment fixed_ips: [{'subnet_id': '24bbf7fe-482b-455a-a24f-3f3445af5759'}]

openstack subnet create --network test_net --network-segment segment778 --ip-version 4 --subnet-range 10.77.8.0/24 --dhcp segment778-v4

> DEBUG print's
> HARALD - _query_filter_by_fixed_ips_segment allow_multiple_segments: True
> HARALD - _query_filter_by_fixed_ips_segment fixed_ips: [{'subnet_id': 'b2c2a935-8a85-44b2-8a0a-2e0533ad8d56'}, {'subnet_id': '24bbf7fe-482b-455a-a24f-3f3445af5759', 'ip_address': '10.77.7.2'}]

stack@heat-devstack:~$ openstack port list --long --network test_net -f yaml
/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
/usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
  from cryptography.utils import int_from_bytes
- Device Owner: network:distributed
  Fixed IP Addresses:
  - ip_address: 10.77.7.2
    subnet_id: 4bab13e3-bef0-45d6-8c73-491c2e0cf183
  - ip_address: 10.77.8.2
    subnet_id: 82cd4ea5-fed6-4668-b373-f7d873f3d31c
  ID: 8e1c95f9-38b0-44c9-8249-dc9d0766fb01
  MAC Address: fa:16:3e:49:97:80
  Name: ''
  Security Groups: null
  Status: DOWN
  Tags: []

Updating this port with another address when adding the IPv6 subnet is failing.

openstack subnet create --network test_net --network-segment segment777 --ip-version 6 --subnet-range 2001:10:77:7::/64 --dhcp --ipv6-address-mode slaac segment777-v6

> DEBUG print's
> HARALD - _query_filter_by_fixed_ips_segment allow_multiple_segments: False
> HARALD - _query_filter_by_fixed_ips_segment fixed_ips: [{'subnet_id': '24bbf7fe-482b-455a-a24f-3f3445af5759', 'ip_address': '10.77.7.2'}, {'subnet_id': 'b2c2a935-8a85-44b2-8a0a-2e0533ad8d56', 'ip_address': '10.77.8.2'}]

The difference seems to be that in the IPv4 subnet create case the 'allow_multiple_segments' is True, while in the IPv6 case it is False.

In patch "[OVN] Allow IP allocation with different segments for OVN service po...

Read more...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/811719

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by "Elvira García Ruiz <email address hidden>" on branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/811435
Reason: Harald created a commit that fixes this bug better

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/811719
Committed: https://opendev.org/openstack/neutron/commit/84b6db3b0528a39450f48297d289cd9c618e3beb
Submitter: "Zuul (22348)"
Branch: master

commit 84b6db3b0528a39450f48297d289cd9c618e3beb
Author: Harald Jensås <email address hidden>
Date: Wed Sep 29 13:26:36 2021 +0200

    [OVN] Allow IP allocation with different segments for OVN service ports

    Allow IP allocation with different segments also for IPv6
    auto allocation for OVN service ports.

    See change: Ib51cde89ed873f48db4daebc27a0980da9cc0f19

    Change-Id: Ic6db2f66be596756b1fed9ffeffc7b049f6e957f
    Closes-Bug: #1944948

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

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/813447

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

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/neutron/+/813448

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

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/neutron/+/813450

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

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/neutron/+/813454

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

Fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/neutron/+/813457

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/813447
Committed: https://opendev.org/openstack/neutron/commit/39164c037082f842ba2cbf87512d63371510bb2a
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 39164c037082f842ba2cbf87512d63371510bb2a
Author: Harald Jensås <email address hidden>
Date: Wed Sep 29 13:26:36 2021 +0200

    [OVN] Allow IP allocation with different segments for OVN service ports

    Allow IP allocation with different segments also for IPv6
    auto allocation for OVN service ports.

    See change: Ib51cde89ed873f48db4daebc27a0980da9cc0f19

    Change-Id: Ic6db2f66be596756b1fed9ffeffc7b049f6e957f
    Closes-Bug: #1944948
    (cherry picked from commit 84b6db3b0528a39450f48297d289cd9c618e3beb)

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/813450
Committed: https://opendev.org/openstack/neutron/commit/018dd8c167c8d6f3388a5867916fd858b471a083
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 018dd8c167c8d6f3388a5867916fd858b471a083
Author: Harald Jensås <email address hidden>
Date: Wed Sep 29 13:26:36 2021 +0200

    [OVN] Allow IP allocation with different segments for OVN service ports

    Allow IP allocation with different segments also for IPv6
    auto allocation for OVN service ports.

    See change: Ib51cde89ed873f48db4daebc27a0980da9cc0f19

    Change-Id: Ic6db2f66be596756b1fed9ffeffc7b049f6e957f
    Closes-Bug: #1944948
    (cherry picked from commit 84b6db3b0528a39450f48297d289cd9c618e3beb)

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/813454
Committed: https://opendev.org/openstack/neutron/commit/5156364b68d1dbf3eec49ad4ee0dfd8a0a4703f4
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit 5156364b68d1dbf3eec49ad4ee0dfd8a0a4703f4
Author: Harald Jensås <email address hidden>
Date: Wed Sep 29 13:26:36 2021 +0200

    [OVN] Allow IP allocation with different segments for OVN service ports

    Allow IP allocation with different segments also for IPv6
    auto allocation for OVN service ports.

    See change: Ib51cde89ed873f48db4daebc27a0980da9cc0f19

    Change-Id: Ic6db2f66be596756b1fed9ffeffc7b049f6e957f
    Closes-Bug: #1944948
    (cherry picked from commit 84b6db3b0528a39450f48297d289cd9c618e3beb)

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/813448
Committed: https://opendev.org/openstack/neutron/commit/cb15948fa984f89d7fed14fc824ed2f2dd956a1a
Submitter: "Zuul (22348)"
Branch: stable/xena

commit cb15948fa984f89d7fed14fc824ed2f2dd956a1a
Author: Harald Jensås <email address hidden>
Date: Wed Sep 29 13:26:36 2021 +0200

    [OVN] Allow IP allocation with different segments for OVN service ports

    Allow IP allocation with different segments also for IPv6
    auto allocation for OVN service ports.

    See change: Ib51cde89ed873f48db4daebc27a0980da9cc0f19

    Change-Id: Ic6db2f66be596756b1fed9ffeffc7b049f6e957f
    Closes-Bug: #1944948
    (cherry picked from commit 84b6db3b0528a39450f48297d289cd9c618e3beb)

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/813457
Committed: https://opendev.org/openstack/neutron/commit/a5518db3b75a00132e6fe35398e7a5891f500572
Submitter: "Zuul (22348)"
Branch: stable/train

commit a5518db3b75a00132e6fe35398e7a5891f500572
Author: Harald Jensås <email address hidden>
Date: Wed Sep 29 13:26:36 2021 +0200

    [OVN] Allow IP allocation with different segments for OVN service ports

    Allow IP allocation with different segments also for IPv6
    auto allocation for OVN service ports.

    See change: Ib51cde89ed873f48db4daebc27a0980da9cc0f19

    Change-Id: Ic6db2f66be596756b1fed9ffeffc7b049f6e957f
    Closes-Bug: #1944948
    (cherry picked from commit 84b6db3b0528a39450f48297d289cd9c618e3beb)

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

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

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

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

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

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

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

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

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

This issue was fixed in the openstack/neutron 20.0.0.0rc1 release candidate.

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

This issue was fixed in the openstack/neutron train-eol 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.