From 53b61109b33cfbadfb24d426254e762d5abaed21 Mon Sep 17 00:00:00 2001 From: Gulsum Atici Date: Tue, 18 Oct 2022 23:51:16 +0300 Subject: [PATCH] Fixing Powerdns scaling scripts Signed-off-by: Gulsum Atici --- .../2.1-KNF/powerdns-scripts/11-scale-out.sh | 14 ++++++++++---- .../2.1-KNF/powerdns-scripts/12-scale-in.sh | 7 +++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Hackfest_Demos/OSM-MR13/2.1-KNF/powerdns-scripts/11-scale-out.sh b/Hackfest_Demos/OSM-MR13/2.1-KNF/powerdns-scripts/11-scale-out.sh index 4946f65c..79db1ed5 100755 --- a/Hackfest_Demos/OSM-MR13/2.1-KNF/powerdns-scripts/11-scale-out.sh +++ b/Hackfest_Demos/OSM-MR13/2.1-KNF/powerdns-scripts/11-scale-out.sh @@ -1,13 +1,17 @@ #!/bin/bash -read -p "Enter replicaCount number to scale as number greater than 1:" NUM +export PDNS_NS_NAME=powerdns_ns +export VNF_NAME=powerdns +export KDU_NAME=powerdns +export VNF_ID=`osm vnf-list --ns $PDNS_NS_NAME | grep powerdns | awk '{print $2}'` + +read -p "Enter replicaCount number to scale as number:" NUM if [[ -z "$NUM" ]]; then printf '%s\n' "No input entered" exit 1 else - printf "You entered ZONE %s " "$NUM" - ls -l + printf "You entered NUM %s " "$NUM" fi echo "========================================================================" @@ -17,11 +21,13 @@ echo "========================================================================" SCALE_OUT_OP_ID=`osm ns-action --action_name upgrade --vnf_name $VNF_NAME --kdu_name $KDU_NAME --params "{'replicaCount':$NUM,}" $PDNS_NS_NAME` echo "========================================================================" +echo "Check the action status using osm ns-op-show $SCALE_OUT_OP_ID --literal | yq .operationState" echo "Showing action status" echo "========================================================================" -osm ns-op-show $PDNS_NS_NAME --literal | yq .operationState +osm ns-op-show $SCALE_OUT_OP_ID --literal | yq .operationState echo "========================================================================" +echo "Check the replicaCount using osm vnf-show $VNF_ID --kdu $KDU_NAME | yq .config.replicaCount" echo "Showing replicaCount number" echo "========================================================================" osm vnf-show $VNF_ID --kdu $KDU_NAME | yq .config.replicaCount diff --git a/Hackfest_Demos/OSM-MR13/2.1-KNF/powerdns-scripts/12-scale-in.sh b/Hackfest_Demos/OSM-MR13/2.1-KNF/powerdns-scripts/12-scale-in.sh index ccd19e87..c4ffd84e 100755 --- a/Hackfest_Demos/OSM-MR13/2.1-KNF/powerdns-scripts/12-scale-in.sh +++ b/Hackfest_Demos/OSM-MR13/2.1-KNF/powerdns-scripts/12-scale-in.sh @@ -1,5 +1,10 @@ #!/bin/bash +export PDNS_NS_NAME=powerdns_ns +export VNF_NAME=powerdns +export KDU_NAME=powerdns +export VNF_ID=`osm vnf-list --ns $PDNS_NS_NAME | grep powerdns | awk '{print $2}'` + echo "========================================================================" echo "Rolling back" echo "========================================================================" @@ -7,12 +12,14 @@ echo "========================================================================" SCALE_IN_OP_ID=`osm ns-action --action_name rollback --vnf_name $VNF_NAME --kdu_name $KDU_NAME $PDNS_NS_NAME` echo "========================================================================" +echo "Check the action status using osm ns-op-show $SCALE_IN_OP_ID" echo "Showing action status" echo "========================================================================" osm ns-op-show $SCALE_IN_OP_ID --literal | yq .operationState echo "========================================================================" +echo "Check the replicatCount number using osm vnf-show $VNF_ID --kdu $KDU_NAME | yq .config.replicaCount" echo "Showing replicaCount number" echo "========================================================================" osm vnf-show $VNF_ID --kdu $KDU_NAME | yq .config.replicaCount \ No newline at end of file -- GitLab