This commit is contained in:
2023-03-28 21:24:49 -05:00
parent 283a947f5a
commit b743dbea2c
2 changed files with 14 additions and 0 deletions

View File

@@ -268,6 +268,8 @@ SHUTDOWN_SERVERS(){
echo "Ok"
done
/opt/idssys/powerwall/sys-iscsi-shutdown.ps1 10.10.2.17
if [ "${1}" = "MAIN" ]; then
/usr/bin/ssh root@10.10.2.10 "/vmfs/volumes/iSCSI2-Datastore2\ \(R5\)\(1-4\)/\!SCRIPTS/esxidown/async-${ESXIHOST}.sh"
echo -en "Waiting for iSCSI-Server to shutdown... "
@@ -291,6 +293,10 @@ SHUTDOWN_SERVER(){
echo "Ok"
}
TEST(){
/opt/idssys/powerwall/sys-iscsi-shutdown.ps1 10.10.2.17
}
@@ -302,6 +308,7 @@ if [ ${action-x} ]; then
restartall) RESTART_SERVICES;;
checktemp) CHECKTEMP ${2};;
checkpower) CHECKPOWER;;
test) TEST;;
shutdownhost) SHUTDOWN_SERVER ${2};;

7
sys-iscsi-shutdown.ps1 Normal file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env pwsh
. /opt/idssys/powerwall/settings.ps1
Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword
Get-Datastore | Where {$_.Name -like '*iSCSI*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'}