diff options
author | Yifei Xue <xueyifei@huawei.com> | 2018-02-05 03:59:44 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-02-05 03:59:44 +0000 |
commit | d5747030d62979b1178e6372907d7431012b7fd1 (patch) | |
tree | 965f3a9c94748c1f4895dd9617072c93c14cab37 /deploy | |
parent | ce0a73e89120efea3832b65b936dcc27f5840c74 (diff) | |
parent | 3907d59a072d158de67e3cc94bc6ea0ed747d390 (diff) |
Merge "Compass4nfv virtual deploy support direct connection"
Diffstat (limited to 'deploy')
-rwxr-xr-x | deploy/compass_vm.sh | 2 | ||||
-rw-r--r-- | deploy/conf/virtual.conf | 1 | ||||
-rwxr-xr-x | deploy/host_virtual.sh | 7 | ||||
-rwxr-xr-x | deploy/network.sh | 13 |
4 files changed, 16 insertions, 7 deletions
diff --git a/deploy/compass_vm.sh b/deploy/compass_vm.sh index cf215f3b..17171578 100755 --- a/deploy/compass_vm.sh +++ b/deploy/compass_vm.sh @@ -23,7 +23,7 @@ function check_container_alive() { docker exec -it compass-mq bash -c "exit" 1>/dev/null 2>&1 local mq_state=$? - if [ $((deck_state||tasks_state||cobbler_state||db_state||mq-state)) == 0 ]; then + if [ $((deck_state||tasks_state||cobbler_state||db_state||mq_state)) == 0 ]; then echo "true" else echo "false" diff --git a/deploy/conf/virtual.conf b/deploy/conf/virtual.conf index 1e9034f3..1d47603d 100644 --- a/deploy/conf/virtual.conf +++ b/deploy/conf/virtual.conf @@ -7,3 +7,4 @@ export SWITCH_IPS="1.1.1.1" export SWITCH_CREDENTIAL="version=2c,community=public" export DEPLOYMENT_TIMEOUT="300" export POLL_SWITCHES_FLAG="nopoll_switches" +export NAT_EXTERNAL=${NAT_EXTERNAL:true} diff --git a/deploy/host_virtual.sh b/deploy/host_virtual.sh index 03a1230f..d955b747 100755 --- a/deploy/host_virtual.sh +++ b/deploy/host_virtual.sh @@ -52,6 +52,11 @@ function launch_host_vms() { vm_template_file="$vm_template_dir/host.xml" vm_template_arch="$vm_template_dir/host-$COMPASS_ARCH.xml" [ -f $vm_template_arch ] && vm_template_file=$vm_template_arch + if [[ "$NAT_EXTERNAL" == "false" ]]; then + NET_IAAS="external" + else + NET_IAAS="external_nat" + fi log_info "bringing up pxe boot vms" i=0 @@ -67,7 +72,7 @@ function launch_host_vms() { -e "s#REPLACE_IMAGE#$vm_dir/disk.img#g" \ -e "s/REPLACE_BOOT_MAC/${mac_array[i]}/g" \ -e "s/REPLACE_NET_INSTALL/install/g" \ - -e "s/REPLACE_NET_IAAS/external_nat/g" \ + -e "s/REPLACE_NET_IAAS/$NET_IAAS/g" \ "$vm_template_file" \ > $vm_dir/libvirt.xml diff --git a/deploy/network.sh b/deploy/network.sh index 698771b3..eea62277 100755 --- a/deploy/network.sh +++ b/deploy/network.sh @@ -76,9 +76,9 @@ function setup_bridge_external() sudo virsh net-destroy external sudo virsh net-undefine external - #save_network_info + save_network_info sed -e "s/REPLACE_NAME/external/g" \ - -e "s/REPLACE_OVS/br-external_nat/g" \ + -e "s/REPLACE_OVS/br-external/g" \ $COMPASS_DIR/deploy/template/network/bridge_ovs.xml \ > $WORK_DIR/network/external.xml @@ -86,14 +86,12 @@ function setup_bridge_external() sudo virsh net-start external sudo virsh net-autostart external - python $COMPASS_DIR/deploy/setup_vnic.py } function recover_bridge_external() { sudo virsh net-start external - python $COMPASS_DIR/deploy/setup_vnic.py } function setup_nat_net() { @@ -128,7 +126,12 @@ function recover_nat_net() { function setup_virtual_net() { setup_nat_net install $INSTALL_GW $INSTALL_NETMASK - setup_nat_net external_nat $EXT_NAT_GW $EXT_NAT_MASK $EXT_NAT_IP_START $EXT_NAT_IP_END + + if [[ "$NAT_EXTERNAL" == "false" ]]; then + setup_bridge_external + else + setup_nat_net external_nat $EXT_NAT_GW $EXT_NAT_MASK $EXT_NAT_IP_START $EXT_NAT_IP_END + fi } function recover_virtual_net() { |