diff options
author | liyuenan <liyuenan@huawei.com> | 2016-09-12 12:13:39 +0800 |
---|---|---|
committer | Yuenan Li <liyuenan@huawei.com> | 2016-09-18 09:26:02 +0000 |
commit | e9c6204c777d4d5169d6678a868782a7835d1350 (patch) | |
tree | fb7ad04d58d7da5c4693e05af5f5299743ed0a37 /deploy/host_virtual.sh | |
parent | 17092c09eea12270fe3c4878adc7f70ff7d98fbc (diff) |
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 <liyuenan@huawei.com>
Diffstat (limited to 'deploy/host_virtual.sh')
-rwxr-xr-x | deploy/host_virtual.sh | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/deploy/host_virtual.sh b/deploy/host_virtual.sh index 97896bf0..2fab2c9d 100755 --- a/deploy/host_virtual.sh +++ b/deploy/host_virtual.sh @@ -60,14 +60,32 @@ function get_host_macs() { if [[ $REDEPLOY_HOST == "true" ]]; then mac_array=`cat $WORK_DIR/switch_machines` + machines=`echo $mac_array|sed 's/ /,/g'` else - chmod +x $mac_generator - mac_array=`$mac_generator $VIRT_NUMBER` - echo $mac_array > $WORK_DIR/switch_machines + if [[ -z $HOST_MACS ]]; then + if [[ "$EXPANSION" == "false" ]]; then + chmod +x $mac_generator + mac_array=`$mac_generator $VIRT_NUMBER` + echo $mac_array > $WORK_DIR/switch_machines + machines=`echo $mac_array|sed 's/ /,/g'` + else + machines_old=`cat $WORK_DIR/switch_machines` + chmod +x $mac_generator + machines_add=`$mac_generator $VIRT_NUMBER` + echo $machines_add $machines_old > $WORK_DIR/switch_machines + machines=`echo $machines_add $machines_old|sed 's/ /,/g'` + fi + else + if [[ "$EXPANSION" == "false" ]]; then + machines=`echo $HOST_MACS | sed -e 's/,/'\',\''/g' -e 's/^/'\''/g' -e 's/$/'\''/g'` + else + machines_old=`cat $WORK_DIR/switch_machines` + machines_add=`echo $HOST_MACS | sed -e 's/,/'\',\''/g' -e 's/^/'\''/g' -e 's/$/'\''/g'` + echo $machines_add $machines_old > $WORK_DIR/switch_machines + machines=`echo $machines_add $machines_old|sed 's/ /,/g'` + fi + fi fi - - machines=`echo $mac_array|sed 's/ /,/g'` - echo $machines } |