Bug 1769635

Summary: (RFE) Add ability to enable/disable Spanning Tree Protocol on OVS bridges using TripleO templates
Product: Red Hat OpenStack Reporter: ldenny
Component: openstack-tripleo-heat-templatesAssignee: OSP Team <rhos-maint>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 18.0 (Zed)CC: augol, bshephar, mburns
Target Milestone: gaKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description ldenny 2019-11-07 04:21:23 UTC
1. Proposed title of this feature request. 

— Add ability to enable/disable Spanning Tree Protocol on OVS bridges using TripleO templates

2. What is the nature and description of the request? 

— Customer would like to be able to enable/disable STP from within TripleO heat templates. So they do not have to run `sudo ovs-vsctl set bridge br0 stp_enable=true/false` manually.

3. Why does the customer need this? (List the business requirements here)

— It would be more reliable and update proof. Better than logging into each node and setting it manually.

4. How would the customer like to achieve this? (List the functional requirements here)

— They would like to be able to set the option in a TripleO template to be applied when deploying.

6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.

— Test it by setting the newly created option to enable or disable in the template then deploy OpenStack and check the status of STP on the bridge using `sudo ovs-vsctl list bridge $bridge-Name` 

7. Is there already an existing RFE upstream or in Red Hat Bugzilla?

— No

8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?

— No

9. Is the sales team involved in this request and do they have any additional input?

— No

10. List any affected packages or components.

— tripleo-heat-templates

11. Would the customer be able to assist in testing this functionality if implemented?

— I would be happy to test the new feature

Comment 1 Brendan Shephard 2019-12-31 22:07:38 UTC
I raised this upstream as well:
https://bugs.launchpad.net/tripleo/+bug/1858010

The Heat template we used to accomplish this functionality is:

heat_template_version: 2014-10-16

description: >
  Enable or Disable Spanning Tree Protocol

parameters:
  servers:
    type: json
  stp_value:
    type: string
  bridge_value:
    type: string
  DeployIdentifier:
    type: string

resources:
  CustomExtraConfig:
    type: OS::Heat::SoftwareConfig
    properties:
      group: script
      config:
        str_replace:
          template: |
            #!/bin/sh
            sudo ovs-vsctl set bridge _BRIDGE_VALUE_ stp_enable=_STP_VALUE_
          params:
            _STP_VALUE_: {get_param: stp_value}
            _BRIDGE_VALUE_: {get_param: bridge_value}


  CustomExtraDeployments:
    type: OS::Heat::SoftwareDeploymentGroup
    properties:
      servers:  {get_param: servers}
      config: {get_resource: CustomExtraConfig}
      actions: ['CREATE','UPDATE']
      input_values:
        deploy_identifier: {get_param: DeployIdentifier}

With the env file:
resource_registry:
  OS::TripleO::NodeExtraConfigPost: /home/stack/stp-test.yaml

parameter_defaults:
  stp_value: "false"
  bridge_value: "br-int"


If we renamed these variables. Would this be suitable to propose as is? Or would we like to rename / change some components of it?

I think we need someone from Openvswitch and also from Neutron to verify that there is no potential issues with disabling STP that we haven't thought of.