From 49e5cf0c78f879f2022a7d47acaeed563e573b0b Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 31 Oct 2023 22:39:12 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index a170b872..d13f34d8 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -1117,21 +1117,23 @@ SHUTDOWN_SERVER(){ echo echo "($datetime) - Shutting down ${host} (${hostip})" >> ${PW_LOGFILE} - echo -en "${idsCL[LightCyan]}Enabling Maintenance mode and will wait for iSCSI VM's to begin migrating ... " - if [ "${TEST}" != "true" ]; then - ${PW_FOLDER}/esxi-scripts/host-maintenance_mode.ps1 ${PW_ESXI_HOST_NAMES[${hostip}]} & >/dev/null 2>&1 - sleep 45s - fi + + echo -en "${idsCL[LightCyan]}Enabling maintenance mode ... " + [ "${TEST}" != "true" ] && ${PW_FOLDER}/esxi-scripts/host-maintenance_mode.ps1 ${PW_ESXI_HOST_NAMES[${hostip}]} & >/dev/null 2>&1 + echo -e "${idsCL[Green]}Done\n" + + echo -en "${idsCL[LightCyan]}Giving time for iSCSI VM's to begin migration to other hosts ... " + [ "${TEST}" != "true" ] && sleep 45s || sleep 10s echo -e "${idsCL[Green]}Done\n" - echo -en "${idsCL[LightCyan]}Shutting Down VM's on: ${host} (${hostip}) ... " + echo -en "${idsCL[LightCyan]}Shutting down remaining VM's on: ${host} (${hostip}) ... " if [ "${TEST}" != "true" ]; then ${PW_FOLDER}/esxi-scripts/vm-shutdown.ps1 ${hostip} >/dev/null 2>&1 ${PW_FOLDER}/esxi-scripts/iscsi-server-shutdown.ps1 ${hostip} >/dev/null 2>&1 fi echo -e "${idsCL[Green]}Done\n" - echo -en "${idsCL[LightCyan]}Shutting Down Host: ${host} (${hostip}) ... " + echo -en "${idsCL[LightCyan]}Shutting down Host: ${host} (${hostip}) ... " if [ "${TEST}" != "true" ]; then ssh root@${hostip} 'esxcli system shutdown poweroff -d 10 -r "Automated ESXi host shutdown"' & >/dev/null 2>&1 ssh root@${hostip} 'esxcli system maintenanceMode set -e false -t 0' >/dev/null 2>&1