Chapter 8. Basic network isolation
Configure the overcloud to use isolated networks so that you can host specific types of network traffic in isolation. Red Hat OpenStack Platform (RHOSP) includes a set of environment files that you can use to configure this network isolation. You might also require additional environment files to further customize your networking parameters:
An environment file that you can use to enable network isolation (
/usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml).NoteBefore you deploy RHOSP with director, the files
network-isolation.yamlandnetwork-environment.yamlare only in Jinja2 format and have a.j2.yamlextension. Director renders these files to.yamlversions during deployment.-
An environment file that you can use to configure network defaults (
/usr/share/openstack-tripleo-heat-templates/environments/network-environment.yaml). -
A
network_datafile that you can use to define network settings such as IP ranges, subnets, and virtual IPs. This example shows you how to create a copy of the default and edit it to suit your own network. - Templates that you can use to define your NIC layout for each node. The overcloud core template collection contains a set of defaults for different use cases.
-
An environment file that you can use to enable NICs. This example uses a default file located in the
environmentsdirectory.
8.1. Network isolation Copy linkLink copied to clipboard!
The overcloud assigns services to the provisioning network by default. However, director can divide overcloud network traffic into isolated networks. To use isolated networks, the overcloud contains an environment file that enables this feature. The environments/network-isolation.j2.yaml file in the core heat templates is a Jinja2 file that defines all ports and VIPs for each network in your composable network file. When rendered, it results in a network-isolation.yaml file in the same location with the full resource registry:
The first section of this file has the resource registry declaration for the OS::TripleO::Network::* resources. By default, these resources use the OS::Heat::None resource type, which does not create any networks. By redirecting these resources to the YAML files for each network, you enable the creation of these networks.
The next several sections create the IP addresses for the nodes in each role. The controller nodes have IPs on each network. The compute and storage nodes each have IPs on a subset of the networks.
Other functions of overcloud networking, such as Chapter 9, Custom composable networks and Chapter 10, Custom network interface templates rely on the network-isolation.yaml environment file. Therefore you must include the the rendered environment file in your deployment commands:
openstack overcloud deploy --templates \
...
$ openstack overcloud deploy --templates \
...
-e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \
...
8.2. Modifying isolated network configuration Copy linkLink copied to clipboard!
Copy the default network_data.yaml file and modify the copy to configure the default isolated networks.
Procedure
Copy the default
network_data.yamlfile:cp /usr/share/openstack-tripleo-heat-templates/network_data.yaml /home/stack/.
$ cp /usr/share/openstack-tripleo-heat-templates/network_data.yaml /home/stack/.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the local copy of the
network_data.yamlfile and modify the parameters to suit your networking requirements. For example, the Internal API network contains the following default network details:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Edit the following values for each network:
-
vlandefines the VLAN ID that you want to use for this network. -
ip_subnetandip_allocation_poolsset the default subnet and IP range for the network. -
gatewaysets the gateway for the network. Use this value to define the default route for the External network, or for other networks if necessary.
Include the custom network_data.yaml file with your deployment using the -n option. Without the -n option, the deployment command uses the default network details.
8.3. Network interface templates Copy linkLink copied to clipboard!
The overcloud network configuration requires a set of the network interface templates. These templates are standard heat templates in YAML format. Each role requires a NIC template so that director can configure each node within that role correctly.
All NIC templates contain the same sections as standard heat templates:
heat_template_version- The syntax version to use.
description- A string description of the template.
parameters- Network parameters to include in the template.
resources-
Takes parameters defined in
parametersand applies them to a network configuration script. outputs- Renders the final script used for configuration.
The default NIC templates in /usr/share/openstack-tripleo-heat-templates/network/config use Jinja2 syntax to render the template. For example, the following snippet from the single-nic-vlans configuration renders a set of VLANs for each network:
For default Compute nodes, this renders only the network information for the Storage, Internal API, and Tenant networks:
Chapter 10, Custom network interface templates explores how to render the default Jinja2-based templates to standard YAML versions, which you can use as a basis for customization.
8.4. Default network interface templates Copy linkLink copied to clipboard!
Director contains templates in /usr/share/openstack-tripleo-heat-templates/network/config/ to suit most common network scenarios. The following table outlines each NIC template set and the respective environment file that you must use to enable the templates.
Each environment file for enabling NIC templates uses the suffix .j2.yaml. This is the unrendered Jinja2 version. Ensure that you include the rendered file name, which uses the .yaml suffix, in your deployment.
| NIC directory | Description | Environment file |
|---|---|---|
|
|
Single NIC ( |
|
|
|
Single NIC ( |
|
|
|
Control plane attached to |
|
|
|
Control plane attached to |
|
Environment files exist for deploying the overcloud without an external network, for example, net-bond-with-vlans-no-external.yaml, and for IPv6 deployments, for example, net-bond-with-vlans-v6.yaml. These are provided for backwards compatibility and do not function with composable networks.
Each default NIC template set contains a role.role.j2.yaml template. This file uses Jinja2 to render additional files for each composable role. For example, if your overcloud uses Compute, Controller, and Ceph Storage roles, the deployment renders new templates based on role.role.j2.yaml, such as the following templates:
-
compute.yaml -
controller.yaml -
ceph-storage.yaml.
8.5. Enabling basic network isolation Copy linkLink copied to clipboard!
Director includes templates that you can use to enable basic network isolation. These files are located in the /usr/share/openstack-tripleo-heat-templates/environments directory. For example, you can use the templates to deploy an overcloud on a single NIC with VLANs with basic network isolation. In this scenario, use the net-single-nic-with-vlans template.
Procedure
When you run the
openstack overcloud deploycommand, ensure that you include the following rendered environment files:-
The custom
network_data.yamlfile. - The rendered file name of the default network isolation file.
- The rendered file name of the default network environment file.
- The rendered file name of the default network interface configuration file.
- Any additional environment files relevant to your configuration.
-
The custom
For example: