update
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
VERS='2.5.230-02012024'
|
||||
VERS='2.5.231-02012024'
|
||||
|
||||
noheader=' update service dailytemp confsync -r -report '
|
||||
|
||||
|
||||
@@ -6,9 +6,7 @@ Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Passwo
|
||||
$vmhosts=$args[0].Split(",")
|
||||
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
|
||||
write-host $vmhost
|
||||
Get-VMHost | Where {$_.Name -eq $vmhost} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'}
|
||||
Get-VMHost | Where {$_.Name -eq $vmhost} | Get-VM | Where {$_.PowerState -like '*On*' -and $_.Name -notlike '*CLS*' -and $_.Name -notlike '*iSCSI*'} | Shutdown-VMGuest -Confirm:$false
|
||||
}
|
||||
|
||||
Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false
|
||||
|
||||
@@ -11,7 +11,7 @@ source /opt/idssys/powerwall/inc/power.inc.sh
|
||||
source /opt/idssys/powerwall/inc/temp.inc.sh
|
||||
|
||||
|
||||
TEST=true
|
||||
# TEST=true
|
||||
|
||||
shopt -s lastpipe
|
||||
|
||||
@@ -416,15 +416,14 @@ SHUTDOWN_SERVER(){
|
||||
echo
|
||||
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
|
||||
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
|
||||
varvms="${PW_VCENTER_HOST_NAMES[${ESXIHOST}]},${varvms}"
|
||||
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]}"
|
||||
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user