This commit is contained in:
2024-02-01 16:26:07 -06:00
parent f38cd62027
commit ab32843473
3 changed files with 6 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
VERS='2.5.230-02012024' VERS='2.5.231-02012024'
noheader=' update service dailytemp confsync -r -report ' noheader=' update service dailytemp confsync -r -report '

View File

@@ -6,9 +6,7 @@ Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Passwo
$vmhosts=$args[0].Split(",") $vmhosts=$args[0].Split(",")
Foreach ($vmhost in $vmhosts) Foreach ($vmhost in $vmhosts)
{ {
# Get-VMHost | Where {$_.Name -eq $vmhost} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false Get-VMHost | Where {$_.Name -eq $vmhost} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false
write-host $vmhost
Get-VMHost | Where {$_.Name -eq $vmhost} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'}
} }
Disconnect-VIServer -Server $VCENTERHOST -Force Confirm:$false Disconnect-VIServer -Server $VCENTERHOST -Force Confirm:$false

View File

@@ -11,7 +11,7 @@ source /opt/idssys/powerwall/inc/power.inc.sh
source /opt/idssys/powerwall/inc/temp.inc.sh source /opt/idssys/powerwall/inc/temp.inc.sh
TEST=true # TEST=true
shopt -s lastpipe shopt -s lastpipe
@@ -416,15 +416,14 @@ SHUTDOWN_SERVER(){
echo echo
fi fi
MSG="Shutting down remaining VM's on: ${PW_ESXI_HOST_NAMES[${ESXIHOST}]}" MSG="Shutting down any remaining VM's"
c=0; MSG_SPC=''; spc1=`expr ${HC_CW} - ${#MSG}`; until [ ${c} = ${spc1} ]; do MSG_SPC="${MSG_SPC} "; ((c++)); done c=0; MSG_SPC=''; spc1=`expr ${HC_CW} - ${#MSG}`; until [ ${c} = ${spc1} ]; do MSG_SPC="${MSG_SPC} "; ((c++)); done
echo -en "${idsCL[White]}${MSG//${PW_ESXI_HOST_NAMES[${ESXIHOST}]}/${idsCL[LightCyan]}${PW_ESXI_HOST_NAMES[${ESXIHOST}]}}${idsCL[White]}${MSG_SPC}: " echo -en "${idsCL[White]}${MSG//${PW_ESXI_HOST_NAMES[${ESXIHOST}]}/${idsCL[LightCyan]}${PW_ESXI_HOST_NAMES[${ESXIHOST}]}}${idsCL[White]}${MSG_SPC}: "
if [ "${TEST}" != "trueXXXXXX" ]; then if [ "${TEST}" != "true" ]; then
for ESXIHOST in "${ESXI_HOSTS[@]}"; do for ESXIHOST in "${ESXI_HOSTS[@]}"; do
varvms="${PW_VCENTER_HOST_NAMES[${ESXIHOST}]},${varvms}" varvms="${PW_VCENTER_HOST_NAMES[${ESXIHOST}]},${varvms}"
done done
echo "HERE: ${varvms::-1}" ${PW_FOLDER}/esxi-scripts/vm-shutdown.ps1 "${varvms::-1}" >/dev/null 2>&1 &
${PW_FOLDER}/esxi-scripts/vm-shutdown.ps1 "${varvms::-1}" #>/dev/null 2>&1 &
echo -e "${idsCL[Green]}Commands sent${idsCL[Default]}" echo -e "${idsCL[Green]}Commands sent${idsCL[Default]}"
else else