diff --git a/defaults.inc b/defaults.inc index af9f6f57..531ce932 100755 --- a/defaults.inc +++ b/defaults.inc @@ -1,5 +1,5 @@ -VERS='1.091222' +VERS='1.84-05072023' noupdate=' stop start _service ' @@ -31,7 +31,7 @@ MAINHOSTS=10.10.2.10,10.10.2.11,10.10.2.12 SYSHOSTS=10.10.2.17 IFS=, -ESXIHOSTS=(${ESXIHOSTS}) +ESXIHOSTS=(${MAINHOSTS},${SYSHOSTS}) MAINHOSTS=(${MAINHOSTS}) SYSHOSTS=(${SYSHOSTS}) unset IFS diff --git a/esxi-scripts/sys-iscsi-shutdown.ps1 b/esxi-scripts/iscsi-vm-shutdown.ps1 similarity index 56% rename from esxi-scripts/sys-iscsi-shutdown.ps1 rename to esxi-scripts/iscsi-vm-shutdown.ps1 index 3017f0c9..5fac0de8 100755 --- a/esxi-scripts/sys-iscsi-shutdown.ps1 +++ b/esxi-scripts/iscsi-vm-shutdown.ps1 @@ -4,6 +4,4 @@ Connect-VIServer -Server $args[0] -Protocol https -User $ESXiUsername -Password $ESXiPassword -# Get-Datastore | Where {$_.Name -like '*iSCSI1*' -or $_.Name -like '*iSCSI2*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false - -Get-Datastore | Where {$_.Name -like '*iSCSI1*' -or $_.Name -like '*iSCSI2*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} \ No newline at end of file +Get-Datastore | Where {$_.Name -like '*iSCSI1*' -or $_.Name -like '*iSCSI2*'} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*'} | Shutdown-VMGuest -Confirm:$false diff --git a/powerwall.sh b/powerwall.sh index 74fdcbd7..34b085b6 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -293,6 +293,13 @@ SHUTDOWN_SERVER(){ echo "Ok" } +ISCSIVMSHUTDOWN(){ + for ESXIHOST in "${ESXIHOSTS[@]}"; do + echo ${ESXIHOST} + done + #/opt/idssys/powerwall/esxi-scripts/iscsi-vm-shutdown.ps1 +} + TEST(){ echo "Getting info from ${1}" /opt/idssys/powerwall/esxi-scripts/sys-iscsi-shutdown.ps1 ${1} @@ -310,6 +317,7 @@ if [ ${action-x} ]; then checktemp) CHECKTEMP ${2};; checkpower) CHECKPOWER;; test) TEST ${2};; + iscsi-vm-shutdown) ISCSIVMSHUTDOWN;; shutdownhost) SHUTDOWN_SERVER ${2};;