From e9c6204c777d4d5169d6678a868782a7835d1350 Mon Sep 17 00:00:00 2001 From: liyuenan Date: Mon, 12 Sep 2016 12:13:39 +0800 Subject: Add a expansion functionality Through modify the virtual_cluster_expansion.yml, include host's name and mac, you can decide to how many compute nodes you need to add. And you also need to modify network.yml. Note that external subnet's ip_range should be changed as the first 6 IPs are already taken by the first deployment. Edit ``add.sh``, check the environment variable. Note that the OS version and OpenStack version should be same as the first deployment. Run ``add.sh``. JIRA:COMPASS-481 Change-Id: Id85f02518667e0ff80c2475e70856cd30cf1b9b7 Signed-off-by: liyuenan --- deploy/launch.sh | 57 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 22 deletions(-) (limited to 'deploy/launch.sh') diff --git a/deploy/launch.sh b/deploy/launch.sh index 488e0fd7..ed65f40d 100755 --- a/deploy/launch.sh +++ b/deploy/launch.sh @@ -30,39 +30,52 @@ source ${COMPASS_DIR}/deploy/compass_vm.sh source ${COMPASS_DIR}/deploy/deploy_host.sh ######################### main process -print_logo +if [[ "$EXPANSION" == "false" ]] +then -if [[ ! -z $VIRT_NUMBER ]];then - tear_down_machines -fi - -log_info "########## get host mac begin #############" -machines=`get_host_macs` -if [[ -z $machines ]]; then - log_error "get_host_macs failed" - exit 1 -fi + print_logo -export machines - -if [[ "$DEPLOY_COMPASS" == "true" ]]; then - if ! prepare_env;then - echo "prepare_env failed" - exit 1 + if [[ ! -z $VIRT_NUMBER ]];then + tear_down_machines fi - log_info "########## set up network begin #############" - if ! create_nets;then - log_error "create_nets failed" + log_info "########## get host mac begin #############" + machines=`get_host_macs` + if [[ -z $machines ]]; then + log_error "get_host_macs failed" exit 1 fi - if ! launch_compass;then - log_error "launch_compass failed" + export machines + + if [[ "$DEPLOY_COMPASS" == "true" ]]; then + if ! prepare_env;then + echo "prepare_env failed" + exit 1 + fi + + log_info "########## set up network begin #############" + if ! create_nets;then + log_error "create_nets failed" + exit 1 + fi + + if ! launch_compass;then + log_error "launch_compass failed" + exit 1 + fi + fi +else + machines=`get_host_macs` + if [[ -z $machines ]];then + log_error "get_host_macs failed" exit 1 fi + + log_info "deploy host macs: $machines" fi + if [[ -z "$REDEPLOY_HOST" || "$REDEPLOY_HOST" == "false" ]]; then if ! set_compass_machine; then log_error "set_compass_machine fail" -- cgit 1.2.3-korg