diff options
author | Justin chi <chigang@huawei.com> | 2016-10-16 04:27:54 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2016-10-16 04:27:54 +0000 |
commit | 38a7d02dae6715520071edbd635e0d2085263399 (patch) | |
tree | 1b6d41907af4577dfb6073a0c727fa1af704eee6 /deploy/network.sh | |
parent | 78d1f808704a287cd2efb697c6af445280733c7f (diff) | |
parent | faed52cdedf1b067c3f39d49827cb843d55edd45 (diff) |
Merge "Add recovery scripts"
Diffstat (limited to 'deploy/network.sh')
-rwxr-xr-x | deploy/network.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/deploy/network.sh b/deploy/network.sh index 46b8c023..6c678222 100755 --- a/deploy/network.sh +++ b/deploy/network.sh @@ -29,6 +29,13 @@ function setup_bridge_net() sudo virsh net-start $net_name } +function recover_bridge_net() +{ + net_name=$1 + + sudo virsh net-start $net_name +} + function save_network_info() { sudo ovs-vsctl list-br |grep br-external @@ -69,6 +76,13 @@ function setup_bridge_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() { net_name=$1 gw=$2 @@ -92,11 +106,20 @@ function setup_nat_net() { sudo virsh net-start $net_name } +function recover_nat_net() { + net_name=$1 + + sudo virsh net-start $net_name +} function setup_virtual_net() { setup_nat_net install $INSTALL_GW $INSTALL_MASK } +function recover_virtual_net() { + recover_nat_net install +} + function setup_baremetal_net() { if [[ -z $INSTALL_NIC ]]; then exit 1 @@ -104,6 +127,13 @@ function setup_baremetal_net() { setup_bridge_net install $INSTALL_NIC } +function recover_baremetal_net() { + if [[ -z $INSTALL_NIC ]]; then + exit 1 + fi + recover_bridge_net install +} + function setup_network_boot_scripts() { sudo cp $COMPASS_DIR/deploy/network.sh /usr/sbin/network_setup sudo chmod +777 /usr/sbin/network_setup @@ -134,3 +164,14 @@ function create_nets() { setup_network_boot_scripts } +function recover_nets() { + recover_nat_net mgmt + + # recover install network + recover_"$TYPE"_net + + # recover external network + recover_bridge_external + clear_forward_rejct_rules +} + |