Bug 1399816

Summary: [RFE][Docs][Director] Document Required Changes to NIC Config Templates
Product: Red Hat OpenStack Reporter: Dan Sneddon <dsneddon>
Component: documentationAssignee: Dan Macpherson <dmacpher>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Lopes <mlopes>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 11.0 (Ocata)CC: athomas, bnemec, ccollett, dbecker, dmacpher, dsneddon, jcoufal, mburns, mcornea, morazi, psedlak, rhel-osp-director-maint, sasha, shardy, srevivo
Target Milestone: gaKeywords: FutureFeature
Target Release: 11.0 (Ocata)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Release Note
Doc Text:
Recent enhancements to the director requires changes to network interface configuration templates. The NIC configuration templates now use a script that calls the 'os-net-config utility' to configure the network on the overcloud nodes. There are three major changes to the NIC config templates: * The 'OsNetConfigImpl' resource changed from a 'OS::Heat::StructuredConfig' resource type to 'OS::Heat::SoftwareConfig'. In addition, the resource now stores the 'network_config' property as a blob of text and passes the blob to the 'run-os-net-config.sh' script using the 'str_replace' (string replace) function. For example: ---- resources: OsNetConfigImpl: type: OS::Heat::SoftwareConfig properties: group: script config: str_replace: template: get_file: ../../scripts/run-os-net-config.sh params: $network_config: network_config: ---- * The {get_input: <input>} constructor defined a default external bridge and interface. Now there are two special string values that subsititude for the external bridge and interface. These are 'bridge_name' and 'interface_name' respectively. Instead of using '{get_input: bridge_name}' or '{get_input: interface_name}', use 'bridge_name' or 'interface_name'. For example: ---- - type: ovs_bridge name: {get_input: bridge_name} ---- becomes: ---- - type: ovs_bridge name: bridge_name ---- * The 'network_config' no longer uses curly braces. Instead, the {get_param: <param>} construct moves to a sub-level underneath the value being defined. For example: ---- dns_servers: {get_param: DnsServers} ---- becomes: ---- dns_servers: get_param: DnsServers ---- See more examples in the "Network Isolation" chapter of the Advanced Overcloud Customizations guide.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-18 08:05:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Example single-NIC controller.yaml template. none

Description Dan Sneddon 2016-11-29 19:38:42 UTC
Created attachment 1225999 [details]
Example single-NIC controller.yaml template.

Description of problem: Due to architectural changes in TripleO, os-net-config will be called from a script instead of a TripleO disk-image-builder element. This requires changes to the NIC config templates, and will necessitate a complete reformatting of all custom NIC templates used currently by end-users in order to facilitate upgrades.


Version-Release number of selected component (if applicable): OSP 11 will be based on Ocata, where these changes occurred.


Actual results: Several changes are required to the format and contents of the NIC config templates.


Expected results: In previous versions of OSP-Director, only minor updates were required to NIC config templates.


Additional info: There are several major changes to the NIC config templates:

* The network_config is no longer a simple YAML-formatted property of a Heat parameter, as in previous versions, it is now a blob of text used in a Heat str_replace (string replace) function. Due to this change, the preamble to the network config will be different. This can be seen in the resource definition:

resources:
  OsNetConfigImpl:
    type: OS::Heat::SoftwareConfig
    properties:
      group: script
      config:
        str_replace:
          template:
            get_file: ../../scripts/run-os-net-config.sh
          params:
            $network_config:
              network_config:

* The {get_input: <input>} constructor that was previously used to define a default external bridge and interface is no longer used. Instead, there are two special string values which will be replaced when the script is written. These are "bridge_name" and "interface_name". Instead of using "{get_input: bridge_name}" or "{get_input: interface_name}", you can just use "bridge_name" or "interface_name", for example:

              - type: ovs_bridge
                name: {get_input: bridge_name}

becomes:

              - type: ovs_bridge
                name: bridge_name

* Since the network_config defined in the SoftwareConfig is now passed as a string, curly-braces are no longer used. Instead, the {get_param: <param>} construct is moved to a sub-level underneath the value being defined, so this:

                dns_servers: {get_param: DnsServers}

becomes:

                dns_servers:
                  get_param: DnsServers

An example of the new style of template for a controller with a single NIC is attached to demonstrate the changes.

The changes will also be documented in tripleo-docs. Note that these changes also apply to RDO.

Comment 2 Red Hat Bugzilla Rules Engine 2017-02-17 19:53:47 UTC
This bugzilla has been removed from the release and needs to be reviewed and Triaged for another Target Release.

Comment 7 Steven Hardy 2017-03-06 17:20:10 UTC
To clarify, the old format is still supported and works so this is a backwards compatible change, not a flag-day migration to a new format.

We'd like to eventually deprecate the old interface so we need to document moving to the new script based approach (which is better because it has an error-path when there's some problem running os-net-config, and it's also much easier to customize if you need to e.g create an os-net-config mapping file or change the options passed to the command).

I think we can therefore rephrase some of the doc-text to make clear this is an opt-in (and the reasons why to migrate to the new format)?

Comment 9 Dan Macpherson 2017-03-15 16:22:51 UTC
I think the attachment in this BZ is the old template version (it still seems to be using OS::Heat::StructuredConfig, not OS::Heat::SoftwareConfig). I had a look upstream:

https://github.com/openstack/tripleo-heat-templates/blob/master/network/config/single-nic-vlans/controller.yaml

And for my own reference, the script:

https://github.com/openstack/tripleo-heat-templates/blob/master/network/scripts/run-os-net-config.sh

This shouldn't be too difficult to document. I'll grab this BZ and use it as the docs tracker.

Comment 12 Jaromir Coufal 2017-03-30 03:30:24 UTC
Based on comments, removing blocker flag.

Comment 18 Dan Macpherson 2017-04-11 05:31:54 UTC
Thanks, Martin!