From 827d8e0ea6f083f3b2082c8906a41258ed52f51a Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Thu, 2 Aug 2018 02:59:12 +0200 Subject: [lib.sh] Reset virtual nodes after MaaS install For hybrid PODs (e.g. x86_64 jumpserver + control nodes, aarch64 baremetal compute nodes), the virtual nodes rely on MaaS DHCP to be up when the OS boots, so issue a `virsh reset` accordingly. Instead of checking for online nodes using `test.ping`, use `saltutil.sync_all` to also sync Salt state modules to the virtual nodes (usually handled by baremetal_init state in HA deploys). JIRA: FUEL-338 Change-Id: If689d057dc4438102c3a7428a97b9638e21bfdc5 Signed-off-by: Alexandru Avadanii --- mcp/scripts/lib.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'mcp/scripts') diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh index c9c1bbd0a..9c12bff64 100644 --- a/mcp/scripts/lib.sh +++ b/mcp/scripts/lib.sh @@ -452,6 +452,23 @@ function update_mcpcontrol_network { "" --live --config } +function reset_vms { + local vnodes=("$@") + local cmd_str="ssh ${SSH_OPTS} ${SSH_SALT}" + + # reset non-infrastructure vms, wait for them to come back online + for node in "${vnodes[@]}"; do + if [[ ! "${node}" =~ (cfg01|mas01) ]]; then + virsh reset "${node}" + fi + done + for node in "${vnodes[@]}"; do + if [[ ! "${node}" =~ (cfg01|mas01) ]]; then + wait_for 20.0 "${cmd_str} sudo salt -C '${node}*' saltutil.sync_all" + fi + done +} + function start_vms { local vnodes=("$@") -- cgit 1.2.3-korg