Questo contenuto non è disponibile nella lingua selezionata.
Chapter 8. Customizing networks for the Red Hat OpenStack Platform environment
You can customizing the undercloud and overcloud physical networks for your Red Hat OpenStack Platform (RHOSP)environment.
8.1. Customizing undercloud networks Copia collegamentoCollegamento copiato negli appunti!
You can customize the undercloud network configuration to install the undercloud with specific networking functionality. You can also configure the undercloud and the provisioning network to use IPv6 instead of IPv4 if you have IPv6 nodes and infrastructure.
8.1.1. Configuring undercloud network interfaces Copia collegamentoCollegamento copiato negli appunti!
Include custom network configuration in the undercloud.conf file to install the undercloud with specific networking functionality. For example, some interfaces might not have DHCP. In this case, you must disable DHCP for these interfaces in the undercloud.conf file so that os-net-config can apply the configuration during the undercloud installation process.
Procedure
- Log in to the undercloud host.
Create a new file
undercloud-os-net-config.yamland include the network configuration that you require.In the
addressessection, include thelocal_ip, such as172.20.0.1/26. If TLS is enabled in the undercloud, you must also include theundercloud_public_host, such as172.20.0.2/32, and theundercloud_admin_host, such as172.20.0.3/32.Here is an example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To create a network bond for a specific interface, use the following sample:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Include the path to the
undercloud-os-net-config.yamlfile in thenet_config_overrideparameter in theundercloud.conffile:[DEFAULT] ... net_config_override=undercloud-os-net-config.yaml ...
[DEFAULT] ... net_config_override=undercloud-os-net-config.yaml ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteDirector uses the file that you include in the
net_config_overrideparameter as the template to generate the/etc/os-net-config/config.yamlfile.os-net-configmanages the interfaces that you define in the template, so you must perform all undercloud network interface customization in this file.- Install the undercloud.
Verification
After the undercloud installation completes successfully, verify that the
/etc/os-net-config/config.yamlfile contains the relevant configuration:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
8.1.2. Configuring the undercloud for bare metal provisioning over IPv6 Copia collegamentoCollegamento copiato negli appunti!
If you have IPv6 nodes and infrastructure, you can configure the undercloud and the provisioning network to use IPv6 instead of IPv4 so that director can provision and deploy Red Hat OpenStack Platform onto IPv6 nodes. However, there are some considerations:
- Dual stack IPv4/6 is not available.
- Tempest validations might not perform correctly.
- IPv4 to IPv6 migration is not available during upgrades.
Modify the undercloud.conf file to enable IPv6 provisioning in Red Hat OpenStack Platform.
Prerequisites
- An IPv6 address on the undercloud. For more information, see Configuring an IPv6 address on the undercloud in the IPv6 networking for the overcloud guide.
Procedure
-
Open your
undercloud.conffile. Specify the IPv6 address mode as either stateless or stateful:
[DEFAULT] ipv6_address_mode = <address_mode> ...
[DEFAULT] ipv6_address_mode = <address_mode> ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<address_mode>withdhcpv6-statelessordhcpv6-stateful, based on the mode that your NIC supports.
NoteWhen you use the stateful address mode, the firmware, chain loaders, and operating systems might use different algorithms to generate an ID that the DHCP server tracks. DHCPv6 does not track addresses by MAC, and does not provide the same address back if the identifier value from the requester changes but the MAC address remains the same. Therefore, when you use stateful DHCPv6 you must also complete the next step to configure the network interface.
-
Replace
If you configured your undercloud to use stateful DHCPv6, specify the network interface to use for bare metal nodes:
[DEFAULT] ipv6_address_mode = dhcpv6-stateful ironic_enabled_network_interfaces = neutron,flat ...
[DEFAULT] ipv6_address_mode = dhcpv6-stateful ironic_enabled_network_interfaces = neutron,flat ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the default network interface for bare metal nodes:
[DEFAULT] ... ironic_default_network_interface = neutron ...
[DEFAULT] ... ironic_default_network_interface = neutron ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow Specify whether or not the undercloud should create a router on the provisioning network:
[DEFAULT] ... enable_routed_networks: <true/false> ...
[DEFAULT] ... enable_routed_networks: <true/false> ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<true/false>withtrueto enable routed networks and prevent the undercloud creating a router on the provisioning network. Set it totrueif an external data center router is attached to the provisioning network. Whentrue`, the data center router must provide router advertisements. Also, theM`andO`flag settings of the data center router must be consistent with theipv6_address_mode`setting. -
Replace
<true/false>withfalseto disable routed networks and create a router on the provisioning network. Set it tofalseif no external data center routers are attached to the provisioning network.
-
Replace
Configure the local IP address, and the IP address for the director Admin API and Public API endpoints over SSL/TLS:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<ipv6_address>with the IPv6 address of the undercloud.
-
Replace
Optional: Configure the provisioning network that director uses to manage instances:
[ctlplane-subnet] cidr = <ipv6_address>/<ipv6_prefix> ...
[ctlplane-subnet] cidr = <ipv6_address>/<ipv6_prefix> ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<ipv6_address>with the IPv6 address of the network to use for managing instances when not using the default provisioning network. -
Replace
<ipv6_prefix>with the IP address prefix of the network to use for managing instances when not using the default provisioning network.
-
Replace
Configure the DHCP allocation range for provisioning nodes:
[ctlplane-subnet] cidr = <ipv6_address>/<ipv6_prefix> dhcp_start = <ipv6_address_dhcp_start> dhcp_end = <ipv6_address_dhcp_end> ...
[ctlplane-subnet] cidr = <ipv6_address>/<ipv6_prefix> dhcp_start = <ipv6_address_dhcp_start> dhcp_end = <ipv6_address_dhcp_end> ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<ipv6_address_dhcp_start>with the IPv6 address of the start of the network range to use for the overcloud nodes. -
Replace
<ipv6_address_dhcp_end>with the IPv6 address of the end of the network range to use for the overcloud nodes.
-
Replace
Optional: Configure the gateway for forwarding traffic to the external network:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<ipv6_gateway_address>with the IPv6 address of the gateway when not using the default gateway.
-
Replace
Configure the DHCP range to use during the inspection process:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<ipv6_address_inspection_start>with the IPv6 address of the start of the network range to use during the inspection process. -
Replace
<ipv6_address_inspection_end>with the IPv6 address of the end of the network range to use during the inspection process.
NoteThis range must not overlap with the range defined by
dhcp_startanddhcp_end, but must be in the same IP subnet.-
Replace
Configure an IPv6 nameserver for the subnet:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<ipv6_dns>with the DNS nameservers specific to the subnet.
-
Replace
-
Use the
virt-customizetool to modify the overcloud image to disable thecloud-initnetwork configuration. For more information, see the Red Hat Knowledgebase solution Modifying the Red Hat Linux OpenStack Platform Overcloud Image with virt-customize.
8.2. Customizing overcloud networks Copia collegamentoCollegamento copiato negli appunti!
You can customize the configuration of the physical network for your overcloud. For example, you can create configuration files for the network interface controllers (NICs) by using the NIC template file in Jinja2 ansible format, j2.
8.2.1. Defining custom network interface templates Copia collegamentoCollegamento copiato negli appunti!
You can create a set of custom network interface templates to define the NIC layout for each node in your overcloud environment. The overcloud core template collection contains a set of default NIC layouts for different use cases. You can create a custom NIC template by using a Jinja2 format file with a .j2.yaml extension. Director converts the Jinja2 files to YAML format during deployment.
You can then set the network_config property in the overcloud-baremetal-deploy.yaml node definition file to your custom NIC template to provision the networks for a specific node. For more information, see Provisioning bare metal nodes for the overcloud.
8.2.1.1. Creating a custom NIC template Copia collegamentoCollegamento copiato negli appunti!
Create a NIC template to customise the NIC layout for each node in your overcloud environment.
Procedure
Copy the sample network configuration template you require from
/usr/share/ansible/roles/tripleo_network_config/templates/to your environment file directory:cp /usr/share/ansible/roles/tripleo_network_config/templates/<sample_NIC_template> /home/stack/templates/<NIC_template>
$ cp /usr/share/ansible/roles/tripleo_network_config/templates/<sample_NIC_template> /home/stack/templates/<NIC_template>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<sample_NIC_template>with the name of the sample NIC template that you want to copy, for example,single_nic_vlans/single_nic_vlans.j2. -
Replace
<NIC_template>with the name of your custom NIC template file, for example,single_nic_vlans.j2.
-
Replace
- Update the network configuration in your custom NIC template to match the requirements for your overcloud network environment. For information about the properties you can use to configure your NIC template, see Network interface configuration options. For an example NIC template, see Example custom network interfaces.
Create or update an existing environment file to enable your custom NIC configuration templates:
parameter_defaults: ControllerNetworkConfigTemplate: '/home/stack/templates/single_nic_vlans.j2' CephStorageNetworkConfigTemplate: '/home/stack/templates/single_nic_vlans_storage.j2' ComputeNetworkConfigTemplate: '/home/stack/templates/single_nic_vlans.j2'
parameter_defaults: ControllerNetworkConfigTemplate: '/home/stack/templates/single_nic_vlans.j2' CephStorageNetworkConfigTemplate: '/home/stack/templates/single_nic_vlans_storage.j2' ComputeNetworkConfigTemplate: '/home/stack/templates/single_nic_vlans.j2'Copy to Clipboard Copied! Toggle word wrap Toggle overflow If your overcloud uses the default internal load balancing, add the following configuration to your environment file to assign predictable virtual IPs for Redis and OVNDBs:
parameter_defaults: RedisVirtualFixedIPs: [{'ip_address':'<vip_address>'}] OVNDBsVirtualFixedIPs: [{'ip_address':'<vip_address>'}]parameter_defaults: RedisVirtualFixedIPs: [{'ip_address':'<vip_address>'}] OVNDBsVirtualFixedIPs: [{'ip_address':'<vip_address>'}]Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<vip_address>with an IP address from outside the allocation pool ranges.
-
Replace
8.2.1.2. Network interface configuration options Copia collegamentoCollegamento copiato negli appunti!
Use the following tables to understand the available options for configuring network interfaces.
interface
Defines a single network interface. The network interface name uses either the actual interface name (eth0, eth1, enp0s25) or a set of numbered interfaces (nic1, nic2, nic3). The network interfaces of hosts within a role do not have to be exactly the same when you use numbered interfaces such as nic1 and nic2, instead of named interfaces such as eth0 and eno2. For example, one host might have interfaces em1 and em2, while another has eno1 and eno2, but you can refer to the NICs of both hosts as nic1 and nic2.
The order of numbered interfaces corresponds to the order of named network interface types:
-
ethXinterfaces, such aseth0,eth1, etc. These are usually onboard interfaces. -
enoXinterfaces, such aseno0,eno1, etc. These are usually onboard interfaces. -
enXinterfaces, sorted alpha numerically, such asenp3s0,enp3s1,ens3, etc. These are usually add-on interfaces.
The numbered NIC scheme includes only live interfaces, for example, if the interfaces have a cable attached to the switch. If you have some hosts with four interfaces and some with six interfaces, use nic1 to nic4 and attach only four cables on each host.
- type: interface
name: nic2
- type: interface
name: nic2
| Option | Default | Description |
|---|---|---|
|
|
Name of the interface. The network interface | |
|
| False | Use DHCP to get an IP address. |
|
| False | Use DHCP to get a v6 IP address. |
|
| A list of IP addresses assigned to the interface. | |
|
| A list of routes assigned to the interface. For more information, see routes. | |
|
| 1500 | The maximum transmission unit (MTU) of the connection. |
|
| False | Defines the interface as the primary interface. |
|
| False | Write the device alias configuration instead of the system names. |
|
| None | Arguments that you want to pass to the DHCP client. |
|
| None | List of DNS servers that you want to use for the interface. |
|
|
Set this option to |
vlan
Defines a VLAN. Use the VLAN ID and subnet passed from the parameters section.
For example:
| Option | Default | Description |
|---|---|---|
| vlan_id | The VLAN ID. | |
| device | The parent device to attach the VLAN. Use this parameter when the VLAN is not a member of an OVS bridge. For example, use this parameter to attach the VLAN to a bonded interface device. | |
| use_dhcp | False | Use DHCP to get an IP address. |
| use_dhcpv6 | False | Use DHCP to get a v6 IP address. |
| addresses | A list of IP addresses assigned to the VLAN. | |
| routes | A list of routes assigned to the VLAN. For more information, see routes. | |
| mtu | 1500 | The maximum transmission unit (MTU) of the connection. |
| primary | False | Defines the VLAN as the primary interface. |
| persist_mapping | False | Write the device alias configuration instead of the system names. |
| dhclient_args | None | Arguments that you want to pass to the DHCP client. |
| dns_servers | None | List of DNS servers that you want to use for the VLAN. |
ovs_bond
Defines a bond in Open vSwitch to join two or more interfaces together. This helps with redundancy and increases bandwidth.
For example:
| Option | Default | Description |
|---|---|---|
| name | Name of the bond. | |
| use_dhcp | False | Use DHCP to get an IP address. |
| use_dhcpv6 | False | Use DHCP to get a v6 IP address. |
| addresses | A list of IP addresses assigned to the bond. | |
| routes | A list of routes assigned to the bond. For more information, see routes. | |
| mtu | 1500 | The maximum transmission unit (MTU) of the connection. |
| primary | False | Defines the interface as the primary interface. |
| members | A sequence of interface objects that you want to use in the bond. | |
| ovs_options | A set of options to pass to OVS when creating the bond. | |
| ovs_extra | A set of options to set as the OVS_EXTRA parameter in the network configuration file of the bond. | |
| defroute | True |
Use a default route provided by the DHCP service. Only applies when you enable |
| persist_mapping | False | Write the device alias configuration instead of the system names. |
| dhclient_args | None | Arguments that you want to pass to the DHCP client. |
| dns_servers | None | List of DNS servers that you want to use for the bond. |
ovs_bridge
Defines a bridge in Open vSwitch, which connects multiple interface, ovs_bond, and vlan objects together.
The network interface type, ovs_bridge, takes a parameter name.
If you have multiple bridges, you must use distinct bridge names other than accepting the default name of bridge_name. If you do not use distinct names, then during the converge phase, two network bonds are placed on the same bridge.
If you are defining an OVS bridge for the external tripleo network, then retain the values bridge_name and interface_name as your deployment framework automatically replaces these values with an external bridge name and an external interface name, respectively.
For example:
The OVS bridge connects to the Networking service (neutron) server to obtain configuration data. If the OpenStack control traffic, typically the Control Plane and Internal API networks, is placed on an OVS bridge, then connectivity to the neutron server is lost whenever you upgrade OVS, or the OVS bridge is restarted by the admin user or process. This causes some downtime. If downtime is not acceptable in these circumstances, then you must place the Control group networks on a separate interface or bond rather than on an OVS bridge:
- You can achieve a minimal setting when you put the Internal API network on a VLAN on the provisioning interface and the OVS bridge on a second interface.
- To implement bonding, you need at least two bonds (four network interfaces). Place the control group on a Linux bond (Linux bridge). If the switch does not support LACP fallback to a single interface for PXE boot, then this solution requires at least five NICs.
| Option | Default | Description |
|---|---|---|
| name | Name of the bridge. | |
| use_dhcp | False | Use DHCP to get an IP address. |
| use_dhcpv6 | False | Use DHCP to get a v6 IP address. |
| addresses | A list of IP addresses assigned to the bridge. | |
| routes | A list of routes assigned to the bridge. For more information, see routes. | |
| mtu | 1500 | The maximum transmission unit (MTU) of the connection. |
| members | A sequence of interface, VLAN, and bond objects that you want to use in the bridge. | |
| ovs_options | A set of options to pass to OVS when creating the bridge. | |
| ovs_extra | A set of options to to set as the OVS_EXTRA parameter in the network configuration file of the bridge. | |
| defroute | True |
Use a default route provided by the DHCP service. Only applies when you enable |
| persist_mapping | False | Write the device alias configuration instead of the system names. |
| dhclient_args | None | Arguments that you want to pass to the DHCP client. |
| dns_servers | None | List of DNS servers that you want to use for the bridge. |
linux_bond
Defines a Linux bond that joins two or more interfaces together. This helps with redundancy and increases bandwidth. Ensure that you include the kernel-based bonding options in the bonding_options parameter.
For example:
| Option | Default | Description |
|---|---|---|
| name | Name of the bond. | |
| use_dhcp | False | Use DHCP to get an IP address. |
| use_dhcpv6 | False | Use DHCP to get a v6 IP address. |
| addresses | A list of IP addresses assigned to the bond. | |
| routes | A list of routes assigned to the bond. See routes. | |
| mtu | 1500 | The maximum transmission unit (MTU) of the connection. |
| primary | False | Defines the interface as the primary interface. |
| members | A sequence of interface objects that you want to use in the bond. | |
| bonding_options | A set of options when creating the bond. | |
| defroute | True |
Use a default route provided by the DHCP service. Only applies when you enable |
| persist_mapping | False | Write the device alias configuration instead of the system names. |
| dhclient_args | None | Arguments that you want to pass to the DHCP client. |
| dns_servers | None | List of DNS servers that you want to use for the bond. |
linux_bridge
Defines a Linux bridge, which connects multiple interface, linux_bond, and vlan objects together. The external bridge also uses two special values for parameters:
-
bridge_name, which is replaced with the external bridge name. -
interface_name, which is replaced with the external interface.
For example:
| Option | Default | Description |
|---|---|---|
| name | Name of the bridge. | |
| use_dhcp | False | Use DHCP to get an IP address. |
| use_dhcpv6 | False | Use DHCP to get a v6 IP address. |
| addresses | A list of IP addresses assigned to the bridge. | |
| routes | A list of routes assigned to the bridge. For more information, see routes. | |
| mtu | 1500 | The maximum transmission unit (MTU) of the connection. |
| members | A sequence of interface, VLAN, and bond objects that you want to use in the bridge. | |
| defroute | True |
Use a default route provided by the DHCP service. Only applies when you enable |
| persist_mapping | False | Write the device alias configuration instead of the system names. |
| dhclient_args | None | Arguments that you want to pass to the DHCP client. |
| dns_servers | None | List of DNS servers that you want to use for the bridge. |
routes
Defines a list of routes to apply to a network interface, VLAN, bridge, or bond.
For example:
- type: linux_bridge
name: bridge_name
...
routes: {{ [ctlplane_host_routes] | flatten | unique }}
- type: linux_bridge
name: bridge_name
...
routes: {{ [ctlplane_host_routes] | flatten | unique }}
| Option | Default | Description |
|---|---|---|
| ip_netmask | None | IP and netmask of the destination network. |
| default | False |
Sets this route to a default route. Equivalent to setting |
| next_hop | None | The IP address of the router used to reach the destination network. |
8.2.1.3. Example custom network interfaces Copia collegamentoCollegamento copiato negli appunti!
The following examples illustrate how to customize network interface templates.
Separate control group and OVS bridge example
The following example Controller node NIC template configures the control group separate from the OVS bridge. The template uses five network interfaces and assigns a number of tagged VLAN devices to the numbered interfaces. The template creates the OVS bridges on nic4 and nic5.
Multiple NICs example
The following example uses a second NIC to connect to an infrastructure network with DHCP addresses and another NIC for the bond.
8.2.1.4. Customizing NIC mappings for pre-provisioned nodes Copia collegamentoCollegamento copiato negli appunti!
If you are using pre-provisioned nodes, you can specify the os-net-config mappings for specific nodes by using one of the following methods:
-
Configure the
NetConfigDataLookupheat parameter in an environment file, and run theopenstack overcloud node provisioncommand without--network-config. -
Configure the
net_config_data_lookupproperty in your node definition file,overcloud-baremetal-deploy.yaml, and run theopenstack overcloud node provisioncommand with--network-config.
If you are not using pre-provisioned nodes, you must configure the NIC mappings in your node definition file. For more information on configuring the net_config_data_lookup property, see Bare-metal node provisioning attributes.
You can assign aliases to the physical interfaces on each node to pre-determine which physical NIC maps to specific aliases, such as nic1 or nic2, and you can map a MAC address to a specified alias. You can map specific nodes by using the MAC address or DMI keyword, or you can map a group of nodes by using a DMI keyword. The following examples configure three nodes and two node groups with aliases to the physical interfaces. The resulting configuration is applied by os-net-config. On each node, you can see the applied configuration in the interface_mapping section of the /etc/os-net-config/mapping.yaml file.
Example 1: Configuring the NetConfigDataLookup parameter in os-net-config-mappings.yaml
- 1
- Maps
node1to the specified MAC address, and assignsnic1as the alias for the MAC address on this node. - 2
- Maps
node3to the node with the system UUID "A8C85861-1B16-4803-8689-AFC62984F8F6", and assignsnic1as the alias forem3interface on this node. - 3
- The
dmiStringparameter must be set to a valid string keyword. For a list of the valid string keywords, see the DMIDECODE(8) man page. - 4
- Maps all the nodes in
nodegroup1to nodes with the product name "PowerEdge R630", and assignsnic1,nic2, andnic3as the alias for the named interfaces on these nodes.
Normally, os-net-config registers only the interfaces that are already connected in an UP state. However, if you hardcode interfaces with a custom mapping file, the interface is registered even if it is in a DOWN state.
Example 2: Configuring the net_config_data_lookup property in overcloud-baremetal-deploy.yaml - specific nodes
Example 3: Configuring the net_config_data_lookup property in overcloud-baremetal-deploy.yaml - all nodes for a role
8.2.2. Composable networks Copia collegamentoCollegamento copiato negli appunti!
You can create custom composable networks if you want to host specific network traffic on different networks. Director provides a default network topology with network isolation enabled. You can find this configuration in the /usr/share/openstack-tripleo-heat-templates/network-data-samples/default-network-isolation.yaml.
The overcloud uses the following pre-defined set of network segments by default:
- Internal API
- Storage
- Storage management
- Tenant
- External
You can use composable networks to add networks for various services. For example, if you have a network that is dedicated to NFS traffic, you can present it to multiple roles.
Director supports the creation of custom networks during the deployment and update phases. You can use these additional networks for bare metal nodes, system management, or to create separate networks for different roles. You can also use them to create multiple sets of networks for split deployments where traffic is routed between networks.
8.2.2.1. Adding a composable network Copia collegamentoCollegamento copiato negli appunti!
Use composable networks to add networks for various services. For example, if you have a network that is dedicated to storage backup traffic, you can present the network to multiple roles.
Procedure
List the available sample network configuration files:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the sample network configuration file you require from
/usr/share/openstack-tripleo-heat-templates/network-data-samplesto your environment file directory:cp /usr/share/openstack-tripleo-heat-templates/network-data-samples/default-network-isolation.yaml /home/stack/templates/network_data.yaml
$ cp /usr/share/openstack-tripleo-heat-templates/network-data-samples/default-network-isolation.yaml /home/stack/templates/network_data.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Edit your
network_data.yamlconfiguration file and add a section for your new network:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure any other network attributes for your environment. For more information about the properties you can use to configure network attributes, see Network definition file configuration options.
If you are deploying Red Hat Ceph Storage and using NFS, ensure that you include an isolated StorageNFS network. The following example is present in these files:
-
/usr/share/openstack-tripleo-heat-templates/network-data-samples/ganesha.yaml /usr/share/openstack-tripleo-heat-templates/network-data-samples/ganesha-ipv6.yamlCustomize these network settings, including the VLAN ID and the subnet ranges. If IPv4 or IPv6 is not necessary, you can omit the corresponding subnet:
Example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - This network will be shared by the overcloud deployment and a Networking service (neutron) provider network that is set up post-overcloud deployment for consumers like the Compute service (nova) VMs to use to mount shares.
- Leave a sizable range outside the allocation pool specified in this example for use in the allocation pool for the subnet definition of the overcloud Networking service StorageNFS provider network.
-
When you add an extra composable network that contains a virtual IP, and want to map some API services to this network, use the
CloudName{network.name}definition to set the DNS name for the API endpoint:CloudName{{network.name}}CloudName{{network.name}}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example:
parameter_defaults: ... CloudNameOcProvisioning: baremetal-vip.example.com
parameter_defaults: ... CloudNameOcProvisioning: baremetal-vip.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the sample network VIP definition template you require from
/usr/share/openstack-tripleo-heat-templates/network-data-samplesto your environment file directory. The following example copies thevip-data-default-network-isolation.yamlto a local environment file namedvip_data.yaml:cp /usr/share/openstack-tripleo-heat-templates/network-data-samples/vip-data-default-network-isolation.yaml /home/stack/templates/vip_data.yaml
$ cp /usr/share/openstack-tripleo-heat-templates/network-data-samples/vip-data-default-network-isolation.yaml /home/stack/templates/vip_data.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Edit your
vip_data.yamlconfiguration file. The virtual IP data is a list of virtual IP address definitions, each containing the name of the network where the IP address is allocated:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<vip_address>with the required virtual IP address.
For more information about the properties you can use to configure network VIP attributes in your VIP definition file, see Network VIP attribute properties.
-
Replace
Copy a sample network configuration template. Jinja2 templates are used to define NIC configuration templates. Browse the examples provided in the
/usr/share/ansible/roles/tripleo_network_config/templates/directory, if one of the examples matches your requirements, use it. If the examples do not match your requirements, copy a sample configuration file, and modify it for your needs:cp /usr/share/ansible/roles/tripleo_network_config/templates/single_nic_vlans/single_nic_vlans.j2 /home/stack/templates/
$ cp /usr/share/ansible/roles/tripleo_network_config/templates/single_nic_vlans/single_nic_vlans.j2 /home/stack/templates/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit your
single_nic_vlans.j2configuration file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
network_configtemplate in theovercloud-baremetal-deploy.yamlconfiguration file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you are provisioning a StorageNFS network for using a CephFS-NFS back end with the Shared File Systems service (manila), edit the
ControllerorControllerStorageNfssections instead of thenetwork_configsection because the StorageNFS network and its VIP are connected to the Controller nodes:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Provision the overcloud networks. This action generates an output file which will be used an an environment file when deploying the overcloud:
openstack overcloud network provision \ --output <deployment_file> /home/stack/templates/<networks_definition_file>.yaml
(undercloud)$ openstack overcloud network provision \ --output <deployment_file> /home/stack/templates/<networks_definition_file>.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<networks_definition_file>with the name of your networks definition file, for example,network_data.yamlor the name of your StorageNFS network file, for example,network_data_ganesha.yaml. -
Replace
<deployment_file>with the name of the heat environment file to generate for inclusion in the deployment command, for example/home/stack/templates/overcloud-networks-deployed.yaml.
-
Replace
Provision the network VIPs and generate the
vip-deployed-environment.yamlfile. You use this file when you deploy the overcloud:openstack overcloud network vip provision --stack <stack> --output <deployment_file> /home/stack/templates/vip_data.yaml
(overcloud)$ openstack overcloud network vip provision --stack <stack> --output <deployment_file> /home/stack/templates/vip_data.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<stack>with the name of the stack for which the network VIPs are provisioned. If not specified, the default is overcloud. -
Replace
<deployment_file>with the name of the heat environment file to generate for inclusion in the deployment command, for example/home/stack/templates/overcloud-vip-deployed.yaml.
-
Replace
8.2.2.2. Including a composable network in a role Copia collegamentoCollegamento copiato negli appunti!
You can assign composable networks to the overcloud roles defined in your environment. For example, you might include a custom StorageBackup network with your Ceph Storage nodes, or you might include a custom StorageNFS network for using CephFS-NFS with the Shared File Systems service (manila). If you used the ControllerStorageNfs role that is included by default in director, then a StorageNFS network is already added for you.
Procedure
If you do not already have a custom
roles_data.yamlfile, copy the default to your home directory:cp /usr/share/openstack-tripleo-heat-templates/roles_data.yaml /home/stack/templates/roles_data.yaml
$ cp /usr/share/openstack-tripleo-heat-templates/roles_data.yaml /home/stack/templates/roles_data.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Edit the custom
roles_data.yamlfile. Include the network name in the
networkslist for the role that you want to add the network to.In this example, you add the
StorageBackupnetwork to the Ceph Storage role:Copy to Clipboard Copied! Toggle word wrap Toggle overflow In this example, you add the
StorageNFSnetwork to the Controller node:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- After you add custom networks to their respective roles, save the file.
When you run the openstack overcloud deploy command, include the custom roles_data.yaml file using the -r option. Without the -r option, the deployment command uses the default set of roles with their respective assigned networks.
8.2.2.3. Assigning OpenStack services to composable networks Copia collegamentoCollegamento copiato negli appunti!
Each OpenStack service is assigned to a default network type in the resource registry. These services are bound to IP addresses within the network type’s assigned network. Although the OpenStack services are divided among these networks, the number of actual physical networks can differ as defined in the network environment file. You can reassign OpenStack services to different network types by defining a new network map in an environment file, for example, /home/stack/templates/service-reassignments.yaml. The ServiceNetMap parameter determines the network types that you want to use for each service.
For example, you can reassign the Storage Management network services to the Storage Backup Network by modifying the highlighted sections:
parameter_defaults:
ServiceNetMap:
SwiftStorageNetwork: storage_backup
CephClusterNetwork: storage_backup
parameter_defaults:
ServiceNetMap:
SwiftStorageNetwork: storage_backup
CephClusterNetwork: storage_backup
Changing these parameters to storage_backup places these services on the Storage Backup network instead of the Storage Management network. This means that you must define a set of parameter_defaults only for the Storage Backup network and not the Storage Management network.
Director merges your custom ServiceNetMap parameter definitions into a pre-defined list of defaults that it obtains from ServiceNetMapDefaults and overrides the defaults. Director returns the full list, including customizations, to ServiceNetMap, which is used to configure network assignments for various services. For example, GaneshaNetwork is the default service network for the NFS Gateway for CephFS-NFS. This network defaults to storage_nfs while falling back to external or ctlplane networks. If you are using a different network instead of the default isolated StorageNFS network, you must update the default network by using a ServiceNetMap parameter definition.
Example:
parameter_defaults:
ServiceNetMap:
GaneshaNetwork: <manila_nfs_network>
parameter_defaults:
ServiceNetMap:
GaneshaNetwork: <manila_nfs_network>
-
Replace
<manila_nfs_network>with the name of your custom network.
Service mappings apply to networks that use vip: true in the network_data.yaml file for nodes that use Pacemaker. The overcloud load balancer redirects traffic from the VIPs to the specific service endpoints.
You can find a full list of default services in the ServiceNetMapDefaults parameter in the /usr/share/openstack-tripleo-heat-templates/network/service_net_map.j2.yaml file.
8.2.2.4. Enabling custom composable networks Copia collegamentoCollegamento copiato negli appunti!
Use one of the default NIC templates to enable custom composable networks. In this example, use the Single NIC with VLANs template, (custom_single_nic_vlans).
Procedure
Source the
stackrcundercloud credentials file:source ~/stackrc
$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow Provision the overcloud networks:
openstack overcloud network provision \ --output overcloud-networks-deployed.yaml \ custom_network_data.yaml
$ openstack overcloud network provision \ --output overcloud-networks-deployed.yaml \ custom_network_data.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Provision the network VIPs:
openstack overcloud network vip provision \ --stack overcloud \ --output overcloud-networks-vips-deployed.yaml \ custom_vip_data.yaml$ openstack overcloud network vip provision \ --stack overcloud \ --output overcloud-networks-vips-deployed.yaml \ custom_vip_data.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Provision the overcloud nodes:
openstack overcloud node provision \ --stack overcloud \ --output overcloud-baremetal-deployed.yaml \ overcloud-baremetal-deploy.yaml$ openstack overcloud node provision \ --stack overcloud \ --output overcloud-baremetal-deployed.yaml \ overcloud-baremetal-deploy.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Construct your
openstack overcloud deploycommand, specifying the configuration files and templates in the required order, for example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
This example command deploys the composable networks, including your additional custom networks, across nodes in your overcloud.
8.2.2.5. Renaming the default networks Copia collegamentoCollegamento copiato negli appunti!
You can use the network_data.yaml file to modify the user-visible names of the default networks:
- InternalApi
- External
- Storage
- StorageMgmt
- Tenant
To change these names, do not modify the name field. Instead, change the name_lower field to the new name for the network and update the ServiceNetMap with the new name.
Procedure
In your
network_data.yamlfile, enter new names in thename_lowerparameter for each network that you want to rename:- name: InternalApi name_lower: MyCustomInternalApi
- name: InternalApi name_lower: MyCustomInternalApiCopy to Clipboard Copied! Toggle word wrap Toggle overflow Include the default value of the
name_lowerparameter in theservice_net_map_replaceparameter:- name: InternalApi name_lower: MyCustomInternalApi service_net_map_replace: internal_api
- name: InternalApi name_lower: MyCustomInternalApi service_net_map_replace: internal_apiCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.2.3. Additional overcloud network configuration Copia collegamentoCollegamento copiato negli appunti!
This chapter follows on from the concepts and procedures outlined in Section 8.2.1, “Defining custom network interface templates” and provides some additional information to help configure parts of your overcloud network.
8.2.3.1. Configuring routes and default routes Copia collegamentoCollegamento copiato negli appunti!
You can set the default route of a host in one of two ways. If the interface uses DHCP and the DHCP server offers a gateway address, the system uses a default route for that gateway. Otherwise, you can set a default route on an interface with a static IP.
Although the Linux kernel supports multiple default gateways, it uses only the gateway with the lowest metric. If there are multiple DHCP interfaces, this can result in an unpredictable default gateway. In this case, it is recommended to set defroute: false for interfaces other than the interface that uses the default route.
For example, you might want a DHCP interface (nic3) to be the default route. Use the following YAML snippet to disable the default route on another DHCP interface (nic2):
The defroute parameter applies only to routes obtained through DHCP.
To set a static route on an interface with a static IP, specify a route to the subnet. For example, you can set a route to the 10.1.2.0/24 subnet through the gateway at 172.17.0.1 on the Internal API network:
8.2.3.2. Configuring policy-based routing Copia collegamentoCollegamento copiato negli appunti!
To configure unlimited access from different networks on Controller nodes, configure policy-based routing. Policy-based routing uses route tables where, on a host with multiple interfaces, you can send traffic through a particular interface depending on the source address. You can route packets that come from different sources to different networks, even if the destinations are the same.
For example, you can configure a route to send traffic to the Internal API network, based on the source address of the packet, even when the default route is for the External network. You can also define specific route rules for each interface.
Red Hat OpenStack Platform uses the os-net-config tool to configure network properties for your overcloud nodes. The os-net-config tool manages the following network routing on Controller nodes:
-
Routing tables in the
/etc/iproute2/rt_tablesfile -
IPv4 rules in the
/etc/sysconfig/network-scripts/rule-{ifname}file -
IPv6 rules in the
/etc/sysconfig/network-scripts/rule6-{ifname}file -
Routing table specific routes in the
/etc/sysconfig/network-scripts/route-{ifname}
Prerequisites
- You have installed the undercloud successfully. For more information, see Installing director on the undercloud in the Installing and managing Red Hat OpenStack Platform with director guide.
Procedure
Create the
interfaceentries in a custom NIC template from the/home/stack/templates/custom-nicsdirectory, define a route for the interface, and define rules that are relevant to your deployment:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Include your custom NIC configuration and network environment files in the deployment command, along with any other environment files relevant to your deployment:
openstack overcloud deploy --templates \ -e /home/stack/templates/<custom-nic-template>
$ openstack overcloud deploy --templates \ -e /home/stack/templates/<custom-nic-template> -e <OTHER_ENVIRONMENT_FILES>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Enter the following commands on a Controller node to verify that the routing configuration is functioning correctly:
cat /etc/iproute2/rt_tables $ ip route $ ip rule
$ cat /etc/iproute2/rt_tables $ ip route $ ip ruleCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.2.3.3. Configuring jumbo frames Copia collegamentoCollegamento copiato negli appunti!
The Maximum Transmission Unit (MTU) setting determines the maximum amount of data transmitted with a single Ethernet frame. Using a larger value results in less overhead because each frame adds data in the form of a header. The default value is 1500 and using a higher value requires the configuration of the switch port to support jumbo frames. Most switches support an MTU of at least 9000, but many are configured for 1500 by default.
The MTU of a VLAN cannot exceed the MTU of the physical interface. Ensure that you include the MTU value on the bond or interface.
The Storage, Storage Management, Internal API, and Tenant networks can all benefit from jumbo frames.
You can alter the value of the mtu in the jinja2 template or in the network_data.yaml file. If you set the value in the network_data.yaml file it is rendered during deployment.
Routers typically cannot forward jumbo frames across Layer 3 boundaries. To avoid connectivity issues, do not change the default MTU for the Provisioning interface, External interface, and any Floating IP interfaces.
8.2.3.4. Configuring the native VLAN on a trunked interface Copia collegamentoCollegamento copiato negli appunti!
If a trunked interface or bond has a network on the native VLAN, the IP addresses are assigned directly to the bridge and there is no VLAN interface.
The following example configures a bonded interface where the External network is on the native VLAN:
When you move the address or route statements onto the bridge, remove the corresponding VLAN interface from the bridge. Make the changes to all applicable roles. The External network is only on the controllers, so only the controller template requires a change. The Storage network is attached to all roles, so if the Storage network is on the default VLAN, all roles require modifications.
8.2.3.5. Increasing the maximum number of connections that netfilter tracks Copia collegamentoCollegamento copiato negli appunti!
The Red Hat OpenStack Platform (RHOSP) Networking service (neutron) uses netfilter connection tracking to build stateful firewalls and to provide network address translation (NAT) on virtual networks. There are some situations that can cause the kernel space to reach the maximum connection limit and result in errors such as nf_conntrack: table full, dropping packet. You can increase the limit for connection tracking (conntrack) and avoid these types of errors. You can increase the conntrack limit for one or more roles, or across all the nodes, in your RHOSP deployment.
Prerequisites
- A successful RHOSP undercloud installation.
Procedure
-
Log in to the undercloud host as the
stackuser. Source the undercloud credentials file:
source ~/stackrc
$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a custom YAML environment file.
Example
vi /home/stack/templates/custom-environment.yaml
$ vi /home/stack/templates/custom-environment.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Your environment file must contain the keywords
parameter_defaultsandExtraSysctlSettings. Enter a new value for the maximum number of connections that netfilter can track in the variable,net.nf_conntrack_max.Example
In this example, you can set the conntrack limit across all hosts in your RHOSP deployment:
parameter_defaults: ExtraSysctlSettings: net.nf_conntrack_max: value: 500000parameter_defaults: ExtraSysctlSettings: net.nf_conntrack_max: value: 500000Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
<role>Parameterparameter to set the conntrack limit for a specific role:parameter_defaults: <role>Parameters: ExtraSysctlSettings: net.nf_conntrack_max: value: <simultaneous_connections>parameter_defaults: <role>Parameters: ExtraSysctlSettings: net.nf_conntrack_max: value: <simultaneous_connections>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<role>with the name of the role.For example, use
ControllerParametersto set the conntrack limit for the Controller role, orComputeParametersto set the conntrack limit for the Compute role.Replace
<simultaneous_connections>with the quantity of simultaneous connections that you want to allow.Example
In this example, you can set the conntrack limit for only the Controller role in your RHOSP deployment:
parameter_defaults: ControllerParameters: ExtraSysctlSettings: net.nf_conntrack_max: value: 500000parameter_defaults: ControllerParameters: ExtraSysctlSettings: net.nf_conntrack_max: value: 500000Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe default value for
net.nf_conntrack_maxis500000connections. The maximum value is:4294967295.
Run the deployment command and include the core heat templates, environment files, and this new custom environment file.
ImportantThe order of the environment files is important as the parameters and resources defined in subsequent environment files take precedence.
Example
openstack overcloud deploy --templates \ -e /home/stack/templates/custom-environment.yaml
$ openstack overcloud deploy --templates \ -e /home/stack/templates/custom-environment.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.2.4. Network interface bonding Copia collegamentoCollegamento copiato negli appunti!
You can use various bonding options in your custom network configuration.
8.2.4.1. Network interface bonding for overcloud nodes Copia collegamentoCollegamento copiato negli appunti!
You can bundle multiple physical NICs together to form a single logical channel known as a bond. You can configure bonds to provide redundancy for high availability systems or increased throughput.
Red Hat OpenStack Platform supports Open vSwitch (OVS) kernel bonds, OVS-DPDK bonds, and Linux kernel bonds.
| Bond type | Type value | Allowed bridge types | Allowed members |
|---|---|---|---|
| OVS kernel bonds |
|
|
|
| OVS-DPDK bonds |
|
|
|
| Linux kernel bonds |
|
|
|
Do not combine ovs_bridge and ovs_user_bridge on the same node.
8.2.4.2. Creating Open vSwitch (OVS) bonds Copia collegamentoCollegamento copiato negli appunti!
You create OVS bonds in your network interface templates. For example, you can create a bond as part of an OVS user space bridge:
In this example, you create the bond from two DPDK ports.
The ovs_options parameter contains the bonding options. You can configure a bonding options in a network environment file with the BondInterfaceOvsOptions parameter:
parameter_defaults: BondInterfaceOvsOptions: "bond_mode=active-backup"
parameter_defaults:
BondInterfaceOvsOptions: "bond_mode=active-backup"
8.2.4.3. Open vSwitch (OVS) bonding options Copia collegamentoCollegamento copiato negli appunti!
You can set various Open vSwitch (OVS) bonding options with the ovs_options heat parameter in your NIC template files. The active-backup, balance-tlb, balance-alb and balance-slb modes do not require any specific configuration of the switch.
bond_mode=balance-slb-
Source load balancing (slb) balances flows based on source MAC address and output VLAN, with periodic rebalancing as traffic patterns change. When you configure a bond with the
balance-slbbonding option, there is no configuration required on the remote switch. The Networking service (neutron) assigns each source MAC and VLAN pair to a link and transmits all packets from that MAC and VLAN through that link. A simple hashing algorithm based on source MAC address and VLAN number is used, with periodic rebalancing as traffic patterns change. Thebalance-slbmode is similar to mode 2 bonds used by the Linux bonding driver, although unlike mode 2,balance-slbdoes not require any specific configuration of the swtich. You can use thebalance-slbmode to provide load balancing even when the switch is not configured to use LACP. bond_mode=active-backup-
When you configure a bond using
active-backupbond mode, the Networking service keeps one NIC in standby. The standby NIC resumes network operations when the active connection fails. Only one MAC address is presented to the physical switch. This mode does not require switch configuration, and works when the links are connected to separate switches. This mode does not provide load balancing. lacp=[active | passive | off]-
Controls the Link Aggregation Control Protocol (LACP) behavior. Only certain switches support LACP. If your switch does not support LACP, use
bond_mode=balance-slborbond_mode=active-backup. other-config:lacp-fallback-ab=true- Set active-backup as the bond mode if LACP fails.
other_config:lacp-time=[fast | slow]- Set the LACP heartbeat to one second (fast) or 30 seconds (slow). The default is slow.
other_config:bond-detect-mode=[miimon | carrier]- Set the link detection to use miimon heartbeats (miimon) or monitor carrier (carrier). The default is carrier.
other_config:bond-miimon-interval=100- If using miimon, set the heartbeat interval (milliseconds).
bond_updelay=1000- Set the interval (milliseconds) that a link must be up to be activated to prevent flapping.
other_config:bond-rebalance-interval=10000- Set the interval (milliseconds) that flows are rebalancing between bond members. Set this value to zero to disable flow rebalancing between bond members.
8.2.4.4. Using Link Aggregation Control Protocol (LACP) with Open vSwitch (OVS) bonding modes Copia collegamentoCollegamento copiato negli appunti!
You can use bonds with the optional Link Aggregation Control Protocol (LACP). LACP is a negotiation protocol that creates a dynamic bond for load balancing and fault tolerance.
Use the following table to understand support compatibility for OVS kernel and OVS-DPDK bonded interfaces in conjunction with LACP options.
On control and storage networks, Red Hat recommends that you use Linux bonds with VLAN and LACP, because OVS bonds carry the potential for control plane disruption that can occur when OVS or the neutron agent is restarted for updates, hot fixes, and other events. The Linux bond/LACP/VLAN configuration provides NIC management without the OVS disruption potential.
| Objective | OVS bond mode | Compatible LACP options | Notes |
| High availability (active-passive) |
|
| |
| Increased throughput (active-active) |
|
|
|
|
|
|
|
8.2.4.5. Creating Linux bonds Copia collegamentoCollegamento copiato negli appunti!
You create Linux bonds in your network interface templates. For example, you can create a Linux bond that bonds two interfaces:
The bonding_options parameter sets the specific bonding options for the Linux bond.
mode-
Sets the bonding mode, which in the example is
802.3ador LACP mode. For more information about Linux bonding modes, see "Upstream Switch Configuration Depending on the Bonding Modes" in the Red Hat Enterprise Linux 9 Configuring and Managing Networking guide. lacp_rate- Defines whether LACP packets are sent every 1 second, or every 30 seconds.
updelay- Defines the minimum amount of time that an interface must be active before it is used for traffic. This minimum configuration helps to mitigate port flapping outages.
miimon- The interval in milliseconds that is used for monitoring the port state using the MIIMON functionality of the driver.
Use the following additional examples as guides to configure your own Linux bonds:
Linux bond set to
active-backupmode with one VLAN:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Linux bond on OVS bridge. Bond set to
802.3adLACP mode with one VLAN:Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantYou must set up
min_viable_mtu_ctlplanebefore you can use it. Copy/usr/share/ansible/roles/tripleo_network_config/templates/2_linux_bonds_vlans.j2to your templates directory and modify it for your needs. For more information, see Composable networks, and refer to the steps that pertain to the network configuration template.
8.2.5. Updating the format of your network configuration files Copia collegamentoCollegamento copiato negli appunti!
The format of the network configuration yaml files has changed in Red Hat OpenStack Platform (RHOSP) 17.0. The structure of the network configuration file network_data.yaml has changed, and the NIC template file format has changed from yaml file format to Jinja2 ansible format, j2.
You can convert your existing network configuration file in your current deployment to the RHOSP 17+ format by using the following conversion tools:
-
convert_v1_net_data.py -
convert_heat_nic_config_to_ansible_j2.py
You can also manually convert your existing NIC template files.
The files you need to convert include the following:
-
network_data.yaml - Controller NIC templates
- Compute NIC templates
- Any other custom network files
8.2.5.1. Updating the format of your network configuration file Copia collegamentoCollegamento copiato negli appunti!
The format of the network configuration yaml file has changed in Red Hat OpenStack Platform (RHOSP) 17.0. You can convert your existing network configuration file in your current deployment to the RHOSP 17+ format by using the convert_v1_net_data.py conversion tool.
Procedure
Download the conversion tool:
-
/usr/share/openstack-tripleo-heat-templates/tools/convert_v1_net_data.py
-
Convert your RHOSP 16+ network configuration file to the RHOSP 17+ format:
python3 convert_v1_net_data.py <network_config>.yaml
$ python3 convert_v1_net_data.py <network_config>.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<network_config>with the name of the existing configuration file that you want to convert, for example,network_data.yaml.
-
Replace
8.2.5.2. Automatically converting NIC templates to Jinja2 Ansible format Copia collegamentoCollegamento copiato negli appunti!
The NIC template file format has changed from yaml file format to Jinja2 Ansible format, j2, in Red Hat OpenStack Platform (RHOSP) 17.0.
You can convert your existing NIC template files in your current deployment to the Jinja2 format by using the convert_heat_nic_config_to_ansible_j2.py conversion tool.
You can also manually convert your existing NIC template files. For more information, see Manually converting NIC templates to Jinja2 Ansible format.
The files you need to convert include the following:
- Controller NIC templates
- Compute NIC templates
- Any other custom network files
Procedure
-
Log in to the undercloud as the
stackuser. Source the
stackrcfile:source ~/stackrc
[stack@director ~]$ source ~/stackrcCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the conversion tool to your current directory on the undercloud:
cp /usr/share/openstack-tripleo-heat-templates/tools/convert_heat_nic_config_to_ansible_j2.py .
$ cp /usr/share/openstack-tripleo-heat-templates/tools/convert_heat_nic_config_to_ansible_j2.py .Copy to Clipboard Copied! Toggle word wrap Toggle overflow Convert your Compute and Controller NIC template files, and any other custom network files, to the Jinja2 Ansible format:
python3 convert_heat_nic_config_to_ansible_j2.py \ [--stack <overcloud> | --standalone] --networks_file <network_config.yaml> \ <network_template>.yaml
$ python3 convert_heat_nic_config_to_ansible_j2.py \ [--stack <overcloud> | --standalone] --networks_file <network_config.yaml> \ <network_template>.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
<overcloud>with the name or UUID of the overcloud stack. If--stackis not specified, the stack defaults toovercloud.NoteYou can use the
--stackoption only on your RHOSP 16 deployment because it requires the Orchestration service (heat) to be running on the undercloud node. Starting with RHOSP 17, RHOSP deployments use ephemeral heat, which runs the Orchestration service in a container. If the Orchestration service is not available, or you have no stack, then use the--standaloneoption instead of--stack.-
Replace
<network_config.yaml>with the name of the configuration file that describes the network deployment, for example,network_data.yaml. -
Replace
<network_template>with the name of the network configuration file you want to convert.
Repeat this command until you have converted all your custom network configuration files. The
convert_heat_nic_config_to_ansible_j2.pyscript generates a.j2file for eachyamlfile you pass to it for conversion.-
Inspect each generated
.j2file to ensure the configuration is correct and complete for your environment, and manually address any comments generated by the tool that highlight where the configuration could not be converted. For more information about manually converting the NIC configuration to Jinja2 format, see Heat parameter to Ansible variable mappings. Configure the
*NetworkConfigTemplateparameters in yournetwork-environment.yamlfile to point to the generated.j2files:parameter_defaults: ControllerNetworkConfigTemplate: '/home/stack/templates/custom-nics/controller.j2' ComputeNetworkConfigTemplate: '/home/stack/templates/custom-nics/compute.j2'
parameter_defaults: ControllerNetworkConfigTemplate: '/home/stack/templates/custom-nics/controller.j2' ComputeNetworkConfigTemplate: '/home/stack/templates/custom-nics/compute.j2'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the
resource_registrymappings from yournetwork-environment.yamlfile for the old network configuration files:resource_registry: OS::TripleO::Compute::Net::SoftwareConfig: /home/stack/templates/nic-configs/compute.yaml OS::TripleO::Controller::Net::SoftwareConfig: /home/stack/templates/nic-configs/controller.yaml
resource_registry: OS::TripleO::Compute::Net::SoftwareConfig: /home/stack/templates/nic-configs/compute.yaml OS::TripleO::Controller::Net::SoftwareConfig: /home/stack/templates/nic-configs/controller.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.2.5.3. Manually converting NIC templates to Jinja2 Ansible format Copia collegamentoCollegamento copiato negli appunti!
The NIC template file format has changed from yaml file format to Jinja2 Ansible format, j2, in Red Hat OpenStack Platform (RHOSP) 17.0.
You can manually convert your existing NIC template files.
You can also convert your existing NIC template files in your current deployment to the Jinja2 format by using the convert_heat_nic_config_to_ansible_j2.py conversion tool. For more information, see Automatically converting NIC templates to Jinja2 ansible format.
The files you need to convert include the following:
- Controller NIC templates
- Compute NIC templates
- Any other custom network files
Procedure
-
Create a Jinja2 template. You can create a new template by copying an example template from the
/usr/share/ansible/roles/tripleo_network_config/templates/directory on the undercloud node. Replace the heat intrinsic functions with Jinja2 filters. For example, use the following filter to calculate the
min_viable_mtu:{% set mtu_list = [ctlplane_mtu] %} {% for network in role_networks %} {{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }} {%- endfor %} {% set min_viable_mtu = mtu_list | max %}{% set mtu_list = [ctlplane_mtu] %} {% for network in role_networks %} {{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }} {%- endfor %} {% set min_viable_mtu = mtu_list | max %}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use Ansible variables to configure the network properties for your deployment. You can configure each individual network manually, or programatically configure each network by iterating over
role_networks:To manually configure each network, replace each
get_paramfunction with the equivalent Ansible variable. For example, if your current deployment configuresvlan_idby usingget_param: InternalApiNetworkVlanID, then add the following configuration to your template:vlan_id: {{ internal_api_vlan_id }}vlan_id: {{ internal_api_vlan_id }}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Expand Table 8.9. Example network property mapping from heat parameters to Ansible vars yamlfile formatJinja2 ansible format, j2Copy to Clipboard Copied! Toggle word wrap Toggle overflow - type: vlan device: nic2 vlan_id: {{ internal_api_vlan_id }} addresses: - ip_netmask: {{ internal_api_ip }}/{{ internal_api_cidr }}- type: vlan device: nic2 vlan_id: {{ internal_api_vlan_id }} addresses: - ip_netmask: {{ internal_api_ip }}/{{ internal_api_cidr }}Copy to Clipboard Copied! Toggle word wrap Toggle overflow To programatically configure each network, add a Jinja2 for-loop structure to your template that retrieves the available networks by their role name by using
role_networks.Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
For a full list of the mappings from the heat parameter to the Ansible
varsequivalent, see Heat parameter to Ansible variable mappings.Configure the
*NetworkConfigTemplateparameters in yournetwork-environment.yamlfile to point to the generated.j2files:parameter_defaults: ControllerNetworkConfigTemplate: '/home/stack/templates/custom-nics/controller.j2' ComputeNetworkConfigTemplate: '/home/stack/templates/custom-nics/compute.j2'
parameter_defaults: ControllerNetworkConfigTemplate: '/home/stack/templates/custom-nics/controller.j2' ComputeNetworkConfigTemplate: '/home/stack/templates/custom-nics/compute.j2'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the
resource_registrymappings from yournetwork-environment.yamlfile for the old network configuration files:resource_registry: OS::TripleO::Compute::Net::SoftwareConfig: /home/stack/templates/nic-configs/compute.yaml OS::TripleO::Controller::Net::SoftwareConfig: /home/stack/templates/nic-configs/controller.yaml
resource_registry: OS::TripleO::Compute::Net::SoftwareConfig: /home/stack/templates/nic-configs/compute.yaml OS::TripleO::Controller::Net::SoftwareConfig: /home/stack/templates/nic-configs/controller.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.2.5.4. Heat parameter to Ansible variable mappings Copia collegamentoCollegamento copiato negli appunti!
The NIC template file format has changed from yaml file format to Jinja2 ansible format, j2, in Red Hat OpenStack Platform (RHOSP) 17.x.
To manually convert your existing NIC template files to Jinja2 ansible format, you can map your heat parameters to Ansible variables to configure the network properties for pre-provisioned nodes in your deployment. You can also map your heat parameters to Ansible variables if you run openstack overcloud node provision without specifying the --network-config optional argument.
For example, if your current deployment configures vlan_id by using get_param: InternalApiNetworkVlanID, then replace it with the following configuration in your new Jinja2 template:
vlan_id: {{ internal_api_vlan_id }}
vlan_id: {{ internal_api_vlan_id }}
If you provision your nodes by running openstack overcloud node provision with the --network-config optional argument, you must configure the network properties for your deploying by using the parameters in overcloud-baremetal-deploy.yaml. For more information, see Heat parameter to provisioning definition file mappings.
The following table lists the available mappings from the heat parameter to the Ansible vars equivalent.
| Heat parameter | Ansible vars |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note
This Ansible variable is populated with the IP address configured in |
|
|
|
Configuring a heat parameter that is not listed in the table
To configure a heat parameter that is not listed in the table, you must configure the parameter as a {{role.name}}ExtraGroupVars. After you have configured the parameter as a {{role.name}}ExtraGroupVars parameter, you can then use it in your new template. For example, to configure the StorageSupernet parameter, add the following configuration to your network configuration file:
parameter_defaults:
ControllerExtraGroupVars:
storage_supernet: 172.16.0.0/16
parameter_defaults:
ControllerExtraGroupVars:
storage_supernet: 172.16.0.0/16
You can then add {{ storage_supernet }} to your Jinja2 template.
This process will not work if the --network-config option is used with node provisioning. Users requiring custom vars should not use the --network-config option. Instead, after creating the Heat stack, apply the node network configuration to the config-download ansible run.
Converting the Ansible variable syntax to programmatically configure each network
When you use a Jinja2 for-loop structure to retrieve the available networks by their role name by iterating over role_networks, you need to retrieve the lower case name for each network role to prepend to each property. Use the following structure to convert the Ansible vars from the above table to the required syntax:
{{ lookup(‘vars’, networks_lower[network] ~ ‘_<property>’) }}
-
Replace
<property>with the property that you are setting, for example,ip,vlan_id, ormtu.
For example, to populate the value for each NetworkVlanID dynamically, replace {{ <network_name>_vlan_id }} with the following configuration:
{{ lookup(‘vars’, networks_lower[network] ~ ‘_vlan_id’) }}`
{{ lookup(‘vars’, networks_lower[network] ~ ‘_vlan_id’) }}`
8.2.5.5. Heat parameter to provisioning definition file mappings Copia collegamentoCollegamento copiato negli appunti!
If you provision your nodes by running the openstack overcloud node provision command with the --network-config optional argument, you must configure the network properties for your deployment by using the parameters in the node definition file overcloud-baremetal-deploy.yaml.
If your deployment uses pre-provisioned nodes, you can map your heat parameters to Ansible variables to configure the network properties. You can also map your heat parameters to Ansible variables if you run openstack overcloud node provision without specifying the --network-config optional argument. For more information about configuring network properties by using Ansible variables, see Heat parameter to Ansible variable mappings.
The following table lists the available mappings from the heat parameter to the network_config property equivalent in the node definition file overcloud-baremetal-deploy.yaml.
| Heat parameter | network_config property |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The following table lists the available mappings from the heat parameter to the property equivalent in the networks definition file network_data.yaml.
| Heat parameter | IPv4 network_data.yaml property | IPv6 network_data.yaml property |
|---|---|---|
|
|
- name: <network_name>
subnets:
subnet01:
ip_subnet: 172.16.1.0/24
|
- name: <network_name>
subnets:
subnet01:
ipv6_subnet: 2001:db8:a::/64
|
|
|
- name: <network_name>
subnets:
subnet01:
...
vlan: <vlan_id>
|
- name: <network_name>
subnets:
subnet01:
...
vlan: <vlan_id>
|
|
|
- name: <network_name> mtu:
|
- name: <network_name> mtu:
|
|
|
- name: <network_name>
subnets:
subnet01:
ip_subnet: 172.16.16.0/24
gateway_ip: 172.16.16.1
|
- name: <network_name>
subnets:
subnet01:
ipv6_subnet: 2001:db8:a::/64
gateway_ipv6: 2001:db8:a::1
|
|
|
|
|
8.2.5.6. Changes to the network data schema Copia collegamentoCollegamento copiato negli appunti!
The network data schema was updated in Red Hat OpenStack Platform (RHOSP) 17. The main differences between the network data schema used in RHOSP 16 and earlier, and network data schema used in RHOSP 17 and later, are as follows:
-
The base subnet has been moved to the
subnetsmap. This aligns the configuration for non-routed and routed deployments, such as spine-leaf networking. -
The
enabledoption is no longer used to ignore disabled networks. Instead, you must remove disabled networks from the configuration file. -
The
compat_nameoption is no longer required as the heat resource that used it has been removed. -
The following parameters are no longer valid at the network level:
ip_subnet,gateway_ip,allocation_pools,routes,ipv6_subnet,gateway_ipv6,ipv6_allocation_pools, androutes_ipv6. These parameters are still used at the subnet level. -
A new parameter,
physical_network, has been introduced, that is used to create ironic ports inmetalsmith. -
New parameters
network_typeandsegmentation_idreplace{{network.name}}NetValueSpecsused to set the network type tovlan. The following parameters have been deprecated in RHOSP 17:
-
{{network.name}}NetCidr -
{{network.name}}SubnetName -
{{network.name}}Network -
{{network.name}}AllocationPools -
{{network.name}}Routes -
{{network.name}}SubnetCidr_{{subnet}} -
{{network.name}}AllocationPools_{{subnet}} -
{{network.name}}Routes_{{subnet}}
-