adding additional subnets fail as no network segment is assigned to the default subnets

Bug #1840039 reported by Martin Schuppert
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Undecided
Martin Schuppert

Bug Description

When adding new subnets to an existing network the network_data.yaml like e.g. storage_cell1:

- name: Storage
  external_resource_network_id: 182e1de2-8e0d-44f9-929d-ebcc1899e46c
  external_resource_subnet_id: 65cf39a3-d7fd-472e-941a-7636fdcaefb9
  vip: true
  vlan: 30
  name_lower: storage
  ip_subnet: '172.16.1.0/24'
  allocation_pools: [{'start': '172.16.1.4', 'end': '172.16.1.250'}]
  ipv6_subnet: 'fd00:fd00:fd00:3000::/64'
  ipv6_allocation_pools: [{'start': 'fd00:fd00:fd00:3000::10', 'end': 'fd00:fd00:fd00:3000:ffff:ffff:ffff:fffe'}]
  mtu: 1500
  subnets:
    storage_cell1:
      vlan: 31
      ip_subnet: '172.17.1.0/24'
      allocation_pools: [{'start': '172.17.1.10', 'end': '172.17.1.250'}]
      gateway_ip: '172.17.1.254'
...
- name: InternalApi
  external_resource_network_id: 348b8a30-e11b-4eaa-9843-e46ff071f211
  external_resource_subnet_id: 5fc46eea-0f6a-446d-9c9e-edd3e41a0a69
  name_lower: internal_api
  vip: true
  vlan: 20
  ip_subnet: '172.16.2.0/24'
  allocation_pools: [{'start': '172.16.2.4', 'end': '172.16.2.250'}]
  ipv6_subnet: 'fd00:fd00:fd00:2000::/64'
  ipv6_allocation_pools: [{'start': 'fd00:fd00:fd00:2000::10', 'end': 'fd00:fd00:fd00:2000:ffff:ffff:ffff:fffe'}]
  mtu: 1500
  subnets:
    internal_api_cell1:
      vlan: 21
      ip_subnet: '172.17.2.0/24'
      allocation_pools: [{'start': '172.17.2.10', 'end': '172.17.2.250'}]
      gateway_ip: '172.17.2.254'

The stack deploy fails as the additional subnets get assigned to a segment [1], but the default subnets are not and the segment id is none:

Neutron server returns req
2019-08-13 12:20:00Z [cell1.Networks]: CREATE_FAILED Resource CREATE failed: BadRequest: resources.StorageNetwork.resources.StorageSubnet_storage_cell1: All of the subnets on network '182e1de2-8e0d-44f9-929d-ebcc1899e46c' must either all be associated with segments or all not associated with any segment.
Ne

 Stack cell1/a0dbe0ca-21fe-40cf-bf6e-e4d1a9ba3fb6 CREATE_FAILED

cell1.Networks.InternalApiNetwork.InternalApiSubnet_internal_api_cell1:
  resource_type: OS::Neutron::Subnet
  physical_resource_id:
  status: CREATE_FAILED
  status_reason: |
    BadRequest: resources.InternalApiSubnet_internal_api_cell1: All of the subnets on network '348b8a30-e11b-4eaa-9843-e46ff071f211' must either all be associated with segments or all not associated with any segment.
    Neutron server returns request_ids: ['req-68bfd490-6b71-48e4-8309-5b3fe4391804']
cell1.Networks.StorageMgmtNetwork.StorageMgmtSubnet_storage_mgmt_cell1:
  resource_type: OS::Neutron::Subnet
  physical_resource_id:
  status: CREATE_FAILED
  status_reason: |
    BadRequest: resources.StorageMgmtSubnet_storage_mgmt_cell1: All of the subnets on network '44a1d388-acd6-4e55-8231-7a7ea9c054a2' must either all be associated with segments or all not associated with any segment.
    Neutron server returns request_ids: ['req-c3d90f16-8690-4691-aabb-14281ebb5142']
cell1.Networks.StorageNetwork.StorageSubnet_storage_cell1:
  resource_type: OS::Neutron::Subnet
  physical_resource_id:
  status: CREATE_FAILED
  status_reason: |
    BadRequest: resources.StorageSubnet_storage_cell1: All of the subnets on network '182e1de2-8e0d-44f9-929d-ebcc1899e46c' must either all be associated with segments or all not associated with any segment.
    Neutron server returns request_ids: ['req-0ff31af8-ed70-42ca-9c08-1c3f9aa3c53d']
cell1.Networks.ExternalNetwork.ExternalSubnet_external_cell1:
  resource_type: OS::Neutron::Subnet
  physical_resource_id:
  status: CREATE_FAILED
  status_reason: |
    BadRequest: resources.ExternalSubnet_external_cell1: All of the subnets on network '64197111-f776-4f78-819e-11522d700ad8' must either all be associated with segments or all not associated with any segment.
    Neutron server returns request_ids: ['req-ed190079-0462-4bf8-98a3-0cccf3bfe915']
Heat Stack create failed.
Heat Stack create failed.

(undercloud) [stack@undercloud ~]$ openstack subnet show 11d33d1c-9092-408e-89a2-736c527f87ae
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field             | Value                                                                                                                                                                              |
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| allocation_pools  | 172.16.3.4-172.16.3.250                                                                                                                                                            |
| cidr              | 172.16.3.0/24                                                                                                                                                                      |
| created_at        | 2019-08-13T07:48:29Z                                                                                                                                                               |
| description       |                                                                                                                                                                                    |
| dns_nameservers   |                                                                                                                                                                                    |
| enable_dhcp       | False                                                                                                                                                                              |
| gateway_ip        | None                                                                                                                                                                               |
| host_routes       |                                                                                                                                                                                    |
| id                | 11d33d1c-9092-408e-89a2-736c527f87ae                                                                                                                                               |
| ip_version        | 4                                                                                                                                                                                  |
| ipv6_address_mode | None                                                                                                                                                                               |
| ipv6_ra_mode      | None                                                                                                                                                                               |
| location          | Munch({'project': Munch({'domain_name': 'Default', 'domain_id': None, 'name': 'admin', 'id': u'5d7d8a5539eb46078878ec1331e5031e'}), 'cloud': '', 'region_name': '', 'zone': None}) |
| name              | storage_mgmt_subnet                                                                                                                                                                |
| network_id        | 44a1d388-acd6-4e55-8231-7a7ea9c054a2                                                                                                                                               |
| prefix_length     | None                                                                                                                                                                               |
| project_id        | 5d7d8a5539eb46078878ec1331e5031e                                                                                                                                                   |
| revision_number   | 0                                                                                                                                                                                  |
| segment_id        | None                                                                                                                                                                               |
| service_types     |                                                                                                                                                                                    |
| subnetpool_id     | None                                                                                                                                                                               |
| tags              |                                                                                                                                                                                    |
| updated_at        | 2019-08-13T07:48:29Z                                                                                                                                                               |
+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

[1] https://github.com/openstack/tripleo-heat-templates/blob/master/network/network.j2#L165-L168

Changed in tripleo:
assignee: nobody → Martin Schuppert (mschuppert)
status: New → In Progress
Revision history for this message
Martin Schuppert (mschuppert) wrote :
tags: added: stein-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.opendev.org/676192
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=461ee36dd0e2453bdbe0d9458706b5e0743a5ac2
Submitter: Zuul
Branch: master

commit 461ee36dd0e2453bdbe0d9458706b5e0743a5ac2
Author: Martin Schuppert <email address hidden>
Date: Tue Aug 13 15:33:46 2019 +0200

    Also assign default subnets to network segment

    Right now only additional subnets get assigned to a network segment.
    But this fails as either all or none subnets on a network must be
    assigned with segments.

    This removes the conditional to also assign the default subnet to
    the segment.

    Change-Id: Ief7af583d03c07f30662abf86da21451f8361197
    Closes-Bug: #1840039

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/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/676587

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

Reviewed: https://review.opendev.org/676587
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=864b2e9e6ae8eb93617c1601246ba5d7111a013b
Submitter: Zuul
Branch: stable/stein

commit 864b2e9e6ae8eb93617c1601246ba5d7111a013b
Author: Martin Schuppert <email address hidden>
Date: Tue Aug 13 15:33:46 2019 +0200

    Also assign default subnets to network segment

    Right now only additional subnets get assigned to a network segment.
    But this fails as either all or none subnets on a network must be
    assigned with segments.

    This removes the conditional to also assign the default subnet to
    the segment.

    Change-Id: Ief7af583d03c07f30662abf86da21451f8361197
    Closes-Bug: #1840039
    (cherry picked from commit 461ee36dd0e2453bdbe0d9458706b5e0743a5ac2)

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

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

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

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

Revision history for this message
Oleg Bondarev (obondarev) wrote :

Please describe Neutron issue and steps to reproduce

Changed in neutron:
status: New → Incomplete
no longer affects: neutron
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.