Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vSphere 4.1 cluster shutdown command
- Install Windows Powerchute Network Shutdown agent and join to UPS. Configure service to run as user with pass-through authentication rights to vCenter.
- Install VMware PowerCLI
- shutdown.bat script kicks off powershell script
- -----------------------------------------------------------------
- C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" " & "C:\scripts\shutdown.ps1
- shutdown.ps1 kicks off vmware commands
- -----------------------------------------------------------------
- $vCenterServername = "vcenter.domain.local"
- Connect-VIServer -Server $vCenterServername
- Get-VM | `
- Where-Object {$_.PowerState -eq "PoweredOn"} | `
- Shutdown-VMGuest -Confirm:$false
- Start-Sleep -Seconds 300
- Get-VM | `
- Where-Object {$_.PowerState -eq "PoweredOn"} | `
- Stop-VM -Confirm:$false
- Start-Sleep -Seconds 60
- $VMHosts = Get-VMHost
- $VMHosts | `
- Set-VMHost -State Maintenance -Confirm:$false
- $VMHosts | `
- Stop-VMHost -Confirm:$false
- START "" "C:\scripts\putty.exe" -ssh 10.0.0.10 -l root -pw rootpw -m c:\scripts\sanshutdown.sh
- shutdown /s /f /t 0
- sanshutdown.sh SAN storage server shutdown command (falconstor specific)
- -----------------------------------------------------------------------------
- echo y | ipstor stop all
- sync;sync;poweroff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement