Red Hat Bugzilla – Bug 1399816
[RFE][Docs][Director] Document Required Changes to NIC Config Templates
Last modified: 2018-08-03 14:33:49 EDT
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.
This bugzilla has been removed from the release and needs to be reviewed and Triaged for another Target Release.
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)?
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.
Based on comments, removing blocker flag.
Thanks, Martin!