Pages: [1]
Print
Author Topic: Find HA/DRS status of each host in cluster  (Read 449 times)
esarakaitis
Administrator
Full Member
*****
Posts: 218


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« on: February 10, 2009, 07:28:41 AM »

Code:
Get-Cluster | Get-View | %{
  foreach($h in $_.Host){
      Write-Host $_.name
      Write-Host "`tDRS enabled : " $_.Configuration.DRSConfig.Enabled
      Write-Host "`tHA enabled  : " $_.Configuration.DasConfig.Enabled
    }
  }

todo: write vmhost hostname as well
Logged
fpoelert
Newbie
*
Posts: 1


View Profile
« Reply #1 on: February 25, 2009, 10:25:14 AM »

Hi esarakatis,

I've added the hostname like this:

Code:
Get-Cluster | Get-View | %{
      Write-Host $_.name
     foreach($ref in $_.Host){
          $h = Get-VIObjectByVIView -MORef $ref |Get-View
          Write-Host $h.name
           Write-Host "`tDRS enabled : " $_.Configuration.DRSConfig.Enabled
           Write-Host "`tHA enabled  : " $_.Configuration.DasConfig.Enabled
      }
      Write-Host  "`n"
 }
Regards,
Frank
« Last Edit: February 25, 2009, 02:04:13 PM by esarakaitis » Logged
esarakaitis
Administrator
Full Member
*****
Posts: 218


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« Reply #2 on: February 25, 2009, 02:04:25 PM »

sweet deal, great job!
Logged
Pages: [1]
Print
Jump to: