From b23c5c9b89cdcd2ad73734807456426fada35c4a Mon Sep 17 00:00:00 2001 From: QiLiang Date: Wed, 30 Dec 2015 05:02:15 +0000 Subject: Rubbos vm ip CI auto config JIRA: BOTTLENECK-37 Change-Id: I48e83735703f9ec102e347556ba6e201d2984402 Signed-off-by: QiLiang --- .../rubbos_scripts/1-1-1/set_bottlenecks_rubbos_env.sh | 18 +++++++++--------- utils/infra_setup/heat_template/HOT_create_instance.sh | 15 +++++++++++++-- utils/infra_setup/vm_dev_setup/setup_env.sh | 15 +++++++++++++++ 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/rubbos/rubbos_scripts/1-1-1/set_bottlenecks_rubbos_env.sh b/rubbos/rubbos_scripts/1-1-1/set_bottlenecks_rubbos_env.sh index fa270956..a68e0cac 100755 --- a/rubbos/rubbos_scripts/1-1-1/set_bottlenecks_rubbos_env.sh +++ b/rubbos/rubbos_scripts/1-1-1/set_bottlenecks_rubbos_env.sh @@ -3,15 +3,15 @@ set -o allexport # HOSTS -CONTROL_HOST=192.168.122.11 -HTTPD_HOST=192.168.122.12 -MYSQL1_HOST=192.168.122.13 -TOMCAT1_HOST=192.168.122.14 -CLIENT1_HOST=192.168.122.15 -CLIENT2_HOST=192.168.122.16 -CLIENT3_HOST=192.168.122.17 -CLIENT4_HOST=192.168.122.18 -BENCHMARK_HOST=192.168.122.19 +CONTROL_HOST=REPLACE_CONTROL_HOST +HTTPD_HOST=REPLACE_HTTPD_HOST +MYSQL1_HOST=REPLACE_MYSQL1_HOST +TOMCAT1_HOST=REPLACE_TOMCAT1_HOST +CLIENT1_HOST=REPLACE_CLIENT1_HOST +CLIENT2_HOST=REPLACE_CLIENT2_HOST +CLIENT3_HOST=REPLACE_CLIENT3_HOST +CLIENT4_HOST=REPLACE_CLIENT4_HOST +BENCHMARK_HOST=REPLACE_BENCHMARK_HOST # Experiment name on OPNFV BOTTLNECKS_NAME=bottlenecks diff --git a/utils/infra_setup/heat_template/HOT_create_instance.sh b/utils/infra_setup/heat_template/HOT_create_instance.sh index 3c96ce1c..9e1c3f11 100755 --- a/utils/infra_setup/heat_template/HOT_create_instance.sh +++ b/utils/infra_setup/heat_template/HOT_create_instance.sh @@ -40,6 +40,14 @@ bottlenecks_rubbos_run() { echo "Run Rubbos" control_ip=$(nova list | grep rubbos_control | awk '{print $13}') + for i in rubbos_benchmark rubbos_client1 rubbos_client2 rubbos_client3 \ + rubbos_client4 rubbos_control rubbos_httpd rubbos_mysql1 \ + rubbos_tomcat1 + do + ip=$(nova list | grep $i | awk '{print $12}' | awk -F [=,] '{print $2}') + echo "$i=$ip" >> $BOTTLENECKS_REPO_DIR/utils/infra_setup/vm_dev_setup/hosts.conf + done + chmod 600 $KEY_PATH/bottlenecks_key ssh -i $KEY_PATH/bottlenecks_key \ -o StrictHostKeyChecking=no \ @@ -51,6 +59,9 @@ bottlenecks_rubbos_run() ssh -i $KEY_PATH/bottlenecks_key \ -o StrictHostKeyChecking=no \ -o BatchMode=yes root@$control_ip "bash /tmp/vm_dev_setup/setup_env.sh" + + rm -rf $BOTTLENECKS_REPO_DIR/utils/infra_setup/vm_dev_setup/hosts.conf + } bottlenecks_cleanup() @@ -92,10 +103,10 @@ bottlenecks_load_bottlenecks_image() echo "load bottlenecks image" curl --connect-timeout 10 -o /tmp/bottlenecks-trusty-server.img $IMAGE_URL -v - if [ $? != 0 ]; then + #if [ $? != 0 ]; then wget http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img -O \ /tmp/bottlenecks-trusty-server.img - fi + #fi result=$(glance image-create \ --name $IMAGE_NAME \ diff --git a/utils/infra_setup/vm_dev_setup/setup_env.sh b/utils/infra_setup/vm_dev_setup/setup_env.sh index e7b8c308..5b45de45 100755 --- a/utils/infra_setup/vm_dev_setup/setup_env.sh +++ b/utils/infra_setup/vm_dev_setup/setup_env.sh @@ -28,6 +28,20 @@ bottlenecks_download_repo() fi } +bottlenecks_config_hosts_ip() +{ + sed -i -e "s/REPLACE_CONTROL_HOST/$rubbos_control/g" \ + -e "s/REPLACE_HTTPD_HOST/$rubbos_httpd/g" \ + -e "s/REPLACE_MYSQL1_HOST/$rubbos_mysql1/g" \ + -e "s/REPLACE_TOMCAT1_HOST/$rubbos_tomcat1/g" \ + -e "s/REPLACE_CLIENT1_HOST/$rubbos_client1/g" \ + -e "s/REPLACE_CLIENT2_HOST/$rubbos_client2/g" \ + -e "s/REPLACE_CLIENT3_HOST/$rubbos_client3/g" \ + -e "s/REPLACE_CLIENT4_HOST/$rubbos_client4/g" \ + -e "s/REPLACE_BENCHMARK_HOST/$rubbos_benchmark/g" \ + $BOTTELENECKS_REPO_DIR/rubbos/rubbos_scripts/1-1-1/set_bottlenecks_rubbos_env.sh +} + bottlenecks_download_packages() { echo "Bottlenecks: download rubbos dependent packages from artifacts" @@ -56,6 +70,7 @@ main() SCRIPT_DIR=`cd ${BASH_SOURCE[0]%/*};pwd` source $SCRIPT_DIR/package.conf + source $SCRIPT_DIR/hosts.conf bottlenecks_prepare_env bottlenecks_download_repo -- cgit 1.2.3-korg