VLAN creation failed due to bridge_name not substituted

Bug #1866393 reported by Zhu Shengli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Undecided
Zhu Shengli

Bug Description

Description
===========

I created a ovs bridge specifically for external network as the following template.

```
      - type: ovs_bridge
        name: bridge_name
        addresses:
        - ip_netmask:
            list_join:
            - /
            - - {get_param: ControlPlaneIp}
              - {get_param: ControlPlaneSubnetCidr}
        members:
          - type: interface
            name: interface_name
      - type: vlan
        device: bridge_name
        vlan_id:
          {get_param: ExternalNetworkVlanID}
        addresses:
          - ip_netmask:
              {get_param: ExternalIpSubnet}
```

But the deployment failed during this network because the bridge_name in the vlan definition was not substituded at all. The relevant code in generated /etc/os-net-config/config.json was kind like:

```
{"addresses": [{"ip_netmask": "10.1.1.111/24"}], "device": "bridge_name", "routes": [{"default": true, "next_hop": "10.1.1.1"}], "type": "vlan", "vlan_id": 655}
```

I checked the code in `run-os-net-config.sh`. Apparently the sed command only substitutes the first occurrence of bridge_name because it's used without `/g`.

```
    sed -i "s/bridge_name/${bridge_name:-''}/" /etc/os-net-config/config.json
    sed -i "s/interface_name/${interface_name:-''}/" /etc/os-net-config/config.json
```

I know the bridge_name is supposed to be substituted by NeutronExternalNetworkBridge(defaults to br-ex). So is this intentional? We are not supposed to manually add any network on this bridge?

BTW,
The network template snippet above was copied from the documentation of RedHat Openstack Platform.

https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/15/html-single/advanced_overcloud_customization/index#network-interface-reference

Steps to reproduce
==================

add the following code to controller network template and deploy.

```
```
      - type: ovs_bridge
        name: bridge_name
        addresses:
        - ip_netmask:
            list_join:
            - /
            - - {get_param: ControlPlaneIp}
              - {get_param: ControlPlaneSubnetCidr}
        members:
          - type: interface
            name: interface_name
      - type: vlan
        device: bridge_name
        vlan_id:
          {get_param: ExternalNetworkVlanID}
        addresses:
          - ip_netmask:
              {get_param: ExternalIpSubnet}
```

Expected result
===============
VLAN655 was created normally.

Actual result
=============
Deploy failed, VLAN655 was not created.

Zhu Shengli (akarei)
description: updated
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/714102

Changed in tripleo:
assignee: nobody → Zhu Shengli (akarei)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

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

commit 47ca83280cef1ee6756161176ad3aea8060bb08d
Author: Zhu Sheng Li <email address hidden>
Date: Fri Mar 20 19:53:41 2020 +0800

    Replace all the bridge_name variables in templates

    The bridge_name might be used for multiple times, for example,
    in different vlan configurations. All of them should be replaced with
    the actual ${bridge_name} variable.

    Change-Id: I93ee204a526422f113a88b99531583e3cf769382
    Closes-Bug: #1866393

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

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

Zhu Shengli (akarei)
Changed in tripleo:
status: Fix Released → Fix Committed
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/749822

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

Reviewed: https://review.opendev.org/749822
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=7eb563da2665e6ff47d14eb823af6d32e08c8f3a
Submitter: Zuul
Branch: stable/train

commit 7eb563da2665e6ff47d14eb823af6d32e08c8f3a
Author: Zhu Sheng Li <email address hidden>
Date: Fri Mar 20 19:53:41 2020 +0800

    Replace all the bridge_name variables in templates

    The bridge_name might be used for multiple times, for example,
    in different vlan configurations. All of them should be replaced with
    the actual ${bridge_name} variable.

    Change-Id: I93ee204a526422f113a88b99531583e3cf769382
    Closes-Bug: #1866393
    (cherry picked from commit 47ca83280cef1ee6756161176ad3aea8060bb08d)

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

This issue was fixed in the openstack/tripleo-heat-templates 11.4.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.