Update powerwall.sh

This commit is contained in:
2023-05-15 12:19:15 -05:00
parent ed4beac5a9
commit 0bd6403414

View File

@@ -423,13 +423,17 @@ SHUTDOWN_SERVERS(){
fi
}
SHUTDOWN_SERVER(){
echo -en "Enabling Maintenance mode and will wait 1min for iSCSI VM's to migrate ... "
ssh root@${1} 'esxcli system maintenanceMode set -e true -t 0' &
sleep 1m
echo "Done"
echo -en "Shutting Down VM's on: ${1} ... "
${FOLDER}/esxi-scripts/vm-shutdown.ps1 ${1} >/dev/null 2>&1
${FOLDER}/esxi-scripts/iscsi-server-shutdown.ps1 ${1} >/dev/null 2>&1
echo "Done"
echo -en "Shutting Down Host: ${1} ... "
ssh root@${1} 'esxcli system maintenanceMode set -e true -t 0'
ssh root@${1} 'esxcli system shutdown poweroff -d 10 -r "Automated ESXi host shutdown"' &
ssh root@${1} 'esxcli system maintenanceMode set -e false -t 0'
echo "Done"