From a43f2a4d49e4d0ca13082ddddd0d111dddb3bd4b Mon Sep 17 00:00:00 2001 From: Bohdan Dobrelia Date: Fri, 11 Oct 2024 12:33:40 +0200 Subject: [PATCH] tripleo muilti-cell: conditionally use ext net Move the role generation and external networks removal snippet from ceph.sh to the main tripleo.sh script, and make it controled by the TRIPLEO_NETWORKING flag. Also add the HCI role to the main roles file, so that other roles defined there may still be used in HCI Ceph topology. Add attach_external_net j2 var based on the TRIPLEO_NETWORKING value. Multi-node adoption CI jobs deploy tripleo isolnet w/o external network historically, so it would use TRIPLEO_NETWORKING=false. For local setups, one might want to use it. Signed-off-by: Bohdan Dobrelia --- devsetup/scripts/tripleo.sh | 2 ++ devsetup/tripleo/ceph.sh | 8 ------- .../tripleo/config-download-multistack.j2 | 21 ++++++++++++++++--- devsetup/tripleo/tripleo_install.sh | 13 +++++++++++- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/devsetup/scripts/tripleo.sh b/devsetup/scripts/tripleo.sh index 19d8430d..42ee5c04 100755 --- a/devsetup/scripts/tripleo.sh +++ b/devsetup/scripts/tripleo.sh @@ -97,6 +97,7 @@ export OCTAVIA_ENABLED=${OCTAVIA_ENABLED} export TELEMETRY_ENABLED=${TELEMETRY_ENABLED:-true} export TLSE_ENABLED=${TLSE_ENABLED:-false} export CLOUD_DOMAIN=${CLOUD_DOMAIN:-localdomain} +export TRIPLEO_NETWORKING=${TRIPLEO_NETWORKING:-true} set +x if [ ! -f \$HOME/containers-prepare-parameters.yaml ]; then @@ -165,6 +166,7 @@ interface_mtu: ${INTERFACE_MTU:-1500} ntp_server: ${NTP_SERVER} gateway_ip: ${GATEWAY} manage_default_route: ${TRIPLEO_NETWORKING} +attach_external_net: ${TRIPLEO_NETWORKING} dns_server: ${PRIMARY_RESOLV_CONF_ENTRY} user_home: /home/zuul cloud_domain: ${CLOUD_DOMAIN} diff --git a/devsetup/tripleo/ceph.sh b/devsetup/tripleo/ceph.sh index af176ead..2bd3fa55 100755 --- a/devsetup/tripleo/ceph.sh +++ b/devsetup/tripleo/ceph.sh @@ -38,14 +38,6 @@ data_devices: - /dev/ceph_vg0/ceph_lv0 EOF -# create roles file -openstack overcloud roles generate Controller ComputeHCI > roles.yaml - -# disable external gateway for controller nodes -sed -i "s/default_route_networks: \['External'\]/default_route_networks: \['ControlPlane'\]/" roles.yaml -sed -i "/External:/d" roles.yaml -sed -i "/subnet: external_subnet/d" roles.yaml - # NOTE: TripleO has the hardcoded --yes-i-know option that is not valid anymore # in RHCS 7. TripleO does not receive any new patch both upstream and downstream # (it is a retired project), hence the only option we have is to patch the diff --git a/devsetup/tripleo/config-download-multistack.j2 b/devsetup/tripleo/config-download-multistack.j2 index 946d3594..4f56eb60 100644 --- a/devsetup/tripleo/config-download-multistack.j2 +++ b/devsetup/tripleo/config-download-multistack.j2 @@ -7,22 +7,25 @@ resource_registry: OS::TripleO::Compute::Ports::StorageMgmtPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_storage_mgmt.yaml OS::TripleO::Compute::Ports::StoragePort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_storage.yaml OS::TripleO::Compute::Ports::TenantPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_tenant.yaml - OS::TripleO::Compute::Ports::ExternalPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_external.yaml OS::TripleO::Controller::Ports::InternalApiPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_internal_api.yaml OS::TripleO::Controller::Ports::StorageMgmtPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_storage_mgmt.yaml OS::TripleO::Controller::Ports::StoragePort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_storage.yaml OS::TripleO::Controller::Ports::TenantPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_tenant.yaml - OS::TripleO::Controller::Ports::ExternalPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_external.yaml OS::TripleO::CellController::Ports::InternalApiPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_internal_api.yaml OS::TripleO::CellController::Ports::StorageMgmtPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_storage_mgmt.yaml OS::TripleO::CellController::Ports::StoragePort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_storage.yaml OS::TripleO::CellController::Ports::TenantPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_tenant.yaml - OS::TripleO::CellController::Ports::ExternalPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_external.yaml OS::TripleO::CellControllerCompute::Ports::InternalApiPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_internal_api.yaml OS::TripleO::CellControllerCompute::Ports::StorageMgmtPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_storage_mgmt.yaml OS::TripleO::CellControllerCompute::Ports::StoragePort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_storage.yaml OS::TripleO::CellControllerCompute::Ports::TenantPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_tenant.yaml + {% if attach_external_net|bool %} + OS::TripleO::Compute::Ports::ExternalPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_external.yaml + OS::TripleO::Controller::Ports::ExternalPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_external.yaml + OS::TripleO::CellController::Ports::ExternalPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_external.yaml OS::TripleO::CellControllerCompute::Ports::ExternalPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_external.yaml + {% endif %} + parameter_defaults: DeployedServerPortMap: controller-0-ctlplane: @@ -83,10 +86,13 @@ parameter_defaults: ip_address: 172.20.0.103 ip_address_uri: 172.20.0.103 ip_subnet: 172.20.0.0/24 + {% if attach_external_net|bool %} external: ip_address: 172.21.0.103 ip_address_uri: 172.21.0.103 ip_subnet: 172.21.0.0/24 + {% endif %} + compute-0: # cell1-controller-0 (cell1, ind0) ctlplane: ip_address: 192.168.122.106 @@ -108,10 +114,13 @@ parameter_defaults: ip_address: 172.20.0.106 ip_address_uri: 172.20.0.106 ip_subnet: 172.20.0.0/24 + {% if attach_external_net|bool %} external: ip_address: 172.21.0.106 ip_address_uri: 172.21.0.106 ip_subnet: 172.21.0.0/24 + {% endif %} + compute-1: # cell1-compute-0 (cell1, ind1) ctlplane: ip_address: 192.168.122.107 @@ -133,10 +142,13 @@ parameter_defaults: ip_address: 172.20.0.107 ip_address_uri: 172.20.0.107 ip_subnet: 172.20.0.0/24 + {% if attach_external_net|bool %} external: ip_address: 172.21.0.107 ip_address_uri: 172.21.0.107 ip_subnet: 172.21.0.0/24 + {% endif %} + compute-2: # cell2-controller-compute-0 AIO (cell2, ind0) ctlplane: ip_address: 192.168.122.109 @@ -158,10 +170,13 @@ parameter_defaults: ip_address: 172.20.0.109 ip_address_uri: 172.20.0.109 ip_subnet: 172.20.0.0/24 + {% if attach_external_net|bool %} external: ip_address: 172.21.0.109 ip_address_uri: 172.21.0.109 ip_subnet: 172.21.0.0/24 + {% endif %} + CtlplaneNetworkAttributes: network: dns_domain: localdomain diff --git a/devsetup/tripleo/tripleo_install.sh b/devsetup/tripleo/tripleo_install.sh index 72211dda..bc8c7349 100755 --- a/devsetup/tripleo/tripleo_install.sh +++ b/devsetup/tripleo/tripleo_install.sh @@ -157,10 +157,21 @@ fi # defaults for non-ceph case CEPH_OVERCLOUD_ARGS="" ROLES_FILE="/home/zuul/overcloud_roles.yaml" +if [ "$EDPM_COMPUTE_CEPH_ENABLED" = "true" ] ; then + # create roles file + cp $ROLES_FILE roles.yaml + openstack overcloud roles generate ComputeHCI >> roles.yaml + ROLES_FILE=roles.yaml +fi +if [ "$TRIPLEO_NETWORKING" != "true" ] ; then + # disable external gateway for controller nodes + sed -i "s/default_route_networks: \['External'\]/default_route_networks: \['ControlPlane'\]/" $ROLES_FILE + sed -i "/External:/d" $ROLES_FILE + sed -i "/subnet: external_subnet/d" $ROLES_FILE +fi if [ "$EDPM_COMPUTE_CEPH_ENABLED" = "true" ] ; then CEPH_OVERCLOUD_ARGS="${CEPH_ARGS}" [[ "$MANILA_ENABLED" == "true" ]] && CEPH_OVERCLOUD_ARGS+=' -e /usr/share/openstack-tripleo-heat-templates/environments/cephadm/ceph-mds.yaml' - ROLES_FILE="/home/zuul/roles.yaml" /tmp/ceph.sh fi