ctlplane IPv6 router port - subnet update fails ConflictException

Bug #1955417 reported by Harald Jensås
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Harald Jensås

Bug Description

When re-running 'openstack undercloud install' on and undercloud with 'enable_routed_networks = false' it will fail updating the subnet due to a existing port conflict.

File \"/var/lib/heat-config/heat-config-script/713d1890-8f6c-4a76-ba57-b91194a3ce85\", line 129, in _neutron_subnet_update
File \"/usr/lib/python3.6/site-packages/openstack/network/v2/_proxy.py\", line 3469, in update_subnet
    return self._update(_subnet.Subnet, subnet, **attrs)
File \"/usr/lib/python3.6/site-packages/openstack/proxy.py\", line 46, in check
    return method(self, expected, actual, *args, **kwargs)
File \"/usr/lib/python3.6/site-packages/openstack/proxy.py\", line 393, in _update
    return res.commit(self, base_path=base_path)
File \"/usr/lib/python3.6/site-packages/openstack/resource.py\", line 1402, in commit
    retry_on_conflict=retry_on_conflict)
File \"/usr/lib/python3.6/site-packages/openstack/resource.py\", line 1428, in _commit
   self._translate_response(response, has_body=has_body)
File \"/usr/lib/python3.6/site-packages/openstack/resource.py\", line 1107, in _translate_response
    exceptions.raise_from_response(response, error_message=error_message)
File \"/usr/lib/python3.6/site-packages/openstack/exceptions.py\", line 229, in raise_from_response
    http_status=http_status, request_id=request_id
openstack.exceptions.ConflictException: ConflictException: 409: Client Error for url: http://[2001:db8:88ec:9fb3::10]:9696/v2.0/subnets/6dfcdafe-042d-4014-99ba-d4dcdf740e02, Current gateway ip 2001:db8:88ec:9fb3::5 already in use by port e3259023-707e-4d2f-82f0-63e24fa7af5f. Unable to update.

The undercloud installer should not pass the 'gateway_ip' unless it is changed.
Also the router port should be recreated if the 'gateway_ip' is changed.

Revision history for this message
Harald Jensås (harald-jensas) wrote :

Chaging the gateway also fail:
 +gateway = 2405:200:81c:391:61::25
 -gateway = 2405:200:81c:391:61::15

Neutron change https://review.opendev.org/c/openstack/neutron/+/822098 addresses the non-changing address issue. But seems we need to handle this in case the address is changed.

>>> subnet = conn.network.find_subnet('ctlplane-subnet')
>>> subnet
openstack.network.v2.subnet.Subnet(id=3658699f-b165-48d9-b92c-214c5eb353e4, name=ctlplane-subnet, tenant_id=2e4b5681eea34176be0d3d9fcebadee3, network_id=c285d079-6983-4fb1-9ad3-244855f068f8, ip_version=6, subnetpool_id=None, enable_dhcp=True, ipv6_ra_mode=dhcpv6-stateful, ipv6_address_mode=dhcpv6-stateful, gateway_ip=2405:200:81c:391:61::15, cidr=2405:200:81c:391::/64, allocation_pools=[{'start': '2405:200:81c:391:61::100', 'end': '2405:200:81c:391:61::4ff'}], host_routes=[], dns_nameservers=[], description=, service_types=[], segment_id=None, tags=[], created_at=2021-12-20T11:22:51Z, updated_at=2021-12-20T12:16:54Z, revision_number=1, location=Munch({'cloud': 'undercloud', 'region_name': 'regionOne', 'zone': None, 'project': Munch({'id': '2e4b5681eea34176be0d3d9fcebadee3', 'name': 'admin', 'domain_id': None, 'domain_name': 'Default'})}))
>>> conn.network.update_subnet(subnet.id, name=subnet.name, gateway_ip='2405:200:81c:391:61::25', allocation_pools=subnet.allocation_pools, dns_nameservers=subnet.dns_nameservers)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/openstack/network/v2/_proxy.py", line 3469, in update_subnet
    return self._update(_subnet.Subnet, subnet, **attrs)
  File "/usr/lib/python3.6/site-packages/openstack/proxy.py", line 46, in check
    return method(self, expected, actual, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/openstack/proxy.py", line 393, in _update
    return res.commit(self, base_path=base_path)
  File "/usr/lib/python3.6/site-packages/openstack/resource.py", line 1402, in commit
    retry_on_conflict=retry_on_conflict)
  File "/usr/lib/python3.6/site-packages/openstack/resource.py", line 1428, in _commit
    self._translate_response(response, has_body=has_body)
  File "/usr/lib/python3.6/site-packages/openstack/resource.py", line 1107, in _translate_response
    exceptions.raise_from_response(response, error_message=error_message)
  File "/usr/lib/python3.6/site-packages/openstack/exceptions.py", line 229, in raise_from_response
    http_status=http_status, request_id=request_id
openstack.exceptions.ConflictException: ConflictException: 409: Client Error for url: https://[2405:200:81c:391:61::13]:13696/v2.0/subnets/3658699f-b165-48d9-b92c-214c5eb353e4, Current gateway ip 2405:200:81c:391:61::15 already in use by port cd604908-93eb-4c9b-a42a-c93eafd15a1a. Unable to update.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)
Changed in tripleo:
status: Triaged → In Progress
Changed in tripleo:
assignee: nobody → Harald Jensås (harald-jensas)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/822460
Committed: https://opendev.org/openstack/tripleo-heat-templates/commit/62ded067d53f8e12591f5ef7392b472cb8e9e985
Submitter: "Zuul (22348)"
Branch: master

commit 62ded067d53f8e12591f5ef7392b472cb8e9e985
Author: Harald Jensås <email address hidden>
Date: Mon Dec 20 22:44:08 2021 +0100

    Fix IPv6 router on UC re-install

    Running 'openstack undercloud install' a second
    time failed with a ConflictException because a subnet
    with a router port cannot have the gateway_ip updated.

    Ensure that the router port is always deleted prior to
    the subnet update and then add the router port again
    after updating the subnet

    Closes-Bug: #1955417
    Change-Id: I0e075153e99876ddf613caecc92b4442e8b6ca03

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

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/822687

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

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/822688

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/ussuri)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/train)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/822687
Committed: https://opendev.org/openstack/tripleo-heat-templates/commit/9eae5d2058e342d73bc6b2b415c463878a024bef
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 9eae5d2058e342d73bc6b2b415c463878a024bef
Author: Harald Jensås <email address hidden>
Date: Mon Dec 20 22:44:08 2021 +0100

    Fix IPv6 router on UC re-install

    Running 'openstack undercloud install' a second
    time failed with a ConflictException because a subnet
    with a router port cannot have the gateway_ip updated.

    Ensure that the router port is always deleted prior to
    the subnet update and then add the router port again
    after updating the subnet

    Closes-Bug: #1955417
    Change-Id: I0e075153e99876ddf613caecc92b4442e8b6ca03
    (cherry picked from commit 62ded067d53f8e12591f5ef7392b472cb8e9e985)

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

Reviewed: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/822689
Committed: https://opendev.org/openstack/tripleo-heat-templates/commit/4fadecc206ecb5469b03bf6ee17a85997da80a96
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit 4fadecc206ecb5469b03bf6ee17a85997da80a96
Author: Harald Jensås <email address hidden>
Date: Mon Dec 20 22:44:08 2021 +0100

    Fix IPv6 router on UC re-install

    Running 'openstack undercloud install' a second
    time failed with a ConflictException because a subnet
    with a router port cannot have the gateway_ip updated.

    Ensure that the router port is always deleted prior to
    the subnet update and then add the router port again
    after updating the subnet

    Closes-Bug: #1955417
    Change-Id: I0e075153e99876ddf613caecc92b4442e8b6ca03
    (cherry picked from commit 62ded067d53f8e12591f5ef7392b472cb8e9e985)

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

Reviewed: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/822688
Committed: https://opendev.org/openstack/tripleo-heat-templates/commit/6fc83dd713d88d16d81175a1ef13bfbdbbdc9498
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 6fc83dd713d88d16d81175a1ef13bfbdbbdc9498
Author: Harald Jensås <email address hidden>
Date: Mon Dec 20 22:44:08 2021 +0100

    Fix IPv6 router on UC re-install

    Running 'openstack undercloud install' a second
    time failed with a ConflictException because a subnet
    with a router port cannot have the gateway_ip updated.

    Ensure that the router port is always deleted prior to
    the subnet update and then add the router port again
    after updating the subnet

    Closes-Bug: #1955417
    Change-Id: I0e075153e99876ddf613caecc92b4442e8b6ca03
    (cherry picked from commit 62ded067d53f8e12591f5ef7392b472cb8e9e985)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/train)

Reviewed: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/822790
Committed: https://opendev.org/openstack/tripleo-heat-templates/commit/31a431d35178427a00ce03c7661aa3550a0180e4
Submitter: "Zuul (22348)"
Branch: stable/train

commit 31a431d35178427a00ce03c7661aa3550a0180e4
Author: Harald Jensås <email address hidden>
Date: Mon Dec 20 22:44:08 2021 +0100

    Fix IPv6 router on UC re-install

    Running 'openstack undercloud install' a second
    time failed with a ConflictException because a subnet
    with a router port cannot have the gateway_ip updated.

    Ensure that the router port is always deleted prior to
    the subnet update and then add the router port again
    after updating the subnet

    Closes-Bug: #1955417
    Change-Id: I0e075153e99876ddf613caecc92b4442e8b6ca03
    (cherry picked from commit 62ded067d53f8e12591f5ef7392b472cb8e9e985)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 12.4.6

This issue was fixed in the openstack/tripleo-heat-templates 12.4.6 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 16.0.0

This issue was fixed in the openstack/tripleo-heat-templates 16.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 13.6.0

This issue was fixed in the openstack/tripleo-heat-templates 13.6.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers