Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1399816 - [RFE][Docs][Director] Document Required Changes to NIC Config Templates
[RFE][Docs][Director] Document Required Changes to NIC Config Templates
Status: CLOSED CURRENTRELEASE
Product: Red Hat OpenStack
Classification: Red Hat
Component: documentation (Show other bugs)
11.0 (Ocata)
Unspecified Unspecified
unspecified Severity medium
: ga
: 11.0 (Ocata)
Assigned To: Dan Macpherson
Martin Lopes
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-29 14:38 EST by Dan Sneddon
Modified: 2018-08-03 14:33 EDT (History)
15 users (show)

See Also:
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 04:05:02 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Example single-NIC controller.yaml template. (5.61 KB, text/plain)
2016-11-29 14:38 EST, Dan Sneddon
no flags Details

  None (edit)
Description Dan Sneddon 2016-11-29 14:38:42 EST
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 14:53:47 EST
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 12:20:10 EST
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 12:22:51 EDT
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-29 23:30:24 EDT
Based on comments, removing blocker flag.
Comment 18 Dan Macpherson 2017-04-11 01:31:54 EDT
Thanks, Martin!

Note You need to log in before you can comment on or make changes to this bug.