From 010abc1d4bbc3cc2311a986186f7af41f1a0d53d Mon Sep 17 00:00:00 2001 From: Hu Shuai Date: Tue, 16 Aug 2022 14:38:16 +0800 Subject: [PATCH] Add TEST_SW_RAID option This can config software RAID for worker nodes. Signed-off-by: Hu Shuai --- common.sh | 3 +++ config_example.sh | 4 ++++ utils.sh | 11 +++++++++++ 3 files changed, 18 insertions(+) diff --git a/common.sh b/common.sh index 75671f624..b024256d5 100644 --- a/common.sh +++ b/common.sh @@ -468,3 +468,6 @@ if [[ -n "$MIRROR_IMAGES" || -z "${IP_STACK:-}" || "$IP_STACK" = "v6" ]]; then export OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE="${LOCAL_REGISTRY_DNS_NAME}:${LOCAL_REGISTRY_PORT}/${LOCAL_IMAGE_URL_SUFFIX}:latest" fi fi + +# Defaults the variable to disable testing software RAID +export TEST_SW_RAID=${TEST_SW_RAID:-true} diff --git a/config_example.sh b/config_example.sh index ed9b02f0f..7795a8a58 100755 --- a/config_example.sh +++ b/config_example.sh @@ -671,3 +671,7 @@ set -x # Set the following value to true to supply ZTP manifests to the installer. By default the install-config.yaml/agent-config.yaml # will be used as input to the installer. # export AGENT_USE_ZTP_MANIFESTS=false + +# TEST_SW_RAID - +# Enable testing of software RAID +# export TEST_SW_RAID=true diff --git a/utils.sh b/utils.sh index 5626e506f..7992839c9 100755 --- a/utils.sh +++ b/utils.sh @@ -108,6 +108,17 @@ function create_cluster() { mkdir -p ${assets_dir}/openshift generate_assets + if [[ "$TEST_SW_RAID" == "true" ]] && [[ "$NUM_WORKERS" -gt 0 ]]; then + for n in $(seq "$NUM_MASTERS" $(expr "$NUM_WORKERS" + "$NUM_MASTERS" - 1)); + do + sed -i "/status/i \\ + raid: \n\ + softwareRAIDVolumes: \n\ + - level: \"1\" \ +" ${assets_dir}/openshift/99_openshift-cluster-api_hosts-$n.yaml + done + fi + if [ -z "${NTP_SERVERS}" ]; then export NTP_SERVERS="$PROVISIONING_HOST_EXTERNAL_IP"