From 1dec175241c7e5f3c85dbe0cb1d38909e1d52308 Mon Sep 17 00:00:00 2001 From: Dan Sneddon Date: Tue, 28 Nov 2017 17:00:59 -0800 Subject: [PATCH] Render NIC config templates with jinja2 This change converts the existing NIC templates to jinja2 in order to dynamically render the ports and networks according to the network_data.yaml. If networks are added to the network_data.yaml file, parameters will be added to all NIC templates. The YAML files (as output from jinja with the default network_data.yaml) are present as an example. The roles in roles_data.yaml are used to produce NIC configs for the standard and custom composable roles. In order to keep the ordering of NICs the same in the multiple-nics templates, the order of networks was changed in the network_data.yaml file. This is reflected in the network templates, and in some of the files that is the only change. The roles and roles_data.yaml were modified to include a legacy name for the NIC config templates for the built-in roles Controller, Compute, Object Storage, Block Storage, Ceph Storage, Compute-DPDK, and Networker roles. There will now be a file produced with the legacy name, but also one produced with the -role.j2.yaml format (along with environment files to help use the new filenames). Note this change also fixes some typos as well as a number of templates that had VLANs with device: entries which were ignored. Closes-Bug: 1737041 Depends-On: I49c0245c36de3103671080fd1c8cfb3432856f35 Change-Id: I3bdb7d00dab5a023dd8b9c94c0f89f84357ae7a4 --- .../nic-configs/ceph-storage.yaml | 2 +- .../nic-configs/cinder-storage.yaml | 2 +- .../nic-configs/compute.yaml | 2 +- .../nic-configs/controller.yaml | 2 +- .../nic-configs/swift-storage.yaml | 2 +- .../nic-configs/ceph-storage.yaml | 2 +- .../nic-configs/cinder-storage.yaml | 2 +- .../multiple-nics/nic-configs/compute.yaml | 2 +- .../multiple-nics/nic-configs/controller.yaml | 2 +- .../nic-configs/swift-storage.yaml | 2 +- .../public-bond/nic-configs/ceph-storage.yaml | 2 +- .../nic-configs/cinder-storage.yaml | 2 +- .../public-bond/nic-configs/compute.yaml | 2 +- .../public-bond/nic-configs/controller.yaml | 2 +- .../nic-configs/swift-storage.yaml | 2 +- ...> net-bond-with-vlans-no-external.j2.yaml} | 11 +- ...v6.yaml => net-bond-with-vlans-v6.j2.yaml} | 10 +- environments/net-bond-with-vlans.j2.yaml | 12 ++ environments/net-bond-with-vlans.yaml | 13 -- ...s.yaml => net-dpdkbond-with-vlans.j2.yaml} | 12 +- ...s-v6.yaml => net-multiple-nics-v6.j2.yaml} | 10 +- environments/net-multiple-nics.j2.yaml | 12 ++ environments/net-multiple-nics.yaml | 13 -- ...single-nic-linux-bridge-with-vlans.j2.yaml | 12 ++ ...et-single-nic-linux-bridge-with-vlans.yaml | 13 -- ...single-nic-with-vlans-no-external.j2.yaml} | 10 +- ...l => net-single-nic-with-vlans-v6.j2.yaml} | 10 +- .../net-single-nic-with-vlans.j2.yaml | 12 ++ environments/net-single-nic-with-vlans.yaml | 13 -- environments/network-environment-v6.j2.yaml | 64 ++++++ environments/network-environment-v6.yaml | 60 ------ environments/network-environment.j2.yaml | 61 ++++++ environments/network-environment.yaml | 59 ------ environments/network-isolation-v6.j2.yaml | 5 + ...onfig-bond.yaml => net-config-bond.j2.yaml | 27 +-- ...g-bridge.yaml => net-config-bridge.j2.yaml | 28 +-- ...ge.yaml => net-config-linux-bridge.j2.yaml | 28 +-- net-config-noop.j2.yaml | 29 +++ net-config-noop.yaml | 47 ----- ...g-static-bridge-with-external-dhcp.j2.yaml | 30 +-- ...e.yaml => net-config-static-bridge.j2.yaml | 29 +-- ...g-static.yaml => net-config-static.j2.yaml | 28 +-- ...loud.yaml => net-config-undercloud.j2.yaml | 29 +-- network/config/bond-with-vlans/README.md | 14 +- .../config/bond-with-vlans/ceph-storage.yaml | 165 --------------- .../bond-with-vlans/cinder-storage.yaml | 172 ---------------- ...compute-dpdk.yaml => compute-dpdk.j2.yaml} | 82 +++----- network/config/bond-with-vlans/compute.yaml | 175 ---------------- ...al.yaml => controller-no-external.j2.yaml} | 79 +++----- ...ntroller-v6.yaml => controller-v6.j2.yaml} | 77 ++----- .../config/bond-with-vlans/controller.yaml | 188 ------------------ network/config/bond-with-vlans/networker.yaml | 166 ---------------- .../config/bond-with-vlans/role.role.j2.yaml | 179 +++++++++++++++++ .../config/bond-with-vlans/swift-storage.yaml | 172 ---------------- network/config/multiple-nics/README.md | 12 +- .../config/multiple-nics/ceph-storage.yaml | 140 ------------- .../config/multiple-nics/cinder-storage.yaml | 146 -------------- .../{compute-dvr.yaml => compute-dvr.j2.yaml} | 72 ++----- network/config/multiple-nics/compute.yaml | 154 -------------- ...ntroller-v6.yaml => controller-v6.j2.yaml} | 71 ++----- network/config/multiple-nics/controller.yaml | 171 ---------------- network/config/multiple-nics/networker.yaml | 152 -------------- .../config/multiple-nics/role.role.j2.yaml | 152 ++++++++++++++ .../config/multiple-nics/swift-storage.yaml | 146 -------------- .../ceph-storage.yaml | 147 -------------- .../cinder-storage.yaml | 154 -------------- .../compute.yaml | 157 --------------- ...ntroller-v6.yaml => controller-v6.j2.yaml} | 71 ++----- .../controller.yaml | 172 ---------------- .../networker.yaml | 148 -------------- .../role.role.j2.yaml | 103 ++++++++++ .../swift-storage.yaml | 154 -------------- network/config/single-nic-vlans/README.md | 13 +- .../config/single-nic-vlans/ceph-storage.yaml | 132 ------------ .../single-nic-vlans/cinder-storage.yaml | 142 ------------- network/config/single-nic-vlans/compute.yaml | 148 -------------- .../controller-no-external.j2.yaml | 100 ++++++++++ .../controller-no-external.yaml | 156 --------------- ...ntroller-v6.yaml => controller-v6.j2.yaml} | 71 ++----- .../config/single-nic-vlans/controller.yaml | 164 --------------- .../config/single-nic-vlans/networker.yaml | 144 -------------- .../config/single-nic-vlans/role.role.j2.yaml | 103 ++++++++++ .../single-nic-vlans/swift-storage.yaml | 142 ------------- network/network.j2 | 4 +- network_data.yaml | 65 +++--- network_data_ganesha.yaml | 71 ++++--- roles/BlockStorage.yaml | 2 + roles/CephStorage.yaml | 2 + roles/Compute.yaml | 1 + roles/ComputeOvsDpdk.yaml | 2 + roles/Controller.yaml | 4 + roles/ControllerAllNovaStandalone.yaml | 1 + roles/ControllerNoCeph.yaml | 1 + roles/ControllerNovaStandalone.yaml | 1 + roles/ControllerOpenstack.yaml | 1 + roles/ObjectStorage.yaml | 1 + roles_data.yaml | 10 + tools/process-templates.py | 10 +- 98 files changed, 1234 insertions(+), 4765 deletions(-) rename environments/{net-bond-with-vlans-no-external.yaml => net-bond-with-vlans-no-external.j2.yaml} (67%) rename environments/{net-bond-with-vlans-v6.yaml => net-bond-with-vlans-v6.j2.yaml} (58%) create mode 100644 environments/net-bond-with-vlans.j2.yaml delete mode 100644 environments/net-bond-with-vlans.yaml rename environments/{net-dpdkbond-with-vlans.yaml => net-dpdkbond-with-vlans.j2.yaml} (59%) rename environments/{net-multiple-nics-v6.yaml => net-multiple-nics-v6.j2.yaml} (54%) create mode 100644 environments/net-multiple-nics.j2.yaml delete mode 100644 environments/net-multiple-nics.yaml create mode 100644 environments/net-single-nic-linux-bridge-with-vlans.j2.yaml delete mode 100644 environments/net-single-nic-linux-bridge-with-vlans.yaml rename environments/{net-single-nic-with-vlans-no-external.yaml => net-single-nic-with-vlans-no-external.j2.yaml} (66%) rename environments/{net-single-nic-with-vlans-v6.yaml => net-single-nic-with-vlans-v6.j2.yaml} (54%) create mode 100644 environments/net-single-nic-with-vlans.j2.yaml delete mode 100644 environments/net-single-nic-with-vlans.yaml create mode 100644 environments/network-environment-v6.j2.yaml delete mode 100644 environments/network-environment-v6.yaml create mode 100644 environments/network-environment.j2.yaml delete mode 100644 environments/network-environment.yaml rename net-config-bond.yaml => net-config-bond.j2.yaml (71%) rename net-config-bridge.yaml => net-config-bridge.j2.yaml (56%) rename net-config-linux-bridge.yaml => net-config-linux-bridge.j2.yaml (70%) create mode 100644 net-config-noop.j2.yaml delete mode 100644 net-config-noop.yaml rename net-config-static-bridge-with-external-dhcp.yaml => net-config-static-bridge-with-external-dhcp.j2.yaml (75%) rename net-config-static-bridge.yaml => net-config-static-bridge.j2.yaml (75%) rename net-config-static.yaml => net-config-static.j2.yaml (72%) rename net-config-undercloud.yaml => net-config-undercloud.j2.yaml (70%) delete mode 100644 network/config/bond-with-vlans/ceph-storage.yaml delete mode 100644 network/config/bond-with-vlans/cinder-storage.yaml rename network/config/bond-with-vlans/{compute-dpdk.yaml => compute-dpdk.j2.yaml} (68%) delete mode 100644 network/config/bond-with-vlans/compute.yaml rename network/config/bond-with-vlans/{controller-no-external.yaml => controller-no-external.j2.yaml} (71%) rename network/config/bond-with-vlans/{controller-v6.yaml => controller-v6.j2.yaml} (73%) delete mode 100644 network/config/bond-with-vlans/controller.yaml delete mode 100644 network/config/bond-with-vlans/networker.yaml create mode 100644 network/config/bond-with-vlans/role.role.j2.yaml delete mode 100644 network/config/bond-with-vlans/swift-storage.yaml delete mode 100644 network/config/multiple-nics/ceph-storage.yaml delete mode 100644 network/config/multiple-nics/cinder-storage.yaml rename network/config/multiple-nics/{compute-dvr.yaml => compute-dvr.j2.yaml} (68%) delete mode 100644 network/config/multiple-nics/compute.yaml rename network/config/multiple-nics/{controller-v6.yaml => controller-v6.j2.yaml} (72%) delete mode 100644 network/config/multiple-nics/controller.yaml delete mode 100644 network/config/multiple-nics/networker.yaml create mode 100644 network/config/multiple-nics/role.role.j2.yaml delete mode 100644 network/config/multiple-nics/swift-storage.yaml delete mode 100644 network/config/single-nic-linux-bridge-vlans/ceph-storage.yaml delete mode 100644 network/config/single-nic-linux-bridge-vlans/cinder-storage.yaml delete mode 100644 network/config/single-nic-linux-bridge-vlans/compute.yaml rename network/config/single-nic-linux-bridge-vlans/{controller-v6.yaml => controller-v6.j2.yaml} (72%) delete mode 100644 network/config/single-nic-linux-bridge-vlans/controller.yaml delete mode 100644 network/config/single-nic-linux-bridge-vlans/networker.yaml create mode 100644 network/config/single-nic-linux-bridge-vlans/role.role.j2.yaml delete mode 100644 network/config/single-nic-linux-bridge-vlans/swift-storage.yaml delete mode 100644 network/config/single-nic-vlans/ceph-storage.yaml delete mode 100644 network/config/single-nic-vlans/cinder-storage.yaml delete mode 100644 network/config/single-nic-vlans/compute.yaml create mode 100644 network/config/single-nic-vlans/controller-no-external.j2.yaml delete mode 100644 network/config/single-nic-vlans/controller-no-external.yaml rename network/config/single-nic-vlans/{controller-v6.yaml => controller-v6.j2.yaml} (71%) delete mode 100644 network/config/single-nic-vlans/controller.yaml delete mode 100644 network/config/single-nic-vlans/networker.yaml create mode 100644 network/config/single-nic-vlans/role.role.j2.yaml delete mode 100644 network/config/single-nic-vlans/swift-storage.yaml diff --git a/ci/environments/network/multiple-nics-ipv6/nic-configs/ceph-storage.yaml b/ci/environments/network/multiple-nics-ipv6/nic-configs/ceph-storage.yaml index 7efe3d5876..c8e2f1e1fa 100644 --- a/ci/environments/network/multiple-nics-ipv6/nic-configs/ceph-storage.yaml +++ b/ci/environments/network/multiple-nics-ipv6/nic-configs/ceph-storage.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/ci/environments/network/multiple-nics-ipv6/nic-configs/cinder-storage.yaml b/ci/environments/network/multiple-nics-ipv6/nic-configs/cinder-storage.yaml index 902fc44d77..ebe220d0c1 100644 --- a/ci/environments/network/multiple-nics-ipv6/nic-configs/cinder-storage.yaml +++ b/ci/environments/network/multiple-nics-ipv6/nic-configs/cinder-storage.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/ci/environments/network/multiple-nics-ipv6/nic-configs/compute.yaml b/ci/environments/network/multiple-nics-ipv6/nic-configs/compute.yaml index d0cb634aa6..bb1a2c040a 100644 --- a/ci/environments/network/multiple-nics-ipv6/nic-configs/compute.yaml +++ b/ci/environments/network/multiple-nics-ipv6/nic-configs/compute.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/ci/environments/network/multiple-nics-ipv6/nic-configs/controller.yaml b/ci/environments/network/multiple-nics-ipv6/nic-configs/controller.yaml index 79956ba747..b57b3633f8 100644 --- a/ci/environments/network/multiple-nics-ipv6/nic-configs/controller.yaml +++ b/ci/environments/network/multiple-nics-ipv6/nic-configs/controller.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/ci/environments/network/multiple-nics-ipv6/nic-configs/swift-storage.yaml b/ci/environments/network/multiple-nics-ipv6/nic-configs/swift-storage.yaml index 902fc44d77..ebe220d0c1 100644 --- a/ci/environments/network/multiple-nics-ipv6/nic-configs/swift-storage.yaml +++ b/ci/environments/network/multiple-nics-ipv6/nic-configs/swift-storage.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/ci/environments/network/multiple-nics/nic-configs/ceph-storage.yaml b/ci/environments/network/multiple-nics/nic-configs/ceph-storage.yaml index 9c0b21c4d9..197db280fe 100644 --- a/ci/environments/network/multiple-nics/nic-configs/ceph-storage.yaml +++ b/ci/environments/network/multiple-nics/nic-configs/ceph-storage.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/ci/environments/network/multiple-nics/nic-configs/cinder-storage.yaml b/ci/environments/network/multiple-nics/nic-configs/cinder-storage.yaml index 782802a15e..8cab330f47 100644 --- a/ci/environments/network/multiple-nics/nic-configs/cinder-storage.yaml +++ b/ci/environments/network/multiple-nics/nic-configs/cinder-storage.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/ci/environments/network/multiple-nics/nic-configs/compute.yaml b/ci/environments/network/multiple-nics/nic-configs/compute.yaml index cca3a2c370..6d274af8e1 100644 --- a/ci/environments/network/multiple-nics/nic-configs/compute.yaml +++ b/ci/environments/network/multiple-nics/nic-configs/compute.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/ci/environments/network/multiple-nics/nic-configs/controller.yaml b/ci/environments/network/multiple-nics/nic-configs/controller.yaml index 9b34e018e5..d405142736 100644 --- a/ci/environments/network/multiple-nics/nic-configs/controller.yaml +++ b/ci/environments/network/multiple-nics/nic-configs/controller.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/ci/environments/network/multiple-nics/nic-configs/swift-storage.yaml b/ci/environments/network/multiple-nics/nic-configs/swift-storage.yaml index 782802a15e..8cab330f47 100644 --- a/ci/environments/network/multiple-nics/nic-configs/swift-storage.yaml +++ b/ci/environments/network/multiple-nics/nic-configs/swift-storage.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/ci/environments/network/public-bond/nic-configs/ceph-storage.yaml b/ci/environments/network/public-bond/nic-configs/ceph-storage.yaml index a2f4a6df99..75f37fea72 100644 --- a/ci/environments/network/public-bond/nic-configs/ceph-storage.yaml +++ b/ci/environments/network/public-bond/nic-configs/ceph-storage.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/ci/environments/network/public-bond/nic-configs/cinder-storage.yaml b/ci/environments/network/public-bond/nic-configs/cinder-storage.yaml index 160cfca2fb..3ee0da0771 100644 --- a/ci/environments/network/public-bond/nic-configs/cinder-storage.yaml +++ b/ci/environments/network/public-bond/nic-configs/cinder-storage.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/ci/environments/network/public-bond/nic-configs/compute.yaml b/ci/environments/network/public-bond/nic-configs/compute.yaml index 52ab9b6ea7..e6ab3cf0f4 100644 --- a/ci/environments/network/public-bond/nic-configs/compute.yaml +++ b/ci/environments/network/public-bond/nic-configs/compute.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/ci/environments/network/public-bond/nic-configs/controller.yaml b/ci/environments/network/public-bond/nic-configs/controller.yaml index 8bcda0c9d1..9727c0ff65 100644 --- a/ci/environments/network/public-bond/nic-configs/controller.yaml +++ b/ci/environments/network/public-bond/nic-configs/controller.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/ci/environments/network/public-bond/nic-configs/swift-storage.yaml b/ci/environments/network/public-bond/nic-configs/swift-storage.yaml index 160cfca2fb..3ee0da0771 100644 --- a/ci/environments/network/public-bond/nic-configs/swift-storage.yaml +++ b/ci/environments/network/public-bond/nic-configs/swift-storage.yaml @@ -48,7 +48,7 @@ parameters: type: number StorageMgmtNetworkVlanID: default: 40 - description: Vlan ID for the storage mgmt network traffic. + description: Vlan ID for the storage_mgmt network traffic. type: number TenantNetworkVlanID: default: 50 diff --git a/environments/net-bond-with-vlans-no-external.yaml b/environments/net-bond-with-vlans-no-external.j2.yaml similarity index 67% rename from environments/net-bond-with-vlans-no-external.yaml rename to environments/net-bond-with-vlans-no-external.j2.yaml index cc27d4f009..b4f7e71c4c 100644 --- a/environments/net-bond-with-vlans-no-external.yaml +++ b/environments/net-bond-with-vlans-no-external.j2.yaml @@ -10,13 +10,14 @@ # environment files we should think about using it here to automatically # include network-isolation.yaml. resource_registry: - # Set external ports to noop OS::TripleO::Network::External: OS::Heat::None OS::TripleO::Controller::Ports::ExternalPort: ../network/ports/noop.yaml - OS::TripleO::BlockStorage::Net::SoftwareConfig: ../network/config/bond-with-vlans/cinder-storage.yaml - OS::TripleO::Compute::Net::SoftwareConfig: ../network/config/bond-with-vlans/compute.yaml +{%- for role in roles if role.name != "Controller" %} + # Port assignments for the {{role.name}} + OS::TripleO::{{role.name}}::Net::SoftwareConfig: ../network/config/bond-with-vlans/{{role.deprecated_nic_config_name|default(role.name.lower().yaml)}} +{%- endfor %} + + # FIXME this should really be handled via enabled networks in roles_data not overriding here. OS::TripleO::Controller::Net::SoftwareConfig: ../network/config/bond-with-vlans/controller-no-external.yaml - OS::TripleO::ObjectStorage::Net::SoftwareConfig: ../network/config/bond-with-vlans/swift-storage.yaml - OS::TripleO::CephStorage::Net::SoftwareConfig: ../network/config/bond-with-vlans/ceph-storage.yaml diff --git a/environments/net-bond-with-vlans-v6.yaml b/environments/net-bond-with-vlans-v6.j2.yaml similarity index 58% rename from environments/net-bond-with-vlans-v6.yaml rename to environments/net-bond-with-vlans-v6.j2.yaml index dc6fdfe370..51a9743697 100644 --- a/environments/net-bond-with-vlans-v6.yaml +++ b/environments/net-bond-with-vlans-v6.j2.yaml @@ -7,8 +7,10 @@ # environment files we should think about using it here to automatically # include network-isolation-v6.yaml. resource_registry: - OS::TripleO::BlockStorage::Net::SoftwareConfig: ../network/config/bond-with-vlans/cinder-storage.yaml - OS::TripleO::Compute::Net::SoftwareConfig: ../network/config/bond-with-vlans/compute.yaml +{%- for role in roles if role != "Controller" %} + # Port assignments for the {{role.name}} + OS::TripleO::{{role.name}}::Net::SoftwareConfig: ../network/config/bond-with-vlans/{{role.deprecated_nic_config_name|default(role.name.lower().yaml)}} +{%- endfor %} + + # FIXME this should really be handled via setting ipv6:true in network_data not overriding here. OS::TripleO::Controller::Net::SoftwareConfig: ../network/config/bond-with-vlans/controller-v6.yaml - OS::TripleO::ObjectStorage::Net::SoftwareConfig: ../network/config/bond-with-vlans/swift-storage.yaml - OS::TripleO::CephStorage::Net::SoftwareConfig: ../network/config/bond-with-vlans/ceph-storage.yaml diff --git a/environments/net-bond-with-vlans.j2.yaml b/environments/net-bond-with-vlans.j2.yaml new file mode 100644 index 0000000000..b856e8d0ca --- /dev/null +++ b/environments/net-bond-with-vlans.j2.yaml @@ -0,0 +1,12 @@ +# This template configures each role to use a pair of bonded nics (nic2 and +# nic3) and configures an IP address on each relevant isolated network +# for each role. This template assumes use of network-isolation.yaml. +# +# FIXME: if/when we add functionality to heatclient to include heat +# environment files we should think about using it here to automatically +# include network-isolation.yaml. +resource_registry: +{%- for role in roles %} + # Port assignments for the {{role.name}} + OS::TripleO::{{role.name}}::Net::SoftwareConfig: ../network/config/bond-with-vlans/{{role.deprecated_nic_config_name|default(role.name.lower().yaml)}} +{%- endfor %} diff --git a/environments/net-bond-with-vlans.yaml b/environments/net-bond-with-vlans.yaml deleted file mode 100644 index 38c31cac0a..0000000000 --- a/environments/net-bond-with-vlans.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# This template configures each role to use a pair of bonded nics (nic2 and -# nic3) and configures an IP address on each relevant isolated network -# for each role. This template assumes use of network-isolation.yaml. -# -# FIXME: if/when we add functionality to heatclient to include heat -# environment files we should think about using it here to automatically -# include network-isolation.yaml. -resource_registry: - OS::TripleO::BlockStorage::Net::SoftwareConfig: ../network/config/bond-with-vlans/cinder-storage.yaml - OS::TripleO::Compute::Net::SoftwareConfig: ../network/config/bond-with-vlans/compute.yaml - OS::TripleO::Controller::Net::SoftwareConfig: ../network/config/bond-with-vlans/controller.yaml - OS::TripleO::ObjectStorage::Net::SoftwareConfig: ../network/config/bond-with-vlans/swift-storage.yaml - OS::TripleO::CephStorage::Net::SoftwareConfig: ../network/config/bond-with-vlans/ceph-storage.yaml diff --git a/environments/net-dpdkbond-with-vlans.yaml b/environments/net-dpdkbond-with-vlans.j2.yaml similarity index 59% rename from environments/net-dpdkbond-with-vlans.yaml rename to environments/net-dpdkbond-with-vlans.j2.yaml index 2ddb8cdd3a..ec1d05bd67 100644 --- a/environments/net-dpdkbond-with-vlans.yaml +++ b/environments/net-dpdkbond-with-vlans.j2.yaml @@ -1,3 +1,5 @@ +# NOTE: This environment file uses the compute-dpdk +# # This template configures each role to use a pair of bonded nics (nic2 and # nic3) and configures an IP address on each relevant isolated network # for each role. The nic4 and nic5 are configured for dpdkbond and a provider @@ -8,8 +10,10 @@ # environment files we should think about using it here to automatically # include network-isolation.yaml. resource_registry: - OS::TripleO::BlockStorage::Net::SoftwareConfig: ../network/config/bond-with-vlans/cinder-storage.yaml +{%- for role in roles if role.name != "Compute" %} + # Port assignments for the {{role.name}} + OS::TripleO::{{role.name}}::Net::SoftwareConfig: ../network/config/bond-with-vlans/{{role.deprecated_nic_config_name|default(role.name.lower().yaml)}} +{%- endfor %} + + # FIXME this won't handle any custom compute roles, instead we should have a generic way to override this OS::TripleO::Compute::Net::SoftwareConfig: ../network/config/bond-with-vlans/compute-dpdk.yaml - OS::TripleO::Controller::Net::SoftwareConfig: ../network/config/bond-with-vlans/controller.yaml - OS::TripleO::ObjectStorage::Net::SoftwareConfig: ../network/config/bond-with-vlans/swift-storage.yaml - OS::TripleO::CephStorage::Net::SoftwareConfig: ../network/config/bond-with-vlans/ceph-storage.yaml diff --git a/environments/net-multiple-nics-v6.yaml b/environments/net-multiple-nics-v6.j2.yaml similarity index 54% rename from environments/net-multiple-nics-v6.yaml rename to environments/net-multiple-nics-v6.j2.yaml index a2bb0bba42..a1fa448774 100644 --- a/environments/net-multiple-nics-v6.yaml +++ b/environments/net-multiple-nics-v6.j2.yaml @@ -6,8 +6,10 @@ # environment files we should think about using it here to automatically # include network-isolation-v6.yaml. resource_registry: - OS::TripleO::BlockStorage::Net::SoftwareConfig: ../network/config/multiple-nics/cinder-storage.yaml - OS::TripleO::Compute::Net::SoftwareConfig: ../network/config/multiple-nics/compute.yaml +{%- for role in roles if role.name != "Controller" %} + # Port assignments for the {{role.name}} + OS::TripleO::{{role.name}}::Net::SoftwareConfig: ../network/config/multiple-nics/{{role.deprecated_nic_config_name|default(role.name.lower().yaml)}} +{%- endfor %} + + # FIXME this should really be handled via setting ipv6:true in network_data not overriding here. OS::TripleO::Controller::Net::SoftwareConfig: ../network/config/multiple-nics/controller-v6.yaml - OS::TripleO::ObjectStorage::Net::SoftwareConfig: ../network/config/multiple-nics/swift-storage.yaml - OS::TripleO::CephStorage::Net::SoftwareConfig: ../network/config/multiple-nics/ceph-storage.yaml diff --git a/environments/net-multiple-nics.j2.yaml b/environments/net-multiple-nics.j2.yaml new file mode 100644 index 0000000000..a3a85f217a --- /dev/null +++ b/environments/net-multiple-nics.j2.yaml @@ -0,0 +1,12 @@ +# This template configures each role to use a separate NIC for +# each isolated network. +# This template assumes use of network-isolation.yaml. +# +# FIXME: if/when we add functionality to heatclient to include heat +# environment files we should think about using it here to automatically +# include network-isolation.yaml. +resource_registry: +{%- for role in roles %} + # Port assignments for the {{role.name}} + OS::TripleO::{{role.name}}::Net::SoftwareConfig: ../network/config/multiple-nics/{{role.deprecated_nic_config_name|default(role.name.lower().yaml)}} +{%- endfor %} diff --git a/environments/net-multiple-nics.yaml b/environments/net-multiple-nics.yaml deleted file mode 100644 index 5ee516fbac..0000000000 --- a/environments/net-multiple-nics.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# This template configures each role to use a separate NIC for -# each isolated network. -# This template assumes use of network-isolation.yaml. -# -# FIXME: if/when we add functionality to heatclient to include heat -# environment files we should think about using it here to automatically -# include network-isolation.yaml. -resource_registry: - OS::TripleO::BlockStorage::Net::SoftwareConfig: ../network/config/multiple-nics/cinder-storage.yaml - OS::TripleO::Compute::Net::SoftwareConfig: ../network/config/multiple-nics/compute.yaml - OS::TripleO::Controller::Net::SoftwareConfig: ../network/config/multiple-nics/controller.yaml - OS::TripleO::ObjectStorage::Net::SoftwareConfig: ../network/config/multiple-nics/swift-storage.yaml - OS::TripleO::CephStorage::Net::SoftwareConfig: ../network/config/multiple-nics/ceph-storage.yaml diff --git a/environments/net-single-nic-linux-bridge-with-vlans.j2.yaml b/environments/net-single-nic-linux-bridge-with-vlans.j2.yaml new file mode 100644 index 0000000000..b790d6ab06 --- /dev/null +++ b/environments/net-single-nic-linux-bridge-with-vlans.j2.yaml @@ -0,0 +1,12 @@ +# This template configures each role to use Vlans on a single nic for +# each isolated network. +# This template assumes use of network-isolation.yaml. +# +# FIXME: if/when we add functionality to heatclient to include heat +# environment files we should think about using it here to automatically +# include network-isolation.yaml. +resource_registry: +{%- for role in roles %} + # Port assignments for the {{role.name}} + OS::TripleO::{{role.name}}::Net::SoftwareConfig: ../network/config/single-nic-linux-bridge-vlans/{{role.deprecated_nic_config_name|default(role.name.lower().yaml)}} +{%- endfor %} diff --git a/environments/net-single-nic-linux-bridge-with-vlans.yaml b/environments/net-single-nic-linux-bridge-with-vlans.yaml deleted file mode 100644 index f34cfb9292..0000000000 --- a/environments/net-single-nic-linux-bridge-with-vlans.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# This template configures each role to use Vlans on a single nic for -# each isolated network. -# This template assumes use of network-isolation.yaml. -# -# FIXME: if/when we add functionality to heatclient to include heat -# environment files we should think about using it here to automatically -# include network-isolation.yaml. -resource_registry: - OS::TripleO::BlockStorage::Net::SoftwareConfig: ../network/config/single-nic-linux-bridge-vlans/cinder-storage.yaml - OS::TripleO::Compute::Net::SoftwareConfig: ../network/config/single-nic-linux-bridge-vlans/compute.yaml - OS::TripleO::Controller::Net::SoftwareConfig: ../network/config/single-nic-linux-bridge-vlans/controller.yaml - OS::TripleO::ObjectStorage::Net::SoftwareConfig: ../network/config/single-nic-linux-bridge-vlans/swift-storage.yaml - OS::TripleO::CephStorage::Net::SoftwareConfig: ../network/config/single-nic-linux-bridge-vlans/ceph-storage.yaml diff --git a/environments/net-single-nic-with-vlans-no-external.yaml b/environments/net-single-nic-with-vlans-no-external.j2.yaml similarity index 66% rename from environments/net-single-nic-with-vlans-no-external.yaml rename to environments/net-single-nic-with-vlans-no-external.j2.yaml index 65d3813794..c8d239e56b 100644 --- a/environments/net-single-nic-with-vlans-no-external.yaml +++ b/environments/net-single-nic-with-vlans-no-external.j2.yaml @@ -14,8 +14,10 @@ resource_registry: OS::TripleO::Controller::Ports::ExternalPort: ../network/ports/noop.yaml # Configure other ports as normal - OS::TripleO::BlockStorage::Net::SoftwareConfig: ../network/config/single-nic-vlans/cinder-storage.yaml - OS::TripleO::Compute::Net::SoftwareConfig: ../network/config/single-nic-vlans/compute.yaml +{%- for role in roles if role.name != "Controller" %} + # Port assignments for the {{role.name}} + OS::TripleO::{{role.name}}::Net::SoftwareConfig: ../network/config/single-nic-vlans/{{role.deprecated_nic_config_name|default(role.name.lower().yaml)}} +{%- endfor %} + + # FIXME this should really be handled via enabled networks in roles_data not overriding here. OS::TripleO::Controller::Net::SoftwareConfig: ../network/config/single-nic-vlans/controller-no-external.yaml - OS::TripleO::ObjectStorage::Net::SoftwareConfig: ../network/config/single-nic-vlans/swift-storage.yaml - OS::TripleO::CephStorage::Net::SoftwareConfig: ../network/config/single-nic-vlans/ceph-storage.yaml diff --git a/environments/net-single-nic-with-vlans-v6.yaml b/environments/net-single-nic-with-vlans-v6.j2.yaml similarity index 54% rename from environments/net-single-nic-with-vlans-v6.yaml rename to environments/net-single-nic-with-vlans-v6.j2.yaml index 966e5fe9d4..f9d1d4a1a6 100644 --- a/environments/net-single-nic-with-vlans-v6.yaml +++ b/environments/net-single-nic-with-vlans-v6.j2.yaml @@ -6,8 +6,10 @@ # environment files we should think about using it here to automatically # include network-isolation-v6.yaml. resource_registry: - OS::TripleO::BlockStorage::Net::SoftwareConfig: ../network/config/single-nic-vlans/cinder-storage.yaml - OS::TripleO::Compute::Net::SoftwareConfig: ../network/config/single-nic-vlans/compute.yaml +{%- for role in roles if role.name != "Controller" %} + # Port assignments for the {{role.name}} + OS::TripleO::{{role.name}}::Net::SoftwareConfig: ../network/config/single-nic-vlans/{{role.deprecated_nic_config_name|default(role.name.lower().yaml)}} +{%- endfor %} + + # FIXME this should really be handled via setting ipv6:true in network_data not overriding here. OS::TripleO::Controller::Net::SoftwareConfig: ../network/config/single-nic-vlans/controller-v6.yaml - OS::TripleO::ObjectStorage::Net::SoftwareConfig: ../network/config/single-nic-vlans/swift-storage.yaml - OS::TripleO::CephStorage::Net::SoftwareConfig: ../network/config/single-nic-vlans/ceph-storage.yaml diff --git a/environments/net-single-nic-with-vlans.j2.yaml b/environments/net-single-nic-with-vlans.j2.yaml new file mode 100644 index 0000000000..61d77d225e --- /dev/null +++ b/environments/net-single-nic-with-vlans.j2.yaml @@ -0,0 +1,12 @@ +# This template configures each role to use Vlans on a single nic for +# each isolated network. +# This template assumes use of network-isolation.yaml. +# +# FIXME: if/when we add functionality to heatclient to include heat +# environment files we should think about using it here to automatically +# include network-isolation.yaml. +resource_registry: +{%- for role in roles %} + # Port assignments for the {{role.name}} + OS::TripleO::{{role.name}}::Net::SoftwareConfig: ../network/config/single-nic-vlans/{{role.deprecated_nic_config_name|default(role.name.lower().yaml)}} +{%- endfor %} diff --git a/environments/net-single-nic-with-vlans.yaml b/environments/net-single-nic-with-vlans.yaml deleted file mode 100644 index b087b3e4cc..0000000000 --- a/environments/net-single-nic-with-vlans.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# This template configures each role to use Vlans on a single nic for -# each isolated network. -# This template assumes use of network-isolation.yaml. -# -# FIXME: if/when we add functionality to heatclient to include heat -# environment files we should think about using it here to automatically -# include network-isolation.yaml. -resource_registry: - OS::TripleO::BlockStorage::Net::SoftwareConfig: ../network/config/single-nic-vlans/cinder-storage.yaml - OS::TripleO::Compute::Net::SoftwareConfig: ../network/config/single-nic-vlans/compute.yaml - OS::TripleO::Controller::Net::SoftwareConfig: ../network/config/single-nic-vlans/controller.yaml - OS::TripleO::ObjectStorage::Net::SoftwareConfig: ../network/config/single-nic-vlans/swift-storage.yaml - OS::TripleO::CephStorage::Net::SoftwareConfig: ../network/config/single-nic-vlans/ceph-storage.yaml diff --git a/environments/network-environment-v6.j2.yaml b/environments/network-environment-v6.j2.yaml new file mode 100644 index 0000000000..6fbc66084c --- /dev/null +++ b/environments/network-environment-v6.j2.yaml @@ -0,0 +1,64 @@ +# NOTE: This file is deprecated, and is included for backwards-compatibility +# for use in upgrades. For new deployments, set ipv6: true for isolated +# networks using IPv6 (Tenant network should use IPv4 for tunneling), +# and set the default_route_networks to "['ControlPlane', 'External']" +# on the Controller role to use ControlPlane for IPv4 and External for IPv6 +# default routes, and include network-environment.yaml instead of this file. +resource_registry: + # Network Interface templates to use (these files must exist). You can + # override these by including one of the net-*.yaml environment files, + # such as net-bond-with-vlans-v6.yaml, or modifying the list here. +{%- for role in roles %} + # Port assignments for the {{role.name}} + OS::TripleO::{{role.name}}::Net::SoftwareConfig: + ../network/config/single-nic-vlans/{{role.deprecated_nic_config_name|default(role.name.lower().yaml)}} +{%- endfor %} + +parameter_defaults: + # This section is where deployment-specific configuration is done + # CIDR subnet mask length for provisioning network + ControlPlaneSubnetCidr: '24' + # Gateway router for the provisioning network (or Undercloud IP) + ControlPlaneDefaultRoute: 192.168.24.254 + EC2MetadataIp: 192.168.24.1 # Generally the IP of the Undercloud + # Customize the IP subnets to match the local environment +{%- for network in networks if network.enabled|default(true) %} +{%- if network.name != 'Tenant' %} + {{network.name}}NetCidr: '{{network.ipv6_subnet}}' +{%- else %} + # Tenant tunneling network is IPv4 until IPv6 is fully supported + {{network.name}}NetCidr: '{{network.ip_subnet}}' +{%- endif %} +{%- endfor %} + # Customize the VLAN IDs to match the local environment +{%- for network in networks if network.enabled|default(true) %} + {{network.name}}NetworkVlanID: {{network.vlan}} +{%- endfor %} + # Customize the IP ranges on each network to use for static IPs and VIPs +{%- for network in networks if network.enabled|default(true) %} +{%- if network.name == 'External' %} + # Leave room if the external network is also used for floating IPs +{%- endif %} +{%- if network.name != 'Tenant' %} + {{network.name}}AllocationPools: {{network.ipv6_allocation_pools}} +{%- else %} + # Tenant tunneling network should be IPv4 + {{network.name}}AllocationPools: {{network.ip_allocation_pools}} +{%- endif %} +{%- endfor %} + # Gateway routers for routable networks +{%- for network in networks if network.enabled|default(true) and network.gateway_ipv6|default(false) %} + {{network.name}}InterfaceDefaultRoute: '{{network.gateway_ipv6}}' +{%- endfor %} +{#- FIXME: These global parameters should be defined in a YAML file, e.g. network_data.yaml. #} + # Define the DNS servers (maximum 2) for the overcloud nodes + DnsServers: ["8.8.8.8","8.8.4.4"] + # List of Neutron network types for tenant networks (will be used in order) + NeutronNetworkType: 'vxlan,vlan' + # The tunnel type for the tenant network (vxlan or gre). Set to '' to disable tunneling. + NeutronTunnelTypes: 'vxlan' + # Neutron VLAN ranges per network, for example 'datacentre:1:499,tenant:500:1000': + NeutronNetworkVLANRanges: 'datacentre:1:1000' + # Customize bonding options, e.g. "mode=4 lacp_rate=1 updelay=1000 miimon=100" + # for Linux bonds w/LACP, or "bond_mode=active-backup" for OVS active/backup. + BondInterfaceOvsOptions: "bond_mode=active-backup" diff --git a/environments/network-environment-v6.yaml b/environments/network-environment-v6.yaml deleted file mode 100644 index 1617f8974a..0000000000 --- a/environments/network-environment-v6.yaml +++ /dev/null @@ -1,60 +0,0 @@ -#This file is an example of an environment file for defining the isolated -#networks and related parameters. -resource_registry: - # Network Interface templates to use (these files must exist) - OS::TripleO::BlockStorage::Net::SoftwareConfig: - ../network/config/single-nic-vlans/cinder-storage.yaml - OS::TripleO::Compute::Net::SoftwareConfig: - ../network/config/single-nic-vlans/compute.yaml - OS::TripleO::Controller::Net::SoftwareConfig: - ../network/config/single-nic-vlans/controller.yaml - OS::TripleO::ObjectStorage::Net::SoftwareConfig: - ../network/config/single-nic-vlans/swift-storage.yaml - OS::TripleO::CephStorage::Net::SoftwareConfig: - ../network/config/single-nic-vlans/ceph-storage.yaml - -parameter_defaults: - # This section is where deployment-specific configuration is done - # CIDR subnet mask length for provisioning network - ControlPlaneSubnetCidr: '24' - # Gateway router for the provisioning network (or Undercloud IP) - ControlPlaneDefaultRoute: 192.168.24.254 - EC2MetadataIp: 192.168.24.1 # Generally the IP of the Undercloud - # Customize the IP subnets to match the local environment - InternalApiNetCidr: 'fd00:fd00:fd00:2000::/64' - StorageNetCidr: 'fd00:fd00:fd00:3000::/64' - StorageMgmtNetCidr: 'fd00:fd00:fd00:4000::/64' - # Tenant tunneling network is IPv4 until IPv6 is fully supported - TenantNetCidr: 172.16.0.0/24 - ExternalNetCidr: '2001:db8:fd00:1000::/64' - # Customize the VLAN IDs to match the local environment - InternalApiNetworkVlanID: 20 - StorageNetworkVlanID: 30 - StorageMgmtNetworkVlanID: 40 - TenantNetworkVlanID: 50 - ExternalNetworkVlanID: 10 - # Customize the IP ranges on each network to use for static IPs and VIPs - InternalApiAllocationPools: [{'start': 'fd00:fd00:fd00:2000::10', 'end': 'fd00:fd00:fd00:2000:ffff:ffff:ffff:fffe'}] - StorageAllocationPools: [{'start': 'fd00:fd00:fd00:3000::10', 'end': 'fd00:fd00:fd00:3000:ffff:ffff:ffff:fffe'}] - StorageMgmtAllocationPools: [{'start': 'fd00:fd00:fd00:4000::10', 'end': 'fd00:fd00:fd00:4000:ffff:ffff:ffff:fffe'}] - TenantAllocationPools: [{'start': '172.16.0.10', 'end': '172.16.0.200'}] - # Leave room if the external network is also used for floating IPs - ExternalAllocationPools: [{'start': '2001:db8:fd00:1000::10', 'end': '2001:db8:fd00:1000:ffff:ffff:ffff:fffe'}] - # Gateway router for the external network - ExternalInterfaceDefaultRoute: '2001:db8:fd00:1000::1' - # Uncomment if using the Management Network (see network-management-v6.yaml) - # ManagementNetCidr: 'fd00:fd00:fd00:6000::/64' - # ManagementAllocationPools: [{'start': 'fd00:fd00:fd00:6000::10', 'end': 'fd00:fd00:fd00:6000:ffff:ffff:ffff:fffe'}] - # Use either this parameter or ControlPlaneDefaultRoute in the NIC templates - # ManagementInterfaceDefaultRoute: 'fd00:fd00:fd00:6000::1' - # Define the DNS servers (maximum 2) for the overcloud nodes - DnsServers: ["8.8.8.8","8.8.4.4"] - # List of Neutron network types for tenant networks (will be used in order) - NeutronNetworkType: 'vxlan,vlan' - # The tunnel type for the tenant network (vxlan or gre). Set to '' to disable tunneling. - NeutronTunnelTypes: 'vxlan' - # Neutron VLAN ranges per network, for example 'datacentre:1:499,tenant:500:1000': - NeutronNetworkVLANRanges: 'datacentre:1:1000' - # Customize bonding options, e.g. "mode=4 lacp_rate=1 updelay=1000 miimon=100" - # for Linux bonds w/LACP, or "bond_mode=active-backup" for OVS active/backup. - BondInterfaceOvsOptions: "bond_mode=active-backup" diff --git a/environments/network-environment.j2.yaml b/environments/network-environment.j2.yaml new file mode 100644 index 0000000000..15616f5380 --- /dev/null +++ b/environments/network-environment.j2.yaml @@ -0,0 +1,61 @@ +#This file is an example of an environment file for defining the isolated +#networks and related parameters. +resource_registry: + # Network Interface templates to use (these files must exist). You can + # override these by including one of the net-*.yaml environment files, + # such as net-bond-with-vlans.yaml, or modifying the list here. +{%- for role in roles %} + # Port assignments for the {{role.name}} + OS::TripleO::{{role.name}}::Net::SoftwareConfig: + ../network/config/single-nic-vlans/{{role.deprecated_nic_config_name|default(role.name.lower().yaml)}} +{%- endfor %} + +parameter_defaults: + # This section is where deployment-specific configuration is done + # CIDR subnet mask length for provisioning network + ControlPlaneSubnetCidr: '24' + # Gateway router for the provisioning network (or Undercloud IP) + ControlPlaneDefaultRoute: 192.168.24.254 + EC2MetadataIp: 192.168.24.1 # Generally the IP of the Undercloud + # Customize the IP subnets to match the local environment +{%- for network in networks if network.enabled|default(true) %} +{%- if network.ipv6|default(false) %} + {{network.name}}NetCidr: '{{network.ipv6_subnet}}' +{%- else %} + {{network.name}}NetCidr: '{{network.ip_subnet}}' +{%- endif %} +{%- endfor %} + # Customize the VLAN IDs to match the local environment +{%- for network in networks if network.enabled|default(true) %} + {{network.name}}NetworkVlanID: {{network.vlan}} +{%- endfor %} +{%- for network in networks if network.enabled|default(true) %} +{%- if network.name == 'External' %} + # Leave room if the external network is also used for floating IPs +{%- endif %} +{%- if network.ipv6|default(false) %} + {{network.name}}AllocationPools: {{network.ipv6_allocation_pools}} +{%- else %} + {{network.name}}AllocationPools: {{network.allocation_pools}} +{%- endif %} +{%- endfor %} + # Gateway routers for routable networks +{%- for network in networks if network.enabled|default(true) %} +{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} + {{network.name}}InterfaceDefaultRoute: '{{network.gateway_ipv6}}' +{%- elif network.gateway_ip|default(false) %} + {{network.name}}InterfaceDefaultRoute: '{{network.gateway_ip}}' +{%- endif %} +{%- endfor %} +{#- FIXME: These global parameters should be defined in a YAML file, e.g. network_data.yaml. #} + # Define the DNS servers (maximum 2) for the overcloud nodes + DnsServers: ["8.8.8.8","8.8.4.4"] + # List of Neutron network types for tenant networks (will be used in order) + NeutronNetworkType: 'vxlan,vlan' + # The tunnel type for the tenant network (vxlan or gre). Set to '' to disable tunneling. + NeutronTunnelTypes: 'vxlan' + # Neutron VLAN ranges per network, for example 'datacentre:1:499,tenant:500:1000': + NeutronNetworkVLANRanges: 'datacentre:1:1000' + # Customize bonding options, e.g. "mode=4 lacp_rate=1 updelay=1000 miimon=100" + # for Linux bonds w/LACP, or "bond_mode=active-backup" for OVS active/backup. + BondInterfaceOvsOptions: "bond_mode=active-backup" diff --git a/environments/network-environment.yaml b/environments/network-environment.yaml deleted file mode 100644 index 3de5dba5c7..0000000000 --- a/environments/network-environment.yaml +++ /dev/null @@ -1,59 +0,0 @@ -#This file is an example of an environment file for defining the isolated -#networks and related parameters. -resource_registry: - # Network Interface templates to use (these files must exist) - OS::TripleO::BlockStorage::Net::SoftwareConfig: - ../network/config/single-nic-vlans/cinder-storage.yaml - OS::TripleO::Compute::Net::SoftwareConfig: - ../network/config/single-nic-vlans/compute.yaml - OS::TripleO::Controller::Net::SoftwareConfig: - ../network/config/single-nic-vlans/controller.yaml - OS::TripleO::ObjectStorage::Net::SoftwareConfig: - ../network/config/single-nic-vlans/swift-storage.yaml - OS::TripleO::CephStorage::Net::SoftwareConfig: - ../network/config/single-nic-vlans/ceph-storage.yaml - -parameter_defaults: - # This section is where deployment-specific configuration is done - # CIDR subnet mask length for provisioning network - ControlPlaneSubnetCidr: '24' - # Gateway router for the provisioning network (or Undercloud IP) - ControlPlaneDefaultRoute: 192.168.24.254 - EC2MetadataIp: 192.168.24.1 # Generally the IP of the Undercloud - # Customize the IP subnets to match the local environment - InternalApiNetCidr: 172.17.0.0/24 - StorageNetCidr: 172.18.0.0/24 - StorageMgmtNetCidr: 172.19.0.0/24 - TenantNetCidr: 172.16.0.0/24 - ExternalNetCidr: 10.0.0.0/24 - # Customize the VLAN IDs to match the local environment - InternalApiNetworkVlanID: 20 - StorageNetworkVlanID: 30 - StorageMgmtNetworkVlanID: 40 - TenantNetworkVlanID: 50 - ExternalNetworkVlanID: 10 - # Customize the IP ranges on each network to use for static IPs and VIPs - InternalApiAllocationPools: [{'start': '172.17.0.10', 'end': '172.17.0.200'}] - StorageAllocationPools: [{'start': '172.18.0.10', 'end': '172.18.0.200'}] - StorageMgmtAllocationPools: [{'start': '172.19.0.10', 'end': '172.19.0.200'}] - TenantAllocationPools: [{'start': '172.16.0.10', 'end': '172.16.0.200'}] - # Leave room if the external network is also used for floating IPs - ExternalAllocationPools: [{'start': '10.0.0.10', 'end': '10.0.0.50'}] - # Gateway router for the external network - ExternalInterfaceDefaultRoute: 10.0.0.1 - # Uncomment if using the Management Network (see network-management.yaml) - # ManagementNetCidr: 10.0.1.0/24 - # ManagementAllocationPools: [{'start': '10.0.1.10', 'end': '10.0.1.50'}] - # Use either this parameter or ControlPlaneDefaultRoute in the NIC templates - # ManagementInterfaceDefaultRoute: 10.0.1.1 - # Define the DNS servers (maximum 2) for the overcloud nodes - DnsServers: ["8.8.8.8","8.8.4.4"] - # List of Neutron network types for tenant networks (will be used in order) - NeutronNetworkType: 'vxlan,vlan' - # The tunnel type for the tenant network (vxlan or gre). Set to '' to disable tunneling. - NeutronTunnelTypes: 'vxlan' - # Neutron VLAN ranges per network, for example 'datacentre:1:499,tenant:500:1000': - NeutronNetworkVLANRanges: 'datacentre:1:1000' - # Customize bonding options, e.g. "mode=4 lacp_rate=1 updelay=1000 miimon=100" - # for Linux bonds w/LACP, or "bond_mode=active-backup" for OVS active/backup. - BondInterfaceOvsOptions: "bond_mode=active-backup" diff --git a/environments/network-isolation-v6.j2.yaml b/environments/network-isolation-v6.j2.yaml index 8f96576c3d..f0949de41e 100644 --- a/environments/network-isolation-v6.j2.yaml +++ b/environments/network-isolation-v6.j2.yaml @@ -6,6 +6,11 @@ {%- endif -%} {%- endfor -%} {%- set primary_role_name = primary_role[0].name -%} +# NOTE: This template is now deprecated, and is only included for compatibility +# when upgrading a deployment where this template was originally used. For new +# deployments, set "ipv6: true" on desired networks in network_data.yaml, and +# include network-isolation.yaml. +# # Enable the creation of Neutron networks for isolated Overcloud # traffic and configure each role to assign ports (related # to that role) on these networks. diff --git a/net-config-bond.yaml b/net-config-bond.j2.yaml similarity index 71% rename from net-config-bond.yaml rename to net-config-bond.j2.yaml index 9f753c71e1..b0a1e71591 100644 --- a/net-config-bond.yaml +++ b/net-config-bond.j2.yaml @@ -16,30 +16,12 @@ parameters: default: '' description: IP address/subnet on the ctlplane network type: string - ExternalIpSubnet: + {%- for network in networks %} + {{network.name}}IpSubnet: default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: - default: '' - description: IP address/subnet on the management network + description: IP address/subnet on the {{network.name_lower}} network type: string + {%- endfor %} resources: OsNetConfigImpl: type: OS::Heat::SoftwareConfig @@ -71,4 +53,3 @@ outputs: description: The OsNetConfigImpl resource. value: get_resource: OsNetConfigImpl - diff --git a/net-config-bridge.yaml b/net-config-bridge.j2.yaml similarity index 56% rename from net-config-bridge.yaml rename to net-config-bridge.j2.yaml index e6bd8580eb..21f393442e 100644 --- a/net-config-bridge.yaml +++ b/net-config-bridge.j2.yaml @@ -1,35 +1,17 @@ heat_template_version: queens description: > - Software Config to drive os-net-config for a simple bridge. + Software Config to drive os-net-config for a simple interface on a bridge. parameters: ControlPlaneIp: default: '' description: IP address/subnet on the ctlplane network type: string - ExternalIpSubnet: + {%- for network in networks %} + {{network.name}}IpSubnet: default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: - default: '' - description: IP address/subnet on the management network + description: IP address/subnet on the {{network.name_lower}} network type: string + {%- endfor %} resources: OsNetConfigImpl: type: OS::Heat::SoftwareConfig diff --git a/net-config-linux-bridge.yaml b/net-config-linux-bridge.j2.yaml similarity index 70% rename from net-config-linux-bridge.yaml rename to net-config-linux-bridge.j2.yaml index 6124cbde48..f7c52c36ab 100644 --- a/net-config-linux-bridge.yaml +++ b/net-config-linux-bridge.j2.yaml @@ -1,35 +1,17 @@ heat_template_version: queens description: > - Software Config to drive os-net-config for a simple bridge. + Software Config to drive os-net-config for a simple linux bridge. parameters: ControlPlaneIp: default: '' description: IP address/subnet on the ctlplane network type: string - ExternalIpSubnet: + {%- for network in networks %} + {{network.name}}IpSubnet: default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: - default: '' - description: IP address/subnet on the management network + description: IP address/subnet on the {{network.name_lower}} network type: string + {%- endfor %} ControlPlaneDefaultRoute: # Override this via parameter_defaults description: The default route of the control plane network. type: string diff --git a/net-config-noop.j2.yaml b/net-config-noop.j2.yaml new file mode 100644 index 0000000000..f0e7096d27 --- /dev/null +++ b/net-config-noop.j2.yaml @@ -0,0 +1,29 @@ +heat_template_version: queens + +description: > + Software Config to no-op for os-net-config. Using this will allow you + to use the parameter driven (init-neutron-ovs) configuration instead. + +parameters: + ControlPlaneIp: + default: '' + description: IP address/subnet on the ctlplane network + type: string + {%- for network in networks %} + {{network.name}}IpSubnet: + default: '' + description: IP address/subnet on the {{network.name_lower}} network + type: string + {%- endfor %} + +resources: + OsNetConfigImpl: + type: OS::Heat::StructuredConfig + properties: + group: apply-config + config: {} + +outputs: + OS::stack_id: + description: The OsNetConfigImpl resource. + value: {get_resource: OsNetConfigImpl} diff --git a/net-config-noop.yaml b/net-config-noop.yaml deleted file mode 100644 index eab0cdcf01..0000000000 --- a/net-config-noop.yaml +++ /dev/null @@ -1,47 +0,0 @@ -heat_template_version: queens - -description: > - Software Config to no-op for os-net-config. Using this will allow you - to use the parameter driven (init-neutron-ovs) configuration instead. - -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: - default: '' - description: IP address/subnet on the management network - type: string - -resources: - OsNetConfigImpl: - type: OS::Heat::StructuredConfig - properties: - group: apply-config - config: {} - -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: {get_resource: OsNetConfigImpl} diff --git a/net-config-static-bridge-with-external-dhcp.yaml b/net-config-static-bridge-with-external-dhcp.j2.yaml similarity index 75% rename from net-config-static-bridge-with-external-dhcp.yaml rename to net-config-static-bridge-with-external-dhcp.j2.yaml index af6f9bdde6..2c31dd3e28 100644 --- a/net-config-static-bridge-with-external-dhcp.yaml +++ b/net-config-static-bridge-with-external-dhcp.j2.yaml @@ -1,35 +1,18 @@ heat_template_version: queens description: > - Software Config to drive os-net-config for a simple bridge configured with a static IP address for the ctlplane network. + Software Config to drive os-net-config for a simple bridge configured with + external DHCP and a static IP address for the ctlplane network. parameters: ControlPlaneIp: default: '' description: IP address/subnet on the ctlplane network type: string - ExternalIpSubnet: + {%- for network in networks %} + {{network.name}}IpSubnet: default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: - default: '' - description: IP address/subnet on the management network + description: IP address/subnet on the {{network.name_lower}} network type: string + {%- endfor %} ControlPlaneSubnetCidr: # Override this via parameter_defaults default: '24' description: The subnet CIDR of the control plane network. @@ -84,4 +67,3 @@ outputs: description: The OsNetConfigImpl resource. value: get_resource: OsNetConfigImpl - diff --git a/net-config-static-bridge.yaml b/net-config-static-bridge.j2.yaml similarity index 75% rename from net-config-static-bridge.yaml rename to net-config-static-bridge.j2.yaml index 43f3ddfafa..0ba01788fd 100644 --- a/net-config-static-bridge.yaml +++ b/net-config-static-bridge.j2.yaml @@ -1,35 +1,18 @@ heat_template_version: queens description: > - Software Config to drive os-net-config for a simple bridge configured with a static IP address for the ctlplane network. + Software Config to drive os-net-config for a simple bridge configured with a + static IP address for the ctlplane network. parameters: ControlPlaneIp: default: '' description: IP address/subnet on the ctlplane network type: string - ExternalIpSubnet: + {%- for network in networks %} + {{network.name}}IpSubnet: default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: - default: '' - description: IP address/subnet on the management network + description: IP address/subnet on the {{network.name_lower}} network type: string + {%- endfor %} ControlPlaneSubnetCidr: # Override this via parameter_defaults default: '24' description: The subnet CIDR of the control plane network. diff --git a/net-config-static.yaml b/net-config-static.j2.yaml similarity index 72% rename from net-config-static.yaml rename to net-config-static.j2.yaml index 7ca06b13b4..052df338f4 100644 --- a/net-config-static.yaml +++ b/net-config-static.j2.yaml @@ -1,35 +1,17 @@ heat_template_version: queens description: > - Software Config to drive os-net-config for a simple bridge. + Software Config to drive os-net-config for a simple interface with DHCP. parameters: ControlPlaneIp: default: '' description: IP address/subnet on the ctlplane network type: string - ExternalIpSubnet: + {%- for network in networks %} + {{network.name}}IpSubnet: default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: - default: '' - description: IP address/subnet on the management network + description: IP address/subnet on the {{network.name_lower}} network type: string + {%- endfor %} ControlPlaneSubnetCidr: # Override this via parameter_defaults default: '24' description: The subnet CIDR of the control plane network. diff --git a/net-config-undercloud.yaml b/net-config-undercloud.j2.yaml similarity index 70% rename from net-config-undercloud.yaml rename to net-config-undercloud.j2.yaml index 7f662776d0..23567e9cda 100644 --- a/net-config-undercloud.yaml +++ b/net-config-undercloud.j2.yaml @@ -1,35 +1,18 @@ heat_template_version: queens description: > - Software Config to drive os-net-config for a simple bridge configured with a static IP address for the ctlplane network. + Software Config to drive os-net-config for a simple bridge configured with a + static IP address for the ctlplane network. parameters: ControlPlaneIp: default: '' description: IP address/subnet on the ctlplane network type: string - ExternalIpSubnet: + {%- for network in networks %} + {{network.name}}IpSubnet: default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: - default: '' - description: IP address/subnet on the management network + description: IP address/subnet on the {{network.name_lower}} network type: string + {%- endfor %} ControlPlaneSubnetCidr: # Override this via parameter_defaults default: '24' description: The subnet CIDR of the control plane network. diff --git a/network/config/bond-with-vlans/README.md b/network/config/bond-with-vlans/README.md index 0796242bad..b55ed9ec8f 100644 --- a/network/config/bond-with-vlans/README.md +++ b/network/config/bond-with-vlans/README.md @@ -1,5 +1,5 @@ This directory contains Heat templates to help configure -Vlans on a bonded pair of NICs for each Overcloud role. +VLANs on a bonded pair of NICs for each Overcloud role. There are two versions of the controller role template, one with an external network interface, and another without. If the @@ -33,8 +33,10 @@ Same as above except set the following value for the controller role: Configuration with System Management Network -------------------------------------------- -To enable the optional System Management network, create a Heat environment -that looks something like this: +The Management network is included for upgrade compatibility with +previous versions, but disabled. To enable the optional System +Management network, create a Heat environment that looks something like +this: resource\_registry: OS::TripleO::Network::Management: ../network/management.yaml @@ -47,3 +49,9 @@ that looks something like this: Or use this Heat environment file: environments/network-management.yaml + +Or, enable the Management network in network_data.yaml, and add the network +to the list of networks used by each role in the role definition file +(e.g. roles_data.yaml). Refer to installation documentation for procedure +to generate a role file for custom roles. + diff --git a/network/config/bond-with-vlans/ceph-storage.yaml b/network/config/bond-with-vlans/ceph-storage.yaml deleted file mode 100644 index 698f227ea2..0000000000 --- a/network/config/bond-with-vlans/ceph-storage.yaml +++ /dev/null @@ -1,165 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config with 2 bonded nics on a bridge with VLANs attached for the ceph storage role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - BondInterfaceOvsOptions: - default: '' - description: 'The ovs_options or bonding_options string for the bond - interface. Set things like lacp=active and/or bond_mode=balance-slb - for OVS bonds or like mode=4 for Linux bonds using this option.' - type: string - constraints: - - allowed_pattern: ^((?!balance.tcp).)*$ - description: 'The balance-tcp bond mode is known to cause packet loss and - should not be used in BondInterfaceOvsOptions.' - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: interface - name: nic1 - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - - type: ovs_bridge - name: br-bond - members: - - type: ovs_bond - name: bond1 - ovs_options: - get_param: BondInterfaceOvsOptions - members: - - type: interface - name: nic2 - primary: true - - type: interface - name: nic3 - - type: vlan - device: bond1 - vlan_id: - get_param: StorageNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: vlan - device: bond1 - vlan_id: - get_param: StorageMgmtNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- - # type: vlan - # device: bond1 - # vlan_id: {get_param: ManagementNetworkVlanID} - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/bond-with-vlans/cinder-storage.yaml b/network/config/bond-with-vlans/cinder-storage.yaml deleted file mode 100644 index c470eb4363..0000000000 --- a/network/config/bond-with-vlans/cinder-storage.yaml +++ /dev/null @@ -1,172 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config with 2 bonded nics on a bridge with VLANs attached for the cinder storage role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - BondInterfaceOvsOptions: - default: '' - description: 'The ovs_options or bonding_options string for the bond - interface. Set things like lacp=active and/or bond_mode=balance-slb - for OVS bonds or like mode=4 for Linux bonds using this option.' - type: string - constraints: - - allowed_pattern: ^((?!balance.tcp).)*$ - description: 'The balance-tcp bond mode is known to cause packet loss and - should not be used in BondInterfaceOvsOptions.' - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: interface - name: nic1 - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - - type: ovs_bridge - name: br-bond - members: - - type: ovs_bond - name: bond1 - ovs_options: - get_param: BondInterfaceOvsOptions - members: - - type: interface - name: nic2 - primary: true - - type: interface - name: nic3 - - type: vlan - device: bond1 - vlan_id: - get_param: InternalApiNetworkVlanID - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - device: bond1 - vlan_id: - get_param: StorageNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: vlan - device: bond1 - vlan_id: - get_param: StorageMgmtNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- - # type: vlan - # device: bond1 - # vlan_id: {get_param: ManagementNetworkVlanID} - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/bond-with-vlans/compute-dpdk.yaml b/network/config/bond-with-vlans/compute-dpdk.j2.yaml similarity index 68% rename from network/config/bond-with-vlans/compute-dpdk.yaml rename to network/config/bond-with-vlans/compute-dpdk.j2.yaml index f48ae7b299..40ecf5b0f8 100644 --- a/network/config/bond-with-vlans/compute-dpdk.yaml +++ b/network/config/bond-with-vlans/compute-dpdk.j2.yaml @@ -1,64 +1,27 @@ +# NOTE: This legacy template configures the Compute role for using OVS DPDK. +# This template is included for upgrades that originally used this file. +# If you are deploying a new installation, you should enable the ComputeOvsDpdk +# role and use compute-ovs-dpdk.yaml instead. heat_template_version: queens description: > - Software Config to drive os-net-config with OVS-DPDK bond in addition to the 2 bonded NICs with VLANs attached for the compute role. + Software Config to drive os-net-config to configure VLANs for the compute role with DPDK. parameters: ControlPlaneIp: default: '' description: IP address/subnet on the ctlplane network type: string - ExternalIpSubnet: + {%- for network in networks %} + {{network.name}}IpSubnet: default: '' - description: IP address/subnet on the external network + description: IP address/subnet on the {{network.name_lower}} network type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - BondInterfaceOvsOptions: - default: '' - description: The bonding_options string for the bond interface. Set things like lacp=active and/or bond_mode=balance-slb using - this option. The default mode is active-backup. - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. + {%- endfor %} + {%- for network in networks %} + {{network.name}}NetworkVlanID: + default: {{network.vlan}} + description: Vlan ID for the {{network.name_lower}} network traffic. type: number + {%- endfor %} ControlPlaneSubnetCidr: # Override this via parameter_defaults default: '24' description: The subnet CIDR of the control plane network. @@ -66,14 +29,19 @@ parameters: ControlPlaneDefaultRoute: # Override this via parameter_defaults description: The default route of the control plane network. type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. +{%- for network in networks %} +{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ipv6}}' + description: default route for the {{network.name_lower}} network type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. +{%- elif network.gateway_ip|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ip}}' + description: default route for the {{network.name_lower}} network type: string +{%- endif %} +{%- endfor %} DnsServers: # Override this via parameter_defaults default: [] description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. diff --git a/network/config/bond-with-vlans/compute.yaml b/network/config/bond-with-vlans/compute.yaml deleted file mode 100644 index aa3e8ddff8..0000000000 --- a/network/config/bond-with-vlans/compute.yaml +++ /dev/null @@ -1,175 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config with 2 bonded nics on a bridge with VLANs attached for the compute role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - BondInterfaceOvsOptions: - default: '' - description: 'The ovs_options or bonding_options string for the bond - interface. Set things like lacp=active and/or bond_mode=balance-slb - for OVS bonds or like mode=4 for Linux bonds using this option.' - type: string - constraints: - - allowed_pattern: ^((?!balance.tcp).)*$ - description: 'The balance-tcp bond mode is known to cause packet loss and - should not be used in BondInterfaceOvsOptions.' - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: interface - name: nic1 - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - - type: ovs_bridge - name: bridge_name - members: - - type: ovs_bond - name: bond1 - ovs_options: - get_param: BondInterfaceOvsOptions - members: - - type: interface - name: nic2 - primary: true - - type: interface - name: nic3 - - type: vlan - device: bond1 - vlan_id: - get_param: InternalApiNetworkVlanID - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - device: bond1 - vlan_id: - get_param: StorageNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageIpSubnet - # Uncomment when including environments/hyperconverged-ceph.yaml - #- type: vlan - # device: bond1 - # vlan_id: {get_param: StorageMgmtNetworkVlanID} - # addresses: - # - ip_netmask: {get_param: StorageMgmtIpSubnet} - - type: vlan - device: bond1 - vlan_id: - get_param: TenantNetworkVlanID - addresses: - - ip_netmask: - get_param: TenantIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- type: vlan - # device: bond1 - # vlan_id: {get_param: ManagementNetworkVlanID} - # addresses: - # - ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/bond-with-vlans/controller-no-external.yaml b/network/config/bond-with-vlans/controller-no-external.j2.yaml similarity index 71% rename from network/config/bond-with-vlans/controller-no-external.yaml rename to network/config/bond-with-vlans/controller-no-external.j2.yaml index 0883f0d3f7..05f1fe2e47 100644 --- a/network/config/bond-with-vlans/controller-no-external.yaml +++ b/network/config/bond-with-vlans/controller-no-external.j2.yaml @@ -1,3 +1,7 @@ +# NOTE: This template is now deprecated, and is only included for compatibility +# when upgrading a deployment where this template was originally used. For new +# deployments, remove the External network from the Controller role and set +# default_route_networks to ['ControlPlane']. heat_template_version: queens description: > Software Config to drive os-net-config with 2 bonded nics on a bridge with VLANs attached for the controller role. @@ -6,30 +10,12 @@ parameters: default: '' description: IP address/subnet on the ctlplane network type: string - ExternalIpSubnet: + {%- for network in networks %} + {{network.name}}IpSubnet: default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network + description: IP address/subnet on the {{network.name_lower}} network type: string + {%- endfor %} BondInterfaceOvsOptions: default: '' description: 'The ovs_options or bonding_options string for the bond @@ -40,41 +26,28 @@ parameters: - allowed_pattern: ^((?!balance.tcp).)*$ description: 'The balance-tcp bond mode is known to cause packet loss and should not be used in BondInterfaceOvsOptions.' - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. +{%- for network in networks %} + {{network.name}}NetworkVlanID: + default: {{network.vlan}} + description: Vlan ID for the {{network.name_lower}} network traffic. type: number +{%- endfor %} ControlPlaneDefaultRoute: # Override this via parameter_defaults description: The default route of the control plane network. type: string - ExternalInterfaceDefaultRoute: - default: 10.0.0.1 - description: default route for the external network +{%- for network in networks %} +{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ipv6}}' + description: default route for the {{network.name_lower}} network type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. +{%- elif network.gateway_ip|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ip}}' + description: default route for the {{network.name_lower}} network type: string +{%- endif %} +{%- endfor %} ControlPlaneSubnetCidr: # Override this via parameter_defaults default: '24' description: The subnet CIDR of the control plane network. @@ -129,28 +102,24 @@ resources: - type: interface name: nic3 - type: vlan - device: bond1 vlan_id: get_param: InternalApiNetworkVlanID addresses: - ip_netmask: get_param: InternalApiIpSubnet - type: vlan - device: bond1 vlan_id: get_param: StorageNetworkVlanID addresses: - ip_netmask: get_param: StorageIpSubnet - type: vlan - device: bond1 vlan_id: get_param: StorageMgmtNetworkVlanID addresses: - ip_netmask: get_param: StorageMgmtIpSubnet - type: vlan - device: bond1 vlan_id: get_param: TenantNetworkVlanID addresses: diff --git a/network/config/bond-with-vlans/controller-v6.yaml b/network/config/bond-with-vlans/controller-v6.j2.yaml similarity index 73% rename from network/config/bond-with-vlans/controller-v6.yaml rename to network/config/bond-with-vlans/controller-v6.j2.yaml index 6ad6c650ce..4609448db0 100644 --- a/network/config/bond-with-vlans/controller-v6.yaml +++ b/network/config/bond-with-vlans/controller-v6.j2.yaml @@ -8,30 +8,12 @@ parameters: default: '' description: IP address/subnet on the ctlplane network type: string - ExternalIpSubnet: + {%- for network in networks %} + {{network.name}}IpSubnet: default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network + description: IP address/subnet on the {{network.name_lower}} network type: string + {%- endfor %} BondInterfaceOvsOptions: default: bond_mode=active-backup description: 'The ovs_options or bonding_options string for the bond @@ -42,30 +24,12 @@ parameters: - allowed_pattern: ^((?!balance.tcp).)*$ description: 'The balance-tcp bond mode is known to cause packet loss and should not be used in BondInterfaceOvsOptions.' - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. + {%- for network in networks %} + {{network.name}}NetworkVlanID: + default: {{network.vlan}} + description: Vlan ID for the {{network.name_lower}} network traffic. type: number + {%- endfor %} ControlPlaneSubnetCidr: # Override this via parameter_defaults default: '24' description: The subnet CIDR of the control plane network. @@ -73,14 +37,19 @@ parameters: ControlPlaneDefaultRoute: # Override this via parameter_defaults description: The default route of the control plane network. type: string - ExternalInterfaceDefaultRoute: - default: 10.0.0.1 - description: default route for the external network +{%- for network in networks %} +{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ipv6}}' + description: default route for the {{network.name_lower}} network type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. +{%- elif network.gateway_ip|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ip}}' + description: default route for the {{network.name_lower}} network type: string +{%- endif %} +{%- endfor %} DnsServers: # Override this via parameter_defaults default: [] description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. @@ -132,7 +101,6 @@ resources: - type: interface name: nic3 - type: vlan - device: bond1 vlan_id: get_param: ExternalNetworkVlanID addresses: @@ -143,28 +111,24 @@ resources: next_hop: get_param: ExternalInterfaceDefaultRoute - type: vlan - device: bond1 vlan_id: get_param: InternalApiNetworkVlanID addresses: - ip_netmask: get_param: InternalApiIpSubnet - type: vlan - device: bond1 vlan_id: get_param: StorageNetworkVlanID addresses: - ip_netmask: get_param: StorageIpSubnet - type: vlan - device: bond1 vlan_id: get_param: StorageMgmtNetworkVlanID addresses: - ip_netmask: get_param: StorageMgmtIpSubnet - type: vlan - device: bond1 vlan_id: get_param: TenantNetworkVlanID addresses: @@ -176,7 +140,6 @@ resources: # make the External API unreachable from remote subnets. #- # type: vlan - # device: bond1 # vlan_id: {get_param: ManagementNetworkVlanID} # addresses: # - diff --git a/network/config/bond-with-vlans/controller.yaml b/network/config/bond-with-vlans/controller.yaml deleted file mode 100644 index 6aabe29289..0000000000 --- a/network/config/bond-with-vlans/controller.yaml +++ /dev/null @@ -1,188 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config with 2 bonded nics on a bridge with VLANs attached for the controller role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - BondInterfaceOvsOptions: - default: bond_mode=active-backup - description: 'The ovs_options or bonding_options string for the bond - interface. Set things like lacp=active and/or bond_mode=balance-slb - for OVS bonds or like mode=4 for Linux bonds using this option.' - type: string - constraints: - - allowed_pattern: ^((?!balance.tcp).)*$ - description: 'The balance-tcp bond mode is known to cause packet loss and - should not be used in BondInterfaceOvsOptions.' - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: - default: 10.0.0.1 - description: default route for the external network - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: interface - name: nic1 - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - type: ovs_bridge - name: bridge_name - dns_servers: - get_param: DnsServers - members: - - type: ovs_bond - name: bond1 - ovs_options: - get_param: BondInterfaceOvsOptions - members: - - type: interface - name: nic2 - primary: true - - type: interface - name: nic3 - - type: vlan - device: bond1 - vlan_id: - get_param: ExternalNetworkVlanID - addresses: - - ip_netmask: - get_param: ExternalIpSubnet - routes: - - default: true - next_hop: - get_param: ExternalInterfaceDefaultRoute - - type: vlan - device: bond1 - vlan_id: - get_param: InternalApiNetworkVlanID - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - device: bond1 - vlan_id: - get_param: StorageNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: vlan - device: bond1 - vlan_id: - get_param: StorageMgmtNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - - type: vlan - device: bond1 - vlan_id: - get_param: TenantNetworkVlanID - addresses: - - ip_netmask: - get_param: TenantIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the External interface. This will - # make the External API unreachable from remote subnets. - #- - # type: vlan - # device: bond1 - # vlan_id: {get_param: ManagementNetworkVlanID} - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/bond-with-vlans/networker.yaml b/network/config/bond-with-vlans/networker.yaml deleted file mode 100644 index d63360f20a..0000000000 --- a/network/config/bond-with-vlans/networker.yaml +++ /dev/null @@ -1,166 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config with 2 bonded nics on a bridge with VLANs attached for a dedicated Neutron networker role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - BondInterfaceOvsOptions: - default: bond_mode=active-backup - description: The ovs_options string for the bond interface. Set things like lacp=active and/or bond_mode=balance-slb using - this option. - type: string - constraints: - - allowed_pattern: ^((?!balance.tcp).)*$ - description: 'The balance-tcp bond mode is known to cause packet loss and - should not be used in BondInterfaceOvsOptions. - ' - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: - default: 10.0.0.1 - description: default route for the external network - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: interface - name: nic1 - use_dhcp: false - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - - type: ovs_bridge - name: bridge_name - dns_servers: - get_param: DnsServers - members: - - type: ovs_bond - name: bond1 - ovs_options: - get_param: BondInterfaceOvsOptions - members: - - type: interface - name: nic2 - primary: true - - type: interface - name: nic3 - - type: vlan - device: bond1 - vlan_id: - get_param: InternalApiNetworkVlanID - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - device: bond1 - vlan_id: - get_param: TenantNetworkVlanID - addresses: - - ip_netmask: - get_param: TenantIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the External interface. This will - # make the External API unreachable from remote subnets. - #- - # type: vlan - # device: bond1 - # vlan_id: {get_param: ManagementNetworkVlanID} - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/bond-with-vlans/role.role.j2.yaml b/network/config/bond-with-vlans/role.role.j2.yaml new file mode 100644 index 0000000000..9ebaa80bce --- /dev/null +++ b/network/config/bond-with-vlans/role.role.j2.yaml @@ -0,0 +1,179 @@ +heat_template_version: queens +description: > + Software Config to drive os-net-config with 2 bonded nics on a bridge with VLANs attached for the {{role.name}} role. +parameters: + ControlPlaneIp: + default: '' + description: IP address/subnet on the ctlplane network + type: string + {%- for network in networks %} + {{network.name}}IpSubnet: + default: '' + description: IP address/subnet on the {{network.name_lower}} network + type: string + {%- endfor %} + BondInterfaceOvsOptions: + default: bond_mode=active-backup + description: 'The ovs_options or bonding_options string for the bond + interface. Set things like lacp=active and/or bond_mode=balance-slb + for OVS bonds or like mode=4 for Linux bonds using this option.' + type: string + constraints: + - allowed_pattern: ^((?!balance.tcp).)*$ + description: 'The balance-tcp bond mode is known to cause packet loss and + should not be used in BondInterfaceOvsOptions.' +{%- for network in networks %} + {{network.name}}NetworkVlanID: + default: {{network.vlan}} + description: Vlan ID for the {{network.name_lower}} network traffic. + type: number +{%- endfor %} + ControlPlaneDefaultRoute: # Override this via parameter_defaults + description: The default route of the control plane network. + type: string +{%- for network in networks %} +{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ipv6}}' + description: default route for the {{network.name_lower}} network + type: string +{%- elif network.gateway_ip|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ip}}' + description: default route for the {{network.name_lower}} network + type: string +{%- endif %} +{%- endfor %} + ControlPlaneSubnetCidr: # Override this via parameter_defaults + default: '24' + description: The subnet CIDR of the control plane network. + type: string + DnsServers: # Override this via parameter_defaults + default: [] + description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. + type: comma_delimited_list + EC2MetadataIp: # Override this via parameter_defaults + description: The IP address of the EC2 metadata server. + type: string +{%- if role.name == 'ComputeOvsDpdk' %} + NumDpdkInterfaceRxQueues: + description: Number of Rx Queues required for DPDK bond or DPDK ports + default: 1 + type: number +{%- endif %} +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: + - type: interface + name: nic1 + use_dhcp: false + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + - ip_netmask: 169.254.169.254/32 + next_hop: + get_param: EC2MetadataIp +{%- if role.default_route_networks is not defined or 'ControlPlane' in role.default_route_networks %} + - default: true + next_hop: + get_param: ControlPlaneDefaultRoute +{%- endif %} +{%- if role.name != 'ComputeOvsDpdk' %} + - type: ovs_bridge + name: bridge_name + dns_servers: + get_param: DnsServers + members: + - type: ovs_bond + name: bond1 + ovs_options: + get_param: BondInterfaceOvsOptions + members: + - type: interface + name: nic2 + primary: true + - type: interface + name: nic3 +{%- for network in networks if network.enabled|default(true) and network.name in role.networks %} + - type: vlan + vlan_id: + get_param: {{network.name}}NetworkVlanID + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet +{%- if network.name in role.default_route_networks %} + routes: + - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute +{%- endif %} +{%- endfor %} +{%- else %} + # Linux bond for non-DPDK traffic required when using DPDK + - type: linux_bond + name: bond_api + bonding_options: + get_param: BondInterfaceOvsOptions + use_dhcp: false + dns_servers: + get_param: DnsServers + members: + - type: interface + name: nic2 + primary: true + - type: interface + name: nic3 +{%- for network in networks if network.enabled|default(true) and network.name in role.networks %} + - type: vlan + device: bond_api + vlan_id: + get_param: {{network.name}}NetworkVlanID + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet +{%- if network.name in role.default_route_networks %} + routes: + - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute +{%- endif %} +{%- endfor %} + # Used as a provider network with external DHCP + - type: ovs_user_bridge + name: br-dpdk0 + members: + - type: ovs_dpdk_bond + name: dpdkbond0 + rx_queue: + get_param: NumDpdkInterfaceRxQueues + members: + - type: ovs_dpdk_port + name: dpdk0 + members: + - type: interface + name: nic4 + - type: ovs_dpdk_port + name: dpdk1 + members: + - type: interface + name: nic5 +{%- endif %} +outputs: + OS::stack_id: + description: The OsNetConfigImpl resource. + value: + get_resource: OsNetConfigImpl + diff --git a/network/config/bond-with-vlans/swift-storage.yaml b/network/config/bond-with-vlans/swift-storage.yaml deleted file mode 100644 index 7afd63810a..0000000000 --- a/network/config/bond-with-vlans/swift-storage.yaml +++ /dev/null @@ -1,172 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config with 2 bonded nics on a bridge with VLANs attached for the swift storage role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - BondInterfaceOvsOptions: - default: '' - description: The ovs_options or bonding_options string for the bond - interface. Set things like lacp=active and/or bond_mode=balance-slb - for OVS bonds or like mode=4 for Linux bonds using this option. - type: string - constraints: - - allowed_pattern: ^((?!balance.tcp).)*$ - description: The balance-tcp bond mode is known to cause packet loss and - should not be used in BondInterfaceOvsOptions. - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: interface - name: nic1 - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - - type: ovs_bridge - name: br-bond - members: - - type: ovs_bond - name: bond1 - ovs_options: - get_param: BondInterfaceOvsOptions - members: - - type: interface - name: nic2 - primary: true - - type: interface - name: nic3 - - type: vlan - device: bond1 - vlan_id: - get_param: InternalApiNetworkVlanID - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - device: bond1 - vlan_id: - get_param: StorageNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: vlan - device: bond1 - vlan_id: - get_param: StorageMgmtNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- - # type: vlan - # device: bond1 - # vlan_id: {get_param: ManagementNetworkVlanID} - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/multiple-nics/README.md b/network/config/multiple-nics/README.md index 45d5b20e32..2c86fe4c51 100644 --- a/network/config/multiple-nics/README.md +++ b/network/config/multiple-nics/README.md @@ -23,8 +23,10 @@ Or use this Heat environment file: Configuration with System Management Network -------------------------------------------- -To enable the optional System Management network, create a Heat environment -that looks something like this: +The Management network is included for upgrade compatibility with +previous versions, but disabled. To enable the optional System +Management network, create a Heat environment that looks something like +this: resource\_registry: OS::TripleO::Network::Management: ../network/management.yaml @@ -37,3 +39,9 @@ that looks something like this: Or use this Heat environment file: environments/network-management.yaml + +Or, enable the Management network in network_data.yaml, and add the network +to the list of networks used by each role in the role definition file +(e.g. roles_data.yaml). Refer to installation documentation for procedure +to generate a role file for custom roles. + diff --git a/network/config/multiple-nics/ceph-storage.yaml b/network/config/multiple-nics/ceph-storage.yaml deleted file mode 100644 index 1802d8f2f9..0000000000 --- a/network/config/multiple-nics/ceph-storage.yaml +++ /dev/null @@ -1,140 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure multiple interfaces for the ceph storage role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: interface - name: nic1 - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - - type: interface - name: nic2 - use_dhcp: false - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: interface - name: nic3 - use_dhcp: false - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- - # type: interface - # name: nic7 - # use_dhcp: false - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/multiple-nics/cinder-storage.yaml b/network/config/multiple-nics/cinder-storage.yaml deleted file mode 100644 index 214406b1e1..0000000000 --- a/network/config/multiple-nics/cinder-storage.yaml +++ /dev/null @@ -1,146 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure multiple interfaces for the cinder storage role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: interface - name: nic1 - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - - type: interface - name: nic2 - use_dhcp: false - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: interface - name: nic3 - use_dhcp: false - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - - type: interface - name: nic4 - use_dhcp: false - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- - # type: interface - # name: nic7 - # use_dhcp: false - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/multiple-nics/compute-dvr.yaml b/network/config/multiple-nics/compute-dvr.j2.yaml similarity index 68% rename from network/config/multiple-nics/compute-dvr.yaml rename to network/config/multiple-nics/compute-dvr.j2.yaml index 8a55c44262..1dce157fe5 100644 --- a/network/config/multiple-nics/compute-dvr.yaml +++ b/network/config/multiple-nics/compute-dvr.j2.yaml @@ -1,3 +1,4 @@ +# FIXME: This legacy template should be converted to a composable role heat_template_version: queens description: > Software Config to drive os-net-config to configure multiple interfaces for the @@ -7,54 +8,18 @@ parameters: default: '' description: IP address/subnet on the ctlplane network type: string - ExternalIpSubnet: + {%- for network in networks %} + {{network.name}}IpSubnet: default: '' - description: IP address/subnet on the external network + description: IP address/subnet on the {{network.name_lower}} network type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. + {%- endfor %} + {%- for network in networks %} + {{network.name}}NetworkVlanID: + default: {{network.vlan}} + description: Vlan ID for the {{network.name_lower}} network traffic. type: number + {%- endfor %} ControlPlaneSubnetCidr: # Override this via parameter_defaults default: '24' description: The subnet CIDR of the control plane network. @@ -62,14 +27,19 @@ parameters: ControlPlaneDefaultRoute: # Override this via parameter_defaults description: The default route of the control plane network. type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. +{%- for network in networks %} +{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ipv6}}' + description: default route for the {{network.name_lower}} network type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. +{%- elif network.gateway_ip|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ip}}' + description: default route for the {{network.name_lower}} network type: string +{%- endif %} +{%- endfor %} DnsServers: # Override this via parameter_defaults default: [] description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. diff --git a/network/config/multiple-nics/compute.yaml b/network/config/multiple-nics/compute.yaml deleted file mode 100644 index 7a2e19305f..0000000000 --- a/network/config/multiple-nics/compute.yaml +++ /dev/null @@ -1,154 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure multiple interfaces for the compute role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: interface - name: nic1 - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - - type: interface - name: nic2 - use_dhcp: false - addresses: - - ip_netmask: - get_param: StorageIpSubnet - # Uncomment when including environments/hyperconverged-ceph.yaml - #- type: interface - # name: nic3 - # use_dhcp: false - # addresses: - # - ip_netmask: {get_param: StorageMgmtIpSubnet} - - type: interface - name: nic4 - use_dhcp: false - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: ovs_bridge - name: br-tenant - use_dhcp: false - addresses: - - ip_netmask: - get_param: TenantIpSubnet - members: - - type: interface - name: nic5 - use_dhcp: false - primary: true - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- type: interface - # name: nic7 - # use_dhcp: false - # addresses: - # - ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/multiple-nics/controller-v6.yaml b/network/config/multiple-nics/controller-v6.j2.yaml similarity index 72% rename from network/config/multiple-nics/controller-v6.yaml rename to network/config/multiple-nics/controller-v6.j2.yaml index e71bf7335d..9cb3c20b41 100644 --- a/network/config/multiple-nics/controller-v6.yaml +++ b/network/config/multiple-nics/controller-v6.j2.yaml @@ -7,54 +7,18 @@ parameters: default: '' description: IP address/subnet on the ctlplane network type: string - ExternalIpSubnet: + {%- for network in networks %} + {{network.name}}IpSubnet: default: '' - description: IP address/subnet on the external network + description: IP address/subnet on the {{network.name_lower}} network type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. + {%- endfor %} + {%- for network in networks %} + {{network.name}}NetworkVlanID: + default: {{network.vlan}} + description: Vlan ID for the {{network.name_lower}} network traffic. type: number + {%- endfor %} ControlPlaneSubnetCidr: # Override this via parameter_defaults default: '24' description: The subnet CIDR of the control plane network. @@ -62,14 +26,19 @@ parameters: ControlPlaneDefaultRoute: # Override this via parameter_defaults description: The default route of the control plane network. type: string - ExternalInterfaceDefaultRoute: - default: 10.0.0.1 - description: default route for the external network +{%- for network in networks %} +{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ipv6}}' + description: default route for the {{network.name_lower}} network type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. +{%- elif network.gateway_ip|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ip}}' + description: default route for the {{network.name_lower}} network type: string +{%- endif %} +{%- endfor %} DnsServers: # Override this via parameter_defaults default: [] description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. diff --git a/network/config/multiple-nics/controller.yaml b/network/config/multiple-nics/controller.yaml deleted file mode 100644 index 832800bc67..0000000000 --- a/network/config/multiple-nics/controller.yaml +++ /dev/null @@ -1,171 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure multiple interfaces for the controller role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: - default: 10.0.0.1 - description: default route for the external network - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: interface - name: nic1 - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - type: interface - name: nic2 - use_dhcp: false - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: interface - name: nic3 - use_dhcp: false - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - - type: interface - name: nic4 - use_dhcp: false - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: ovs_bridge - name: br-tenant - use_dhcp: false - addresses: - - ip_netmask: - get_param: TenantIpSubnet - members: - - type: interface - name: nic5 - use_dhcp: false - primary: true - - type: ovs_bridge - name: bridge_name - dns_servers: - get_param: DnsServers - use_dhcp: false - addresses: - - ip_netmask: - get_param: ExternalIpSubnet - routes: - - default: true - next_hop: - get_param: ExternalInterfaceDefaultRoute - members: - - type: interface - name: nic6 - primary: true - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the External interface. This will - # make the External API unreachable from remote subnets. - #- - # type: interface - # name: nic7 - # use_dhcp: false - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/multiple-nics/networker.yaml b/network/config/multiple-nics/networker.yaml deleted file mode 100644 index cddd1698c4..0000000000 --- a/network/config/multiple-nics/networker.yaml +++ /dev/null @@ -1,152 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure multiple interfaces for a dedicated Neutron networker role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: - default: 10.0.0.1 - description: default route for the external network - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: interface - name: nic1 - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - - type: interface - name: nic4 - use_dhcp: false - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: ovs_bridge - name: br-tenant - use_dhcp: false - addresses: - - ip_netmask: - get_param: TenantIpSubnet - members: - - type: interface - name: nic5 - use_dhcp: false - primary: true - - type: ovs_bridge - name: bridge_name - use_dhcp: false - members: - - type: interface - name: nic6 - primary: true - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane interface. - #- - # type: interface - # name: nic7 - # use_dhcp: false - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/multiple-nics/role.role.j2.yaml b/network/config/multiple-nics/role.role.j2.yaml new file mode 100644 index 0000000000..b0d2953eef --- /dev/null +++ b/network/config/multiple-nics/role.role.j2.yaml @@ -0,0 +1,152 @@ +heat_template_version: queens +description: > + Software Config to drive os-net-config to configure multiple interfaces for the {{role.name}} role. +parameters: + ControlPlaneIp: + default: '' + description: IP address/subnet on the ctlplane network + type: string + {%- for network in networks %} + {{network.name}}IpSubnet: + default: '' + description: IP address/subnet on the {{network.name_lower}} network + type: string + {%- endfor %} + {%- for network in networks %} + {{network.name}}NetworkVlanID: + default: {{network.vlan}} + description: Vlan ID for the {{network.name_lower}} network traffic. + type: number + {%- endfor %} + ControlPlaneSubnetCidr: # Override this via parameter_defaults + default: '24' + description: The subnet CIDR of the control plane network. + type: string + ControlPlaneDefaultRoute: # Override this via parameter_defaults + description: The default route of the control plane network. + type: string +{%- for network in networks %} +{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ipv6}}' + description: default route for the {{network.name_lower}} network + type: string +{%- elif network.gateway_ip|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ip}}' + description: default route for the {{network.name_lower}} network + type: string +{%- endif %} +{%- endfor %} + DnsServers: # Override this via parameter_defaults + default: [] + description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. + type: comma_delimited_list + EC2MetadataIp: # Override this via parameter_defaults + description: The IP address of the EC2 metadata server. + type: string +{%- if role.name == 'ComputeOvsDpdk' %} + NumDpdkInterfaceRxQueues: + description: Number of Rx Queues required for DPDK bond or DPDK ports + default: 1 + type: number +{%- endif %} +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: + - type: interface + name: nic1 + use_dhcp: false + dns_servers: + get_param: DnsServers + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + - ip_netmask: 169.254.169.254/32 + next_hop: + get_param: EC2MetadataIp +{%- if role.default_route_networks is not defined or 'ControlPlane' in role.default_route_networks %} + - default: true + next_hop: + get_param: ControlPlaneDefaultRoute +{%- endif %} +{%- set nics_used = [1] %} +{%- for network in networks %} +{%- if network.name not in ["External", "Tenant"] %} +{%- if network.name in role.networks %} + - type: interface + name: nic{{loop.index + 1}} + use_dhcp: false + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet +{%- endif %} +{%- elif network.name in role.networks or role.name == 'Networker' %} + - type: ovs_bridge +{%- if network.name == "External" %} + name: bridge_name +{%- else %} + name: br-{{network.name_lower}} +{%- endif %} + dns_servers: + get_param: DnsServers + use_dhcp: false +{%- if network.name in role.networks %} + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet +{%- endif %} +{%- if network.name == role.default_route_network %} + routes: + - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute +{%- endif %} + members: + - type: interface + name: nic{{loop.index + 1}} + use_dhcp: false + primary: true +{%- endif %} +{#- This hack gets around Jinja scope limitations to update nics_used within loop. #} +{%- set _ = nics_used.append(loop.index) %} +{%- endfor %} +{%- if role.name == 'ComputeOvsDpdk' %} + # Used as a provider network with external DHCP + - type: ovs_user_bridge + name: br-dpdk0 + members: + - type: ovs_dpdk_bond + name: dpdkbond0 + rx_queue: + get_param: NumDpdkInterfaceRxQueues + members: + - type: ovs_dpdk_port + name: dpdk0 + members: + - type: interface + name: nic{{nics_used[-1] + 1}} + - type: ovs_dpdk_port + name: dpdk1 + members: + - type: interface + name: nic{{nics_used[-1] + 2}} +{%- endif %} +outputs: + OS::stack_id: + description: The OsNetConfigImpl resource. + value: + get_resource: OsNetConfigImpl \ No newline at end of file diff --git a/network/config/multiple-nics/swift-storage.yaml b/network/config/multiple-nics/swift-storage.yaml deleted file mode 100644 index 6c21323a53..0000000000 --- a/network/config/multiple-nics/swift-storage.yaml +++ /dev/null @@ -1,146 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure multiple interfaces for the swift storage role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: interface - name: nic1 - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - - type: interface - name: nic2 - use_dhcp: false - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: interface - name: nic3 - use_dhcp: false - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - - type: interface - name: nic4 - use_dhcp: false - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- - # type: interface - # name: nic7 - # use_dhcp: false - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/single-nic-linux-bridge-vlans/ceph-storage.yaml b/network/config/single-nic-linux-bridge-vlans/ceph-storage.yaml deleted file mode 100644 index dbc1c8f8b5..0000000000 --- a/network/config/single-nic-linux-bridge-vlans/ceph-storage.yaml +++ /dev/null @@ -1,147 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure VLANs for the ceph storage role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: linux_bridge - name: br-storage - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - members: - - type: interface - name: nic1 - # force the MAC address of the bridge to this interface - primary: true - - type: vlan - vlan_id: - get_param: StorageNetworkVlanID - device: br-storage - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: vlan - vlan_id: - get_param: StorageMgmtNetworkVlanID - device: br-storage - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- - # type: vlan - # vlan_id: {get_param: ManagementNetworkVlanID} - # device: br-storage - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/single-nic-linux-bridge-vlans/cinder-storage.yaml b/network/config/single-nic-linux-bridge-vlans/cinder-storage.yaml deleted file mode 100644 index 284b3ddc78..0000000000 --- a/network/config/single-nic-linux-bridge-vlans/cinder-storage.yaml +++ /dev/null @@ -1,154 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure VLANs for the cinder storage role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: linux_bridge - name: br-storage - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - members: - - type: interface - name: nic1 - # force the MAC address of the bridge to this interface - primary: true - - type: vlan - vlan_id: - get_param: InternalApiNetworkVlanID - device: br-storage - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - vlan_id: - get_param: StorageNetworkVlanID - device: br-storage - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: vlan - vlan_id: - get_param: StorageMgmtNetworkVlanID - device: br-storage - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- - # type: vlan - # vlan_id: {get_param: ManagementNetworkVlanID} - # device: br-storage - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/single-nic-linux-bridge-vlans/compute.yaml b/network/config/single-nic-linux-bridge-vlans/compute.yaml deleted file mode 100644 index 14d5732566..0000000000 --- a/network/config/single-nic-linux-bridge-vlans/compute.yaml +++ /dev/null @@ -1,157 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure VLANs for the compute role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: linux_bridge - name: bridge_name - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - members: - - type: interface - name: interface_name - # force the MAC address of the bridge to this interface - primary: true - - type: vlan - vlan_id: - get_param: InternalApiNetworkVlanID - device: bridge_name - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - vlan_id: - get_param: StorageNetworkVlanID - device: bridge_name - addresses: - - ip_netmask: - get_param: StorageIpSubnet - # Uncomment when including environments/hyperconverged-ceph.yaml - #- type: vlan - # vlan_id: {get_param: StorageMgmtNetworkVlanID} - # device: bridge_name - # addresses: - # - ip_netmask: {get_param: StorageMgmtIpSubnet} - - type: vlan - vlan_id: - get_param: TenantNetworkVlanID - device: bridge_name - addresses: - - ip_netmask: - get_param: TenantIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- type: vlan - # vlan_id: {get_param: ManagementNetworkVlanID} - # device: bridge_name - # addresses: - # - ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/single-nic-linux-bridge-vlans/controller-v6.yaml b/network/config/single-nic-linux-bridge-vlans/controller-v6.j2.yaml similarity index 72% rename from network/config/single-nic-linux-bridge-vlans/controller-v6.yaml rename to network/config/single-nic-linux-bridge-vlans/controller-v6.j2.yaml index 6130d875ea..99de9daa9b 100644 --- a/network/config/single-nic-linux-bridge-vlans/controller-v6.yaml +++ b/network/config/single-nic-linux-bridge-vlans/controller-v6.j2.yaml @@ -7,65 +7,34 @@ parameters: default: '' description: IP address/subnet on the ctlplane network type: string - ExternalIpSubnet: + {%- for network in networks %} + {{network.name}}IpSubnet: default: '' - description: IP address/subnet on the external network + description: IP address/subnet on the {{network.name_lower}} network type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. + {%- endfor %} + {%- for network in networks %} + {{network.name}}NetworkVlanID: + default: {{network.vlan}} + description: Vlan ID for the {{network.name_lower}} network traffic. type: number + {%- endfor %} ControlPlaneDefaultRoute: # Override this via parameter_defaults description: The default route of the control plane network. type: string - ExternalInterfaceDefaultRoute: - default: 10.0.0.1 - description: default route for the external network +{%- for network in networks %} +{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ipv6}}' + description: default route for the {{network.name_lower}} network type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. +{%- elif network.gateway_ip|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ip}}' + description: default route for the {{network.name_lower}} network type: string +{%- endif %} +{%- endfor %} ControlPlaneSubnetCidr: # Override this via parameter_defaults default: '24' description: The subnet CIDR of the control plane network. diff --git a/network/config/single-nic-linux-bridge-vlans/controller.yaml b/network/config/single-nic-linux-bridge-vlans/controller.yaml deleted file mode 100644 index a250572df3..0000000000 --- a/network/config/single-nic-linux-bridge-vlans/controller.yaml +++ /dev/null @@ -1,172 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure VLANs for the controller role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: - default: 10.0.0.1 - description: default route for the external network - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: linux_bridge - name: bridge_name - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - members: - - type: interface - name: interface_name - primary: true - - type: vlan - vlan_id: - get_param: ExternalNetworkVlanID - device: bridge_name - addresses: - - ip_netmask: - get_param: ExternalIpSubnet - routes: - - default: true - next_hop: - get_param: ExternalInterfaceDefaultRoute - - type: vlan - vlan_id: - get_param: InternalApiNetworkVlanID - device: bridge_name - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - vlan_id: - get_param: StorageNetworkVlanID - device: bridge_name - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: vlan - vlan_id: - get_param: StorageMgmtNetworkVlanID - device: bridge_name - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - - type: vlan - vlan_id: - get_param: TenantNetworkVlanID - device: bridge_name - addresses: - - ip_netmask: - get_param: TenantIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the External interface. This will - # make the External API unreachable from remote subnets. - #- - # type: vlan - # vlan_id: {get_param: ManagementNetworkVlanID} - # device: bridge_name - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/single-nic-linux-bridge-vlans/networker.yaml b/network/config/single-nic-linux-bridge-vlans/networker.yaml deleted file mode 100644 index 10d75107e0..0000000000 --- a/network/config/single-nic-linux-bridge-vlans/networker.yaml +++ /dev/null @@ -1,148 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure VLANs for a dedicated Neutron networker role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: - default: 10.0.0.1 - description: default route for the external network - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: linux_bridge - name: bridge_name - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - members: - - type: interface - # NOTE: "interface_name" will be replaced by the value of NeutronPublicInterface, - # default is "nic1". Set this value via parameter_defaults in an environment file. - name: interface_name - primary: true - - type: vlan - vlan_id: - get_param: InternalApiNetworkVlanID - device: bridge_name - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - vlan_id: - get_param: TenantNetworkVlanID - device: bridge_name - addresses: - - ip_netmask: - get_param: TenantIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane interface. - #- - # type: vlan - # vlan_id: {get_param: ManagementNetworkVlanID} - # device: bridge_name - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/single-nic-linux-bridge-vlans/role.role.j2.yaml b/network/config/single-nic-linux-bridge-vlans/role.role.j2.yaml new file mode 100644 index 0000000000..a67a3cfda1 --- /dev/null +++ b/network/config/single-nic-linux-bridge-vlans/role.role.j2.yaml @@ -0,0 +1,103 @@ +heat_template_version: queens +description: > + Software Config to drive os-net-config to configure VLANs for the {{role.name}} role. +parameters: + ControlPlaneIp: + default: '' + description: IP address/subnet on the ctlplane network + type: string + {%- for network in networks %} + {{network.name}}IpSubnet: + default: '' + description: IP address/subnet on the {{network.name_lower}} network + type: string + {%- endfor %} + {%- for network in networks %} + {{network.name}}NetworkVlanID: + default: {{network.vlan}} + description: Vlan ID for the {{network.name_lower}} network traffic. + type: number + {%- endfor %} + ControlPlaneSubnetCidr: # Override this via parameter_defaults + default: '24' + description: The subnet CIDR of the control plane network. + type: string + ControlPlaneDefaultRoute: # Override this via parameter_defaults + description: The default route of the control plane network. + type: string +{%- for network in networks %} +{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ipv6}}' + description: default route for the {{network.name_lower}} network + type: string +{%- elif network.gateway_ip|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ip}}' + description: default route for the {{network.name_lower}} network + type: string +{%- endif %} +{%- endfor %} + DnsServers: # Override this via parameter_defaults + default: [] + description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. + type: comma_delimited_list + EC2MetadataIp: # Override this via parameter_defaults + description: The IP address of the EC2 metadata server. + type: string +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: + - type: linux_bridge + name: bridge_name + use_dhcp: false + dns_servers: + get_param: DnsServers + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + - ip_netmask: 169.254.169.254/32 + next_hop: + get_param: EC2MetadataIp +{%- if role.default_route_networks is not defined or 'ControlPlane' in role.default_route_networks %} + - default: true + next_hop: + get_param: ControlPlaneDefaultRoute +{%- endif %} + members: + - type: interface + name: interface_name + primary: true +{%- for network in networks if network.enabled|default(true) and network.name in role.networks %} + - type: vlan + vlan_id: + get_param: {{network.name}}NetworkVlanID + device: bridge_name + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet +{%- if network.name in role.default_route_networks %} + routes: + - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute +{%- endif %} +{%- endfor %} +outputs: + OS::stack_id: + description: The OsNetConfigImpl resource. + value: + get_resource: OsNetConfigImpl diff --git a/network/config/single-nic-linux-bridge-vlans/swift-storage.yaml b/network/config/single-nic-linux-bridge-vlans/swift-storage.yaml deleted file mode 100644 index cdd693c6b7..0000000000 --- a/network/config/single-nic-linux-bridge-vlans/swift-storage.yaml +++ /dev/null @@ -1,154 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure VLANs for the swift storage role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: linux_bridge - name: br-storage - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - members: - - type: interface - name: nic1 - # force the MAC address of the bridge to this interface - primary: true - - type: vlan - vlan_id: - get_param: InternalApiNetworkVlanID - device: br-storage - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - vlan_id: - get_param: StorageNetworkVlanID - device: br-storage - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: vlan - vlan_id: - get_param: StorageMgmtNetworkVlanID - device: br-storage - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- - # type: vlan - # vlan_id: {get_param: ManagementNetworkVlanID} - # device: br-storage - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/single-nic-vlans/README.md b/network/config/single-nic-vlans/README.md index 4173862591..9f273ac002 100644 --- a/network/config/single-nic-vlans/README.md +++ b/network/config/single-nic-vlans/README.md @@ -1,5 +1,5 @@ This directory contains Heat templates to help configure -Vlans on a single NIC for each Overcloud role. +VLANs on a single NIC for each Overcloud role. There are two versions of the controller role template, one with an external network interface, and another without. If the @@ -33,8 +33,10 @@ Same as above except set the following value for the controller role: Configuration with System Management Network -------------------------------------------- -To enable the optional System Management network, create a Heat environment -that looks something like this: +The Management network is included for upgrade compatibility with +previous versions, but disabled. To enable the optional System +Management network, create a Heat environment that looks something like +this: resource\_registry: OS::TripleO::Network::Management: ../network/management.yaml @@ -47,3 +49,8 @@ that looks something like this: Or use this Heat environment file: environments/network-management.yaml + +Or, enable the Management network in network_data.yaml, and add the network +to the list of networks used by each role in the role definition file +(e.g. roles_data.yaml). Refer to installation documentation for procedure +to generate a role file for custom roles. \ No newline at end of file diff --git a/network/config/single-nic-vlans/ceph-storage.yaml b/network/config/single-nic-vlans/ceph-storage.yaml deleted file mode 100644 index 00777166f0..0000000000 --- a/network/config/single-nic-vlans/ceph-storage.yaml +++ /dev/null @@ -1,132 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure VLANs for the ceph storage role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: ovs_bridge - name: br-storage - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - members: - - type: interface - name: nic1 - # force the MAC address of the bridge to this interface - primary: true - - type: vlan - vlan_id: - get_param: StorageNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: vlan - vlan_id: - get_param: StorageMgmtNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- - # type: vlan - # vlan_id: {get_param: ManagementNetworkVlanID} - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/single-nic-vlans/cinder-storage.yaml b/network/config/single-nic-vlans/cinder-storage.yaml deleted file mode 100644 index 64d1e61969..0000000000 --- a/network/config/single-nic-vlans/cinder-storage.yaml +++ /dev/null @@ -1,142 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure VLANs for the cinder storage role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: ovs_bridge - name: br-storage - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - members: - - type: interface - name: nic1 - # force the MAC address of the bridge to this interface - primary: true - - type: vlan - vlan_id: - get_param: InternalApiNetworkVlanID - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - vlan_id: - get_param: StorageNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: vlan - vlan_id: - get_param: StorageMgmtNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- - # type: vlan - # vlan_id: {get_param: ManagementNetworkVlanID} - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/single-nic-vlans/compute.yaml b/network/config/single-nic-vlans/compute.yaml deleted file mode 100644 index 09a097c30b..0000000000 --- a/network/config/single-nic-vlans/compute.yaml +++ /dev/null @@ -1,148 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure VLANs for the compute role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: ovs_bridge - name: bridge_name - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - members: - - type: interface - name: nic1 - # force the MAC address of the bridge to this interface - primary: true - - type: vlan - vlan_id: - get_param: InternalApiNetworkVlanID - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - vlan_id: - get_param: StorageNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageIpSubnet - # Uncomment when including environments/hyperconverged-ceph.yaml - #- type: vlan - # vlan_id: {get_param: StorageMgmtNetworkVlanID} - # addresses: - # - ip_netmask: {get_param: StorageMgmtIpSubnet} - - type: vlan - vlan_id: - get_param: TenantNetworkVlanID - addresses: - - ip_netmask: - get_param: TenantIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- type: vlan - # vlan_id: {get_param: ManagementNetworkVlanID} - # addresses: - # - ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/single-nic-vlans/controller-no-external.j2.yaml b/network/config/single-nic-vlans/controller-no-external.j2.yaml new file mode 100644 index 0000000000..86842f0b0a --- /dev/null +++ b/network/config/single-nic-vlans/controller-no-external.j2.yaml @@ -0,0 +1,100 @@ +# NOTE: This template is now deprecated, and is only included for compatibility +# when upgrading a deployment where this template was originally used. For new +# deployments, remove the External network from the Controller role and set +# default_route_networks to ['ControlPlane']. +heat_template_version: queens +description: > + Software Config to drive os-net-config to configure VLANs for the controller role. No external IP is configured. +parameters: + ControlPlaneIp: + default: '' + description: IP address/subnet on the ctlplane network + type: string + {%- for network in networks %} + {{network.name}}IpSubnet: + default: '' + description: IP address/subnet on the {{network.name_lower}} network + type: string + {%- endfor %} + {%- for network in networks %} + {{network.name}}NetworkVlanID: + default: {{network.vlan}} + description: Vlan ID for the {{network.name_lower}} network traffic. + type: number + {%- endfor %} + ControlPlaneSubnetCidr: # Override this via parameter_defaults + default: '24' + description: The subnet CIDR of the control plane network. + type: string + ControlPlaneDefaultRoute: # Override this via parameter_defaults + description: The default route of the control plane network. + type: string +{%- for network in networks %} +{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ipv6}}' + description: default route for the {{network.name_lower}} network + type: string +{%- elif network.gateway_ip|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ip}}' + description: default route for the {{network.name_lower}} network + type: string +{%- endif %} +{%- endfor %} + DnsServers: # Override this via parameter_defaults + default: [] + description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. + type: comma_delimited_list + EC2MetadataIp: # Override this via parameter_defaults + description: The IP address of the EC2 metadata server. + type: string +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: + - type: ovs_bridge + name: bridge_name + use_dhcp: false + dns_servers: + get_param: DnsServers + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + - ip_netmask: 169.254.169.254/32 + next_hop: + get_param: EC2MetadataIp + - default: true + next_hop: + get_param: ControlPlaneDefaultRoute + members: + - type: interface + name: nic1 + # force the MAC address of the bridge to this interface + primary: true +{%- for network in networks if network.enabled|default(true) and network.name != 'External' %} + - type: vlan + vlan_id: + get_param: {{network.name}}NetworkVlanID + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet +{%- endfor %} +outputs: + OS::stack_id: + description: The OsNetConfigImpl resource. + value: + get_resource: OsNetConfigImpl + diff --git a/network/config/single-nic-vlans/controller-no-external.yaml b/network/config/single-nic-vlans/controller-no-external.yaml deleted file mode 100644 index 6b717c550b..0000000000 --- a/network/config/single-nic-vlans/controller-no-external.yaml +++ /dev/null @@ -1,156 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure VLANs for the controller role. No external IP is configured. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: - default: 10.0.0.1 - description: default route for the external network - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: ovs_bridge - name: bridge_name - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - members: - - type: interface - name: nic1 - # force the MAC address of the bridge to this interface - primary: true - - type: vlan - vlan_id: - get_param: InternalApiNetworkVlanID - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - vlan_id: - get_param: StorageNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: vlan - vlan_id: - get_param: StorageMgmtNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - - type: vlan - vlan_id: - get_param: TenantNetworkVlanID - addresses: - - ip_netmask: - get_param: TenantIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- - # type: vlan - # vlan_id: {get_param: ManagementNetworkVlanID} - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/single-nic-vlans/controller-v6.yaml b/network/config/single-nic-vlans/controller-v6.j2.yaml similarity index 71% rename from network/config/single-nic-vlans/controller-v6.yaml rename to network/config/single-nic-vlans/controller-v6.j2.yaml index fc28318680..15a47d99b2 100644 --- a/network/config/single-nic-vlans/controller-v6.yaml +++ b/network/config/single-nic-vlans/controller-v6.j2.yaml @@ -7,54 +7,18 @@ parameters: default: '' description: IP address/subnet on the ctlplane network type: string - ExternalIpSubnet: + {%- for network in networks %} + {{network.name}}IpSubnet: default: '' - description: IP address/subnet on the external network + description: IP address/subnet on the {{network.name_lower}} network type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. + {%- endfor %} + {%- for network in networks %} + {{network.name}}NetworkVlanID: + default: {{network.vlan}} + description: Vlan ID for the {{network.name_lower}} network traffic. type: number + {%- endfor %} ControlPlaneSubnetCidr: # Override this via parameter_defaults default: '24' description: The subnet CIDR of the control plane network. @@ -62,14 +26,19 @@ parameters: ControlPlaneDefaultRoute: # Override this via parameter_defaults description: The default route of the control plane network. type: string - ExternalInterfaceDefaultRoute: - default: 10.0.0.1 - description: default route for the external network +{%- for network in networks %} +{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ipv6}}' + description: default route for the {{network.name_lower}} network type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. +{%- elif network.gateway_ip|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ip}}' + description: default route for the {{network.name_lower}} network type: string +{%- endif %} +{%- endfor %} DnsServers: # Override this via parameter_defaults default: [] description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. diff --git a/network/config/single-nic-vlans/controller.yaml b/network/config/single-nic-vlans/controller.yaml deleted file mode 100644 index 54968f8445..0000000000 --- a/network/config/single-nic-vlans/controller.yaml +++ /dev/null @@ -1,164 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure VLANs for the controller role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: - default: 10.0.0.1 - description: default route for the external network - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: ovs_bridge - name: bridge_name - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - members: - - type: interface - name: nic1 - # force the MAC address of the bridge to this interface - primary: true - - type: vlan - vlan_id: - get_param: ExternalNetworkVlanID - addresses: - - ip_netmask: - get_param: ExternalIpSubnet - routes: - - default: true - next_hop: - get_param: ExternalInterfaceDefaultRoute - - type: vlan - vlan_id: - get_param: InternalApiNetworkVlanID - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - vlan_id: - get_param: StorageNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: vlan - vlan_id: - get_param: StorageMgmtNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - - type: vlan - vlan_id: - get_param: TenantNetworkVlanID - addresses: - - ip_netmask: - get_param: TenantIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the External interface. This will - # make the External API unreachable from remote subnets. - #- - # type: vlan - # vlan_id: {get_param: ManagementNetworkVlanID} - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/single-nic-vlans/networker.yaml b/network/config/single-nic-vlans/networker.yaml deleted file mode 100644 index 1615295bba..0000000000 --- a/network/config/single-nic-vlans/networker.yaml +++ /dev/null @@ -1,144 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure VLANs for a dedicated Neutron networker role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - ExternalNetworkVlanID: - default: 10 - description: Vlan ID for the external network traffic. - type: number - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - TenantNetworkVlanID: - default: 50 - description: Vlan ID for the tenant network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: - default: 10.0.0.1 - description: default route for the external network - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: ovs_bridge - name: bridge_name - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - members: - - type: interface - name: nic1 - # force the MAC address of the bridge to this interface - primary: true - - type: vlan - vlan_id: - get_param: InternalApiNetworkVlanID - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - vlan_id: - get_param: TenantNetworkVlanID - addresses: - - ip_netmask: - get_param: TenantIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane interface. - #- - # type: vlan - # vlan_id: {get_param: ManagementNetworkVlanID} - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/config/single-nic-vlans/role.role.j2.yaml b/network/config/single-nic-vlans/role.role.j2.yaml new file mode 100644 index 0000000000..226535e528 --- /dev/null +++ b/network/config/single-nic-vlans/role.role.j2.yaml @@ -0,0 +1,103 @@ +heat_template_version: queens +description: > + Software Config to drive os-net-config to configure VLANs for the {{role.name}} role. +parameters: + ControlPlaneIp: + default: '' + description: IP address/subnet on the ctlplane network + type: string + {%- for network in networks %} + {{network.name}}IpSubnet: + default: '' + description: IP address/subnet on the {{network.name_lower}} network + type: string + {%- endfor %} + {%- for network in networks %} + {{network.name}}NetworkVlanID: + default: {{network.vlan}} + description: Vlan ID for the {{network.name_lower}} network traffic. + type: number + {%- endfor %} + ControlPlaneSubnetCidr: # Override this via parameter_defaults + default: '24' + description: The subnet CIDR of the control plane network. + type: string + ControlPlaneDefaultRoute: # Override this via parameter_defaults + description: The default route of the control plane network. + type: string +{%- for network in networks %} +{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ipv6}}' + description: default route for the {{network.name_lower}} network + type: string +{%- elif network.gateway_ip|default(false) %} + {{network.name}}InterfaceDefaultRoute: + default: '{{network.gateway_ip}}' + description: default route for the {{network.name_lower}} network + type: string +{%- endif %} +{%- endfor %} + DnsServers: # Override this via parameter_defaults + default: [] + description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. + type: comma_delimited_list + EC2MetadataIp: # Override this via parameter_defaults + description: The IP address of the EC2 metadata server. + type: string +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: + - type: ovs_bridge + name: bridge_name + use_dhcp: false + dns_servers: + get_param: DnsServers + addresses: + - ip_netmask: + list_join: + - / + - - get_param: ControlPlaneIp + - get_param: ControlPlaneSubnetCidr + routes: + - ip_netmask: 169.254.169.254/32 + next_hop: + get_param: EC2MetadataIp +{%- if role.default_route_networks is not defined or 'ControlPlane' in role.default_route_networks %} + - default: true + next_hop: + get_param: ControlPlaneDefaultRoute +{%- endif %} + members: + - type: interface + name: nic1 + # force the MAC address of the bridge to this interface + primary: true +{%- for network in networks if network.enabled|default(true) and network.name in role.networks %} + - type: vlan + vlan_id: + get_param: {{network.name}}NetworkVlanID + addresses: + - ip_netmask: + get_param: {{network.name}}IpSubnet +{%- if network.name in role.default_route_network %} + routes: + - default: true + next_hop: + get_param: {{network.name}}InterfaceDefaultRoute +{%- endif %} +{%- endfor %} +outputs: + OS::stack_id: + description: The OsNetConfigImpl resource. + value: + get_resource: OsNetConfigImpl diff --git a/network/config/single-nic-vlans/swift-storage.yaml b/network/config/single-nic-vlans/swift-storage.yaml deleted file mode 100644 index 53c934037a..0000000000 --- a/network/config/single-nic-vlans/swift-storage.yaml +++ /dev/null @@ -1,142 +0,0 @@ -heat_template_version: queens -description: > - Software Config to drive os-net-config to configure VLANs for the swift storage role. -parameters: - ControlPlaneIp: - default: '' - description: IP address/subnet on the ctlplane network - type: string - ExternalIpSubnet: - default: '' - description: IP address/subnet on the external network - type: string - InternalApiIpSubnet: - default: '' - description: IP address/subnet on the internal_api network - type: string - StorageIpSubnet: - default: '' - description: IP address/subnet on the storage network - type: string - StorageMgmtIpSubnet: - default: '' - description: IP address/subnet on the storage_mgmt network - type: string - TenantIpSubnet: - default: '' - description: IP address/subnet on the tenant network - type: string - ManagementIpSubnet: # Only populated when including environments/network-management.yaml - default: '' - description: IP address/subnet on the management network - type: string - InternalApiNetworkVlanID: - default: 20 - description: Vlan ID for the internal_api network traffic. - type: number - StorageNetworkVlanID: - default: 30 - description: Vlan ID for the storage network traffic. - type: number - StorageMgmtNetworkVlanID: - default: 40 - description: Vlan ID for the storage mgmt network traffic. - type: number - ManagementNetworkVlanID: - default: 60 - description: Vlan ID for the management network traffic. - type: number - ControlPlaneSubnetCidr: # Override this via parameter_defaults - default: '24' - description: The subnet CIDR of the control plane network. - type: string - ControlPlaneDefaultRoute: # Override this via parameter_defaults - description: The default route of the control plane network. - type: string - ExternalInterfaceDefaultRoute: # Not used by default in this template - default: 10.0.0.1 - description: The default route of the external network. - type: string - ManagementInterfaceDefaultRoute: # Commented out by default in this template - default: unset - description: The default route of the management network. - type: string - DnsServers: # Override this via parameter_defaults - default: [] - description: A list of DNS servers (2 max for some implementations) that will be added to resolv.conf. - type: comma_delimited_list - EC2MetadataIp: # Override this via parameter_defaults - description: The IP address of the EC2 metadata server. - type: string -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: - - type: ovs_bridge - name: br-storage - use_dhcp: false - dns_servers: - get_param: DnsServers - addresses: - - ip_netmask: - list_join: - - / - - - get_param: ControlPlaneIp - - get_param: ControlPlaneSubnetCidr - routes: - - ip_netmask: 169.254.169.254/32 - next_hop: - get_param: EC2MetadataIp - - default: true - next_hop: - get_param: ControlPlaneDefaultRoute - members: - - type: interface - name: nic1 - # force the MAC address of the bridge to this interface - primary: true - - type: vlan - vlan_id: - get_param: InternalApiNetworkVlanID - addresses: - - ip_netmask: - get_param: InternalApiIpSubnet - - type: vlan - vlan_id: - get_param: StorageNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageIpSubnet - - type: vlan - vlan_id: - get_param: StorageMgmtNetworkVlanID - addresses: - - ip_netmask: - get_param: StorageMgmtIpSubnet - # Uncomment when including environments/network-management.yaml - # If setting default route on the Management interface, comment - # out the default route on the Control Plane. - #- - # type: vlan - # vlan_id: {get_param: ManagementNetworkVlanID} - # addresses: - # - - # ip_netmask: {get_param: ManagementIpSubnet} - # routes: - # - - # default: true - # next_hop: {get_param: ManagementInterfaceDefaultRoute} -outputs: - OS::stack_id: - description: The OsNetConfigImpl resource. - value: - get_resource: OsNetConfigImpl - diff --git a/network/network.j2 b/network/network.j2 index 1e99de7c8d..04d6c73e61 100644 --- a/network/network.j2 +++ b/network/network.j2 @@ -67,8 +67,8 @@ parameters: type: string {%- if network.vlan %} {{network.name}}NetworkVlanID: - default: {{network.vlan}} - description: Vlan ID for the {{network.name}} network traffic. + default: {{network.vlan|default('')}} + description: Vlan ID for the {{network.name_lower}} network traffic. type: number {%- endif %} diff --git a/network_data.yaml b/network_data.yaml index 90293ab346..a3a14b65e6 100644 --- a/network_data.yaml +++ b/network_data.yaml @@ -6,6 +6,7 @@ # name_lower: lowercase version of name used for filenames # (optional, defaults to name.lower()) # enabled: Is the network enabled (optional, defaults to true) +# NOTE: False will use noop.yaml for unused legacy networks to support upgrades. # vlan: vlan for the network (optional) # vip: Enable creation of a virtual IP on this network # ip_subnet: IP/CIDR, e.g. '192.168.24.0/24' or '2001:db8:fd00:1000::/64' @@ -40,51 +41,65 @@ # ipv6: true, and the network/.yaml file will be configured as IPv6. # # For configuring both IPv4 and IPv6 on the same interface, use two separate -# networks, and then assign both IPs in the custom NIC configuration templates. +# networks, and then assign both IPs to the same interface in a custom NIC +# configuration templates. +# +# The ordering of the networks below will determine the order in which NICs +# are assigned in the network/config/multiple-nics templates, beginning with +# NIC2, Control Plane is always NIC1. -- name: External - vip: true - name_lower: external - ip_subnet: '10.0.0.0/24' - allocation_pools: [{'start': '10.0.0.4', 'end': '10.0.0.250'}] - gateway_ip: '10.0.0.1' - ipv6_subnet: '2001:db8:fd00:1000::/64' - ipv6_allocation_pools: [{'start': '2001:db8:fd00:1000::10', 'end': '2001:db8:fd00:1000:ffff:ffff:ffff:fffe'}] - gateway_ipv6: '2001:db8:fd00:1000::1' -- name: InternalApi - name_lower: internal_api - vip: true - ip_subnet: '172.16.2.0/24' - allocation_pools: [{'start': '172.16.2.4', 'end': '172.16.2.250'}] - ipv6_subnet: 'fd00:fd00:fd00:2000::/64' - ipv6_allocation_pools: [{'start': 'fd00:fd00:fd00:2000::10', 'end': 'fd00:fd00:fd00:2000:ffff:ffff:ffff:fffe'}] - name: Storage vip: true + vlan: 30 name_lower: storage - ip_subnet: '172.16.1.0/24' - allocation_pools: [{'start': '172.16.1.4', 'end': '172.16.1.250'}] + ip_subnet: '172.18.0.0/24' + allocation_pools: [{'start': '172.18.0.10', 'end': '172.18.0.250'}] ipv6_subnet: 'fd00:fd00:fd00:3000::/64' ipv6_allocation_pools: [{'start': 'fd00:fd00:fd00:3000::10', 'end': 'fd00:fd00:fd00:3000:ffff:ffff:ffff:fffe'}] - name: StorageMgmt name_lower: storage_mgmt vip: true - ip_subnet: '172.16.3.0/24' - allocation_pools: [{'start': '172.16.3.4', 'end': '172.16.3.250'}] + vlan: 40 + ip_subnet: '172.19.0.0/24' + allocation_pools: [{'start': '172.19.0.10', 'end': '172.19.0.250'}] ipv6_subnet: 'fd00:fd00:fd00:4000::/64' ipv6_allocation_pools: [{'start': 'fd00:fd00:fd00:4000::10', 'end': 'fd00:fd00:fd00:4000:ffff:ffff:ffff:fffe'}] +- name: InternalApi + name_lower: internal_api + vip: true + vlan: 20 + ip_subnet: '172.17.0.0/24' + allocation_pools: [{'start': '172.17.0.10', 'end': '172.17.0.250'}] + ipv6_subnet: 'fd00:fd00:fd00:2000::/64' + ipv6_allocation_pools: [{'start': 'fd00:fd00:fd00:2000::10', 'end': 'fd00:fd00:fd00:2000:ffff:ffff:ffff:fffe'}] - name: Tenant vip: false # Tenant network does not use VIPs name_lower: tenant + vlan: 50 ip_subnet: '172.16.0.0/24' - allocation_pools: [{'start': '172.16.0.4', 'end': '172.16.0.250'}] + allocation_pools: [{'start': '172.16.0.10', 'end': '172.16.0.250'}] + # Note that tenant tunneling is only compatible with IPv4 addressing at this time. ipv6_subnet: 'fd00:fd00:fd00:5000::/64' ipv6_allocation_pools: [{'start': 'fd00:fd00:fd00:5000::10', 'end': 'fd00:fd00:fd00:5000:ffff:ffff:ffff:fffe'}] +- name: External + vip: true + name_lower: external + vlan: 10 + ip_subnet: '10.0.0.0/24' + allocation_pools: [{'start': '10.0.0.10', 'end': '10.0.0.50'}] + gateway_ip: '10.0.0.1' + ipv6_subnet: '2001:db8:fd00:1000::/64' + ipv6_allocation_pools: [{'start': '2001:db8:fd00:1000::10', 'end': '2001:db8:fd00:1000:ffff:ffff:ffff:fffe'}] + gateway_ipv6: '2001:db8:fd00:1000::1' - name: Management - # Management network is enabled by default for backwards-compatibility, but - # is not included in any roles by default. Add to role definitions to use. - enabled: true + # Management network is included for backwards-compatibility, but + # is not enabled or included in any role definitions by default. + # Include environments/network-management yaml to override, or + # enable this network and add it to the roles in roles_data.yaml. + enabled: false vip: false # Management network does not use VIPs name_lower: management + vlan: 60 ip_subnet: '10.0.1.0/24' allocation_pools: [{'start': '10.0.1.4', 'end': '10.0.1.250'}] ipv6_subnet: 'fd00:fd00:fd00:6000::/64' diff --git a/network_data_ganesha.yaml b/network_data_ganesha.yaml index 8e2df2b9b5..5f182fc2fc 100644 --- a/network_data_ganesha.yaml +++ b/network_data_ganesha.yaml @@ -1,7 +1,4 @@ -# Like network_data.yaml but adds and enables StorageNFS network, -# used by manila with ceph-NFS back end. -# -## List of networks, used for j2 templating of enabled networks +# List of networks, used for j2 templating of enabled networks # # Supported values: # @@ -9,6 +6,7 @@ # name_lower: lowercase version of name used for filenames # (optional, defaults to name.lower()) # enabled: Is the network enabled (optional, defaults to true) +# NOTE: False will use noop.yaml for unused legacy networks to support upgrades. # vlan: vlan for the network (optional) # vip: Enable creation of a virtual IP on this network # ip_subnet: IP/CIDR, e.g. '192.168.24.0/24' or '2001:db8:fd00:1000::/64' @@ -43,51 +41,65 @@ # ipv6: true, and the network/.yaml file will be configured as IPv6. # # For configuring both IPv4 and IPv6 on the same interface, use two separate -# networks, and then assign both IPs in the custom NIC configuration templates. +# networks, and then assign both IPs to the same interface in a custom NIC +# configuration templates. +# +# The ordering of the networks below will determine the order in which NICs +# are assigned in the network/config/multiple-nics templates, beginning with +# NIC2, Control Plane is always NIC1. -- name: External - vip: true - name_lower: external - ip_subnet: '10.0.0.0/24' - allocation_pools: [{'start': '10.0.0.4', 'end': '10.0.0.250'}] - gateway_ip: '10.0.0.1' - ipv6_subnet: '2001:db8:fd00:1000::/64' - ipv6_allocation_pools: [{'start': '2001:db8:fd00:1000::10', 'end': '2001:db8:fd00:1000:ffff:ffff:ffff:fffe'}] - gateway_ipv6: '2001:db8:fd00:1000::1' -- name: InternalApi - name_lower: internal_api - vip: true - ip_subnet: '172.16.2.0/24' - allocation_pools: [{'start': '172.16.2.4', 'end': '172.16.2.250'}] - ipv6_subnet: 'fd00:fd00:fd00:2000::/64' - ipv6_allocation_pools: [{'start': 'fd00:fd00:fd00:2000::10', 'end': 'fd00:fd00:fd00:2000:ffff:ffff:ffff:fffe'}] - name: Storage vip: true + vlan: 30 name_lower: storage - ip_subnet: '172.16.1.0/24' - allocation_pools: [{'start': '172.16.1.4', 'end': '172.16.1.250'}] + ip_subnet: '172.18.0.0/24' + allocation_pools: [{'start': '172.18.0.10', 'end': '172.18.0.250'}] ipv6_subnet: 'fd00:fd00:fd00:3000::/64' ipv6_allocation_pools: [{'start': 'fd00:fd00:fd00:3000::10', 'end': 'fd00:fd00:fd00:3000:ffff:ffff:ffff:fffe'}] - name: StorageMgmt name_lower: storage_mgmt vip: true - ip_subnet: '172.16.3.0/24' - allocation_pools: [{'start': '172.16.3.4', 'end': '172.16.3.250'}] + vlan: 40 + ip_subnet: '172.19.0.0/24' + allocation_pools: [{'start': '172.19.0.10', 'end': '172.19.0.250'}] ipv6_subnet: 'fd00:fd00:fd00:4000::/64' ipv6_allocation_pools: [{'start': 'fd00:fd00:fd00:4000::10', 'end': 'fd00:fd00:fd00:4000:ffff:ffff:ffff:fffe'}] +- name: InternalApi + name_lower: internal_api + vip: true + vlan: 20 + ip_subnet: '172.17.0.0/24' + allocation_pools: [{'start': '172.17.0.10', 'end': '172.17.0.250'}] + ipv6_subnet: 'fd00:fd00:fd00:2000::/64' + ipv6_allocation_pools: [{'start': 'fd00:fd00:fd00:2000::10', 'end': 'fd00:fd00:fd00:2000:ffff:ffff:ffff:fffe'}] - name: Tenant vip: false # Tenant network does not use VIPs name_lower: tenant + vlan: 50 ip_subnet: '172.16.0.0/24' - allocation_pools: [{'start': '172.16.0.4', 'end': '172.16.0.250'}] + allocation_pools: [{'start': '172.16.0.10', 'end': '172.16.0.250'}] + # Note that tenant tunneling is only compatible with IPv4 addressing at this time. ipv6_subnet: 'fd00:fd00:fd00:5000::/64' ipv6_allocation_pools: [{'start': 'fd00:fd00:fd00:5000::10', 'end': 'fd00:fd00:fd00:5000:ffff:ffff:ffff:fffe'}] +- name: External + vip: true + name_lower: external + vlan: 10 + ip_subnet: '10.0.0.0/24' + allocation_pools: [{'start': '10.0.0.10', 'end': '10.0.0.50'}] + gateway_ip: '10.0.0.1' + ipv6_subnet: '2001:db8:fd00:1000::/64' + ipv6_allocation_pools: [{'start': '2001:db8:fd00:1000::10', 'end': '2001:db8:fd00:1000:ffff:ffff:ffff:fffe'}] + gateway_ipv6: '2001:db8:fd00:1000::1' - name: Management - # Management network is enabled by default for backwards-compatibility, but - # is not included in any roles by default. Add to role definitions to use. - enabled: true + # Management network is included for backwards-compatibility, but + # is not enabled or included in any role definitions by default. + # Include environments/network-management yaml to override, or + # enable this network and add it to the roles in roles_data.yaml. + enabled: false vip: false # Management network does not use VIPs name_lower: management + vlan: 60 ip_subnet: '10.0.1.0/24' allocation_pools: [{'start': '10.0.1.4', 'end': '10.0.1.250'}] ipv6_subnet: 'fd00:fd00:fd00:6000::/64' @@ -96,6 +108,7 @@ enabled: true vip: true name_lower: storage_nfs + vlan: 70 ip_subnet: '172.16.4.0/24' allocation_pools: [{'start': '172.16.4.4', 'end': '172.16.4.250'}] ipv6_subnet: 'fd00:fd00:fd00:7000::/64' diff --git a/roles/BlockStorage.yaml b/roles/BlockStorage.yaml index 6ebeff793d..1a100377f9 100644 --- a/roles/BlockStorage.yaml +++ b/roles/BlockStorage.yaml @@ -8,6 +8,8 @@ - InternalApi - Storage - StorageMgmt + uses_deprecated_params: True + deprecated_nic_config_name: 'cinder-storage.yaml' ServicesDefault: - OS::TripleO::Services::Aide - OS::TripleO::Services::AuditD diff --git a/roles/CephStorage.yaml b/roles/CephStorage.yaml index 17734fa6ac..253c2bf7f1 100644 --- a/roles/CephStorage.yaml +++ b/roles/CephStorage.yaml @@ -7,6 +7,8 @@ networks: - Storage - StorageMgmt + uses_deprecated_params: True + deprecated_nic_config_name: 'ceph-storage.yaml' ServicesDefault: - OS::TripleO::Services::Aide - OS::TripleO::Services::AuditD diff --git a/roles/Compute.yaml b/roles/Compute.yaml index d2de5fa61d..53ed8ce73f 100644 --- a/roles/Compute.yaml +++ b/roles/Compute.yaml @@ -19,6 +19,7 @@ deprecated_param_scheduler_hints: 'NovaComputeSchedulerHints' deprecated_param_ips: 'NovaComputeIPs' deprecated_server_resource_name: 'NovaCompute' + deprecated_nic_config_name: 'compute.yaml' disable_upgrade_deployment: True ServicesDefault: - OS::TripleO::Services::Aide diff --git a/roles/ComputeOvsDpdk.yaml b/roles/ComputeOvsDpdk.yaml index 68c61c15db..44aa8703b0 100644 --- a/roles/ComputeOvsDpdk.yaml +++ b/roles/ComputeOvsDpdk.yaml @@ -11,6 +11,8 @@ - Storage HostnameFormatDefault: '%stackname%-computeovsdpdk-%index%' disable_upgrade_deployment: True + uses_deprecated_params: True + deprecated_nic_config_name: 'compute-dpdk.yaml' ServicesDefault: - OS::TripleO::Services::Aide - OS::TripleO::Services::AuditD diff --git a/roles/Controller.yaml b/roles/Controller.yaml index 5503a8ce12..ec3bf5a49c 100644 --- a/roles/Controller.yaml +++ b/roles/Controller.yaml @@ -15,6 +15,9 @@ - Storage - StorageMgmt - Tenant + # For systems with both IPv4 and IPv6, you may specify a gateway network for + # each, such as ['ControlPlane', 'External'] + default_route_networks: ['External'] HostnameFormatDefault: '%stackname%-controller-%index%' # Deprecated & backward-compatible values (FIXME: Make parameters consistent) # Set uses_deprecated_params to True if any deprecated params are used. @@ -22,6 +25,7 @@ deprecated_param_extraconfig: 'controllerExtraConfig' deprecated_param_flavor: 'OvercloudControlFlavor' deprecated_param_image: 'controllerImage' + deprecated_nic_config_name: 'controller.yaml' ServicesDefault: - OS::TripleO::Services::Aide - OS::TripleO::Services::AodhApi diff --git a/roles/ControllerAllNovaStandalone.yaml b/roles/ControllerAllNovaStandalone.yaml index caf1638f37..da91c9d5cd 100644 --- a/roles/ControllerAllNovaStandalone.yaml +++ b/roles/ControllerAllNovaStandalone.yaml @@ -15,6 +15,7 @@ - Storage - StorageMgmt - Tenant + default_route_networks: ['External'] HostnameFormatDefault: '%stackname%-controller-%index%' ServicesDefault: - OS::TripleO::Services::AodhApi diff --git a/roles/ControllerNoCeph.yaml b/roles/ControllerNoCeph.yaml index 94ea80b4c2..6dd930fe60 100644 --- a/roles/ControllerNoCeph.yaml +++ b/roles/ControllerNoCeph.yaml @@ -15,6 +15,7 @@ - Storage - StorageMgmt - Tenant + default_route_networks: ['External'] HostnameFormatDefault: '%stackname%-controller-no-ceph-%index%' # Deprecated & backward-compatible values (FIXME: Make parameters consistent) # Set uses_deprecated_params to True if any deprecated params are used. diff --git a/roles/ControllerNovaStandalone.yaml b/roles/ControllerNovaStandalone.yaml index 8369f05ce3..770b325c78 100644 --- a/roles/ControllerNovaStandalone.yaml +++ b/roles/ControllerNovaStandalone.yaml @@ -14,6 +14,7 @@ - Storage - StorageMgmt - Tenant + default_route_networks: ['External'] HostnameFormatDefault: '%stackname%-controller-%index%' ServicesDefault: - OS::TripleO::Services::AodhApi diff --git a/roles/ControllerOpenstack.yaml b/roles/ControllerOpenstack.yaml index a778bd2cee..8b4b86426c 100644 --- a/roles/ControllerOpenstack.yaml +++ b/roles/ControllerOpenstack.yaml @@ -15,6 +15,7 @@ - Storage - StorageMgmt - Tenant + default_route_networks: ['External'] HostnameFormatDefault: '%stackname%-controller-%index%' ServicesDefault: - OS::TripleO::Services::Aide diff --git a/roles/ObjectStorage.yaml b/roles/ObjectStorage.yaml index d50e4de84e..01ce9c9d05 100644 --- a/roles/ObjectStorage.yaml +++ b/roles/ObjectStorage.yaml @@ -15,6 +15,7 @@ deprecated_param_ips: 'SwiftStorageIPs' deprecated_param_image: 'SwiftStorageImage' deprecated_param_flavor: 'OvercloudSwiftStorageFlavor' + deprecated_nic_config_name: 'swift-storage.yaml' disable_upgrade_deployment: True ServicesDefault: - OS::TripleO::Services::Aide diff --git a/roles_data.yaml b/roles_data.yaml index 03f25d4fe1..71d2aba03f 100644 --- a/roles_data.yaml +++ b/roles_data.yaml @@ -18,6 +18,9 @@ - Storage - StorageMgmt - Tenant + # For systems with both IPv4 and IPv6, you may specify a gateway network for + # each, such as ['ControlPlane', 'External'] + default_route_networks: ['External'] HostnameFormatDefault: '%stackname%-controller-%index%' # Deprecated & backward-compatible values (FIXME: Make parameters consistent) # Set uses_deprecated_params to True if any deprecated params are used. @@ -25,6 +28,7 @@ deprecated_param_extraconfig: 'controllerExtraConfig' deprecated_param_flavor: 'OvercloudControlFlavor' deprecated_param_image: 'controllerImage' + deprecated_nic_config_name: 'controller.yaml' ServicesDefault: - OS::TripleO::Services::Aide - OS::TripleO::Services::AodhApi @@ -183,6 +187,7 @@ deprecated_param_scheduler_hints: 'NovaComputeSchedulerHints' deprecated_param_ips: 'NovaComputeIPs' deprecated_server_resource_name: 'NovaCompute' + deprecated_nic_config_name: 'compute.yaml' disable_upgrade_deployment: True ServicesDefault: - OS::TripleO::Services::Aide @@ -238,6 +243,8 @@ - InternalApi - Storage - StorageMgmt + uses_deprecated_params: True + deprecated_nic_config_name: 'cinder-storage.yaml' ServicesDefault: - OS::TripleO::Services::Aide - OS::TripleO::Services::AuditD @@ -283,6 +290,7 @@ deprecated_param_ips: 'SwiftStorageIPs' deprecated_param_image: 'SwiftStorageImage' deprecated_param_flavor: 'OvercloudSwiftStorageFlavor' + deprecated_nic_config_name: 'swift-storage.yaml' disable_upgrade_deployment: True ServicesDefault: - OS::TripleO::Services::Aide @@ -320,6 +328,8 @@ networks: - Storage - StorageMgmt + uses_deprecated_params: True + deprecated_nic_config_name: 'ceph-storage.yaml' ServicesDefault: - OS::TripleO::Services::Aide - OS::TripleO::Services::AuditD diff --git a/tools/process-templates.py b/tools/process-templates.py index 5e97eaec6c..39622864d3 100755 --- a/tools/process-templates.py +++ b/tools/process-templates.py @@ -183,6 +183,14 @@ def process_templates(template_path, role_data_path, output_dir, os.path.basename(f).replace('.role.j2.yaml', '.yaml')]) out_f_path = os.path.join(out_dir, out_f) + if ('network/config' in file_path and + r_map[role].get('deprecated_nic_config_name')): + d_name = r_map[role].get( + 'deprecated_nic_config_name') + out_f_path = os.path.join(out_dir, d_name) + elif ('network/config' in file_path): + d_name = "%s.yaml" % role.lower() + out_f_path = os.path.join(out_dir, d_name) if not (out_f_path in excl_templates): if '{{role.name}}' in template_data: j2_data = {'role': r_map[role], @@ -201,7 +209,7 @@ def process_templates(template_path, role_data_path, output_dir, False): j2_data['disable_constraints'] = True _j2_render_to_file( - template_data,j2_data, + template_data, j2_data, out_f_path, overwrite) else: