Advertisement
Guest User

vsphere-san-apc-shutdown

a guest
May 1st, 2011
857
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. vSphere 4.1 cluster shutdown command
  2. Install Windows Powerchute Network Shutdown agent and join to UPS. Configure service to run as user with pass-through authentication rights to vCenter.
  3. Install VMware PowerCLI
  4.  
  5. shutdown.bat script kicks off powershell script
  6. -----------------------------------------------------------------
  7. C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" " & "C:\scripts\shutdown.ps1
  8.  
  9.  
  10. shutdown.ps1 kicks off vmware commands
  11. -----------------------------------------------------------------
  12. $vCenterServername = "vcenter.domain.local"
  13. Connect-VIServer -Server $vCenterServername
  14. Get-VM | `
  15. Where-Object {$_.PowerState -eq "PoweredOn"} | `
  16. Shutdown-VMGuest -Confirm:$false
  17. Start-Sleep -Seconds 300
  18. Get-VM | `
  19. Where-Object {$_.PowerState -eq "PoweredOn"} | `
  20. Stop-VM -Confirm:$false
  21. Start-Sleep -Seconds 60
  22. $VMHosts = Get-VMHost
  23. $VMHosts | `
  24. Set-VMHost -State Maintenance -Confirm:$false
  25. $VMHosts | `
  26. Stop-VMHost -Confirm:$false
  27.  
  28. START "" "C:\scripts\putty.exe" -ssh 10.0.0.10 -l root -pw rootpw -m c:\scripts\sanshutdown.sh
  29.  
  30. shutdown /s /f /t 0
  31.  
  32.  
  33.  
  34. sanshutdown.sh SAN storage server shutdown command (falconstor specific)
  35. -----------------------------------------------------------------------------
  36. echo y | ipstor stop all
  37. sync;sync;poweroff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement