From 452eba3bd069845bcb8091cb0d4272f66b7a38d8 Mon Sep 17 00:00:00 2001 From: wangyaoguang Date: Tue, 19 Apr 2016 20:21:53 +0800 Subject: remove deprecated tools This tool is not general enough, and it will be replaced. JIAR: BOTTLENECK-57 Change-Id: I9121f40883090adcfab3b2157aee9212f8964d38 Signed-off-by: wangyaoguang --- utils/rubbos_dev_env_setup/deploy.sh | 106 ------------------------ utils/rubbos_dev_env_setup/env_config.sh | 7 -- utils/rubbos_dev_env_setup/libvirt_template.xml | 41 --------- utils/rubbos_dev_env_setup/mac_generator.sh | 36 -------- utils/rubbos_dev_env_setup/meta-data_template | 11 --- utils/rubbos_dev_env_setup/user-data_template | 2 - 6 files changed, 203 deletions(-) delete mode 100755 utils/rubbos_dev_env_setup/deploy.sh delete mode 100644 utils/rubbos_dev_env_setup/env_config.sh delete mode 100644 utils/rubbos_dev_env_setup/libvirt_template.xml delete mode 100755 utils/rubbos_dev_env_setup/mac_generator.sh delete mode 100644 utils/rubbos_dev_env_setup/meta-data_template delete mode 100644 utils/rubbos_dev_env_setup/user-data_template (limited to 'utils') diff --git a/utils/rubbos_dev_env_setup/deploy.sh b/utils/rubbos_dev_env_setup/deploy.sh deleted file mode 100755 index a4fbfb8b..00000000 --- a/utils/rubbos_dev_env_setup/deploy.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash -############################################################################## -# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -# this is a modified copy of compass4nfv/deploy/host_virtual.sh - -set -x - -SCRIPT_DIR=`cd ${BASH_SOURCE[0]%/*};pwd` -WORK_DIR=${SCRIPT_DIR}/work - -mkdir -p $WORK_DIR - -source ./env_config.sh - -host_vm_dir=$WORK_DIR/vm - - -function download_iso() -{ - mkdir -p ${WORK_DIR}/cache - curl --connect-timeout 10 -o ${WORK_DIR}/cache/$IMAGE_NAME $IMAGE_URL -} - - -function tear_down_machines() { - for i in $HOSTNAMES; do - echo "tear down machine:" $i - sudo virsh destroy $i - sudo virsh undefine $i - rm -rf $host_vm_dir/$i - done -} - - -function get_host_macs() { - local mac_generator=${SCRIPT_DIR}/mac_generator.sh - local machines= - - chmod +x $mac_generator - mac_array=$($mac_generator $VIRT_NUMBER) - machines=$(echo $mac_array) - - echo $machines -} - -function launch_host_vms() { - mac_array=($(get_host_macs)) - - echo ${mac_array[2]} - echo ${mac_array[*]} - - old_ifs=$IFS - IFS=, - tear_down_machines - echo "bringing up vms ${mac_array[*]}" - i=0 - for host in $HOSTNAMES; do - echo "creating vm disk for instance $host" \ - "ip ${IPADDR_PREFIX}$((i+11))" \ - "mac ${mac_array[$i]}" - vm_dir=$host_vm_dir/$host - mkdir -p $vm_dir - - cp ${WORK_DIR}/cache/$IMAGE_NAME $vm_dir - - # create seed.iso - sed -e "s/REPLACE_IPADDR/${IPADDR_PREFIX}$((i+11))/g" \ - -e "s/REPLACE_GATEWAY/${IPADDR_PREFIX}1/g" \ - -e "s/REPLACE_HOSTNAME/${host}/g" \ - meta-data_template \ - > meta-data - cp user-data_template user-data - genisoimage -output seed.iso -volid cidata -joliet -rock user-data meta-data - cp seed.iso $vm_dir - - # create vm xml - sed -e "s/REPLACE_MEM/$VIRT_MEM/g" \ - -e "s/REPLACE_CPU/$VIRT_CPUS/g" \ - -e "s/REPLACE_NAME/$host/g" \ - -e "s#REPLACE_IMAGE#$vm_dir/disk.img#g" \ - -e "s#REPLACE_SEED_IMAGE#$vm_dir/seed.iso#g" \ - -e "s/REPLACE_MAC_ADDR/${mac_array[$i]}/g" \ - libvirt_template.xml \ - > $vm_dir/libvirt.xml - - sudo virsh define $vm_dir/libvirt.xml - sudo virsh start $host - let i=i+1 - done - IFS=$old_ifs - rm -rf meta-data user-data seed.iso -} - - -download_iso -launch_host_vms - -set +x - diff --git a/utils/rubbos_dev_env_setup/env_config.sh b/utils/rubbos_dev_env_setup/env_config.sh deleted file mode 100644 index 326b9a57..00000000 --- a/utils/rubbos_dev_env_setup/env_config.sh +++ /dev/null @@ -1,7 +0,0 @@ -export HOSTNAMES=${HOSTNAMES:-"control,httpd,mysql,tomcat,client1,client2,client3,client4,benchmark"} -export VIRT_NUMBER=9 -export VIRT_MEM=4096 -export VIRT_CPUS=4 -export IMAGE_URL=${IMAGE_URL:-"file:///bottlenecks/trusty-server-cloudimg-amd64-disk1.img"} -export IMAGE_NAME=disk.img -export IPADDR_PREFIX="192.168.122." diff --git a/utils/rubbos_dev_env_setup/libvirt_template.xml b/utils/rubbos_dev_env_setup/libvirt_template.xml deleted file mode 100644 index eddeff00..00000000 --- a/utils/rubbos_dev_env_setup/libvirt_template.xml +++ /dev/null @@ -1,41 +0,0 @@ - - REPLACE_NAME - REPLACE_MEM - REPLACE_MEM - REPLACE_CPU - - hvm - - - - - - - destroy - restart - restart - - - - - - - - - - - - - - - - - - - - - - - diff --git a/utils/rubbos_dev_env_setup/mac_generator.sh b/utils/rubbos_dev_env_setup/mac_generator.sh deleted file mode 100755 index ef78f5f6..00000000 --- a/utils/rubbos_dev_env_setup/mac_generator.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -############################################################################## -# Copyright (c) 2015 Huawei Technologies Co.,Ltd and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -# this is a modified copy from compass4nfv/deploy/mac_generator.sh - -function mac_address_part() { - hex_number=$(printf '%02x' $RANDOM) - number_length=${#hex_number} - number_start=$(expr $number_length - 2) - echo ${hex_number:$number_start:2} -} - -function mac_address() { - echo "00:00:$(mac_address_part):$(mac_address_part):$(mac_address_part):$(mac_address_part)" -} - -machines='' -for i in `seq $1`; do - mac=$(mac_address) - - if [[ -z $machines ]]; then - machines="${mac}" - else - machines="${machines} ${mac}" - fi -done - -echo ${machines} - diff --git a/utils/rubbos_dev_env_setup/meta-data_template b/utils/rubbos_dev_env_setup/meta-data_template deleted file mode 100644 index 43db6597..00000000 --- a/utils/rubbos_dev_env_setup/meta-data_template +++ /dev/null @@ -1,11 +0,0 @@ -instance-id: iid-abcdeff -network-interfaces: | - # The primary network interface - auto eth0 - iface eth0 inet static - address REPLACE_IPADDR - netmask 255.255.255.0 - gateway REPLACE_GATEWAY - dns-nameservers 8.8.8.8 -local-hostname: REPLACE_HOSTNAME - diff --git a/utils/rubbos_dev_env_setup/user-data_template b/utils/rubbos_dev_env_setup/user-data_template deleted file mode 100644 index 77f616df..00000000 --- a/utils/rubbos_dev_env_setup/user-data_template +++ /dev/null @@ -1,2 +0,0 @@ -#cloud-config - -- cgit 1.2.3-korg