VLAN IDs of subnets not assigned correct

Bug #1840054 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'

and assign those networks to be used, the networks won't get configured correct as the VLAN id defaults to 1

{
    "network_config": [
        {
            "addresses": [
                {
                    "ip_netmask": "192.168.24.28/24"
                }
            ],
            "dns_servers": [
                "10.11.5.19"
            ],
            "domain": [],
            "members": [
                {
                    "mtu": 1500,
                    "name": "nic1",
                    "primary": true,
                    "type": "interface"
                },
                {
                    "addresses": [
                        {
                            "ip_netmask": "172.17.1.165/24"
                        }
                    ],
                    "mtu": 1500,
                    "routes": [
                        {
                            "destination": "172.17.1.0/24",
                            "nexthop": "172.16.1.254"
                        }
                    ],
                    "type": "vlan",
                    "vlan_id": 1
                },
                {
                    "addresses": [
                        {
                            "ip_netmask": "172.17.3.86/24"
                        }
                    ],
                    "mtu": 1500,
                    "routes": [
                        {
                            "destination": "172.17.3.0/24",
                            "nexthop": "172.16.3.254"
                        }
                    ],
                    "type": "vlan",
                    "vlan_id": 1
                },
                {
                    "addresses": [
                        {
                            "ip_netmask": "172.17.2.80/24"
                        }
                    ],
                    "mtu": 1500,
                    "routes": [
                        {
                            "destination": "172.17.2.0/24",
                            "nexthop": "172.16.2.254"
                        }
                    ],
                    "type": "vlan",
                    "vlan_id": 1
                },
                {
                    "addresses": [
                        {
                            "ip_netmask": "172.16.0.34/24"
                        }
                    ],
                    "mtu": 1500,
                    "routes": [],
                    "type": "vlan",
                    "vlan_id": 50
                },
                {
                    "addresses": [
                        {
                            "ip_netmask": "10.0.1.186/24"
                        }
                    ],
                    "mtu": 1500,
                    "routes": [
                        {
                            "destination": "10.0.0.0/24",
                            "nexthop": "10.0.1.254"
                        },
                        {
                            "default": true,
                            "next_hop": "10.0.1.254"
                        }
                    ],
                    "type": "vlan",
                    "vlan_id": 1
                }
            ],
            "mtu": 1500,
            "name": "br-ex",
            "routes": [
                {
                    "default": true,
                    "ip_netmask": "0.0.0.0/0",
                    "next_hop": "192.168.24.1"
                }
            ],
            "type": "ovs_bridge",
            "use_dhcp": false
        }
    ]
}

[root@cell1-cellcontrol-0 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP group default qlen 1000
    link/ether 00:4f:96:2f:c7:ef brd ff:ff:ff:ff:ff:ff
    inet6 fe80::24f:96ff:fe2f:c7ef/64 scope link
       valid_lft forever preferred_lft forever
3: ovs-system: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether ba:b3:06:f5:58:76 brd ff:ff:ff:ff:ff:ff
4: br-ex: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether 00:4f:96:2f:c7:ef brd ff:ff:ff:ff:ff:ff
    inet 192.168.24.28/24 brd 192.168.24.255 scope global br-ex
       valid_lft forever preferred_lft forever
    inet6 fe80::24f:96ff:fe2f:c7ef/64 scope link
       valid_lft forever preferred_lft forever
5: vlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether e2:c5:96:8e:ab:e2 brd ff:ff:ff:ff:ff:ff
    inet 10.0.1.186/24 brd 10.0.1.255 scope global vlan1
       valid_lft forever preferred_lft forever
    inet6 fe80::e0c5:96ff:fe8e:abe2/64 scope link
       valid_lft forever preferred_lft forever
6: vlan50: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether ee:83:0c:e7:15:33 brd ff:ff:ff:ff:ff:ff
    inet 172.16.0.34/24 brd 172.16.0.255 scope global vlan50
       valid_lft forever preferred_lft forever
    inet6 fe80::ec83:cff:fee7:1533/64 scope link
       valid_lft forever preferred_lft forever
7: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:d9:14:76:ce brd ff:ff:ff:ff:ff:ff
    inet 172.31.0.1/24 scope global docker0
       valid_lft forever preferred_lft forever

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

Fix proposed to branch: master
Review: https://review.opendev.org/676218

Changed in tripleo:
assignee: nobody → Martin Schuppert (mschuppert)
status: New → In Progress
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/676218
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=6745f86f2a2d3b4ef8d64abcd70f52e520d22173
Submitter: Zuul
Branch: master

commit 6745f86f2a2d3b4ef8d64abcd70f52e520d22173
Author: Martin Schuppert <email address hidden>
Date: Tue Aug 13 17:23:05 2019 +0200

    Fix vlan id assignment with additional subnets

    _role_net_subnet contains the name of the subnet, so
    _role_net_subnet.vlan will not return the correct configured
    vlan id. This change uses network.subnets[_role_net_subnet].vlan
    to get the configured vlan id.

    Change-Id: Ifef98f45a57af508d7302584aa52eedd45316edd
    Closes-Bug: #1840054

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/676653

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

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

commit 9af90d7401d4c414b6d741ff4c4fd56b4b8089e3
Author: Martin Schuppert <email address hidden>
Date: Tue Aug 13 17:23:05 2019 +0200

    Fix vlan id assignment with additional subnets

    _role_net_subnet contains the name of the subnet, so
    _role_net_subnet.vlan will not return the correct configured
    vlan id. This change uses network.subnets[_role_net_subnet].vlan
    to get the configured vlan id.

    Change-Id: Ifef98f45a57af508d7302584aa52eedd45316edd
    Closes-Bug: #1840054
    (cherry picked from commit 6745f86f2a2d3b4ef8d64abcd70f52e520d22173)

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.

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.