Pages: [1]
Print
Author Topic: HA + DRS informations about every VM on cluster  (Read 2191 times)
Halimou
Newbie
*
Posts: 3


View Profile
« on: September 16, 2009, 08:45:28 AM »

Hi !

Can you help me with a script who can display cluster's informations
about every HA virtual machine options on a cluster.

I need to make reporting and managers need to see for every guest :

 1.   Restart priority
 2.   Isolate Response
 3.   DRS Virtual machine Options

In CSV format if possible

Halim  Grin
Logged
esarakaitis
Administrator
Sr. Member
*****
Posts: 256


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« Reply #1 on: September 16, 2009, 07:39:59 PM »

did you do any searching on this site by chance?

http://www.vmwarescripting.com/index.php/topic,638.0.html
http://www.vmwarescripting.com/index.php/topic,912.0.html
Logged
Halimou
Newbie
*
Posts: 3


View Profile
« Reply #2 on: September 17, 2009, 03:17:08 AM »


Yes i saw it but your script didn't work, check this out :

Cluster                 : ESX Boulogne
Host                    : bsrspesx006.boursorama.fr
DRS Enabled             :
Default Behavior        :
Vmotion Rate            :
HA Enabled              :
Failover Level          :
AdmissionControlEnabled :
Restart Priority        :
Isolation Response      :

Cluster                 : ESX Boulogne
Host                    : bsrspesx005.boursorama.fr
DRS Enabled             :
Default Behavior        :
Vmotion Rate            :
HA Enabled              :
Failover Level          :
AdmissionControlEnabled :
Restart Priority        :
Isolation Response      :

Cluster                 : ESX Boulogne
Host                    : bsrspesx001.boursorama.fr
DRS Enabled             :
Default Behavior        :
Vmotion Rate            :
HA Enabled              :
Failover Level          :
AdmissionControlEnabled :
Restart Priority        :
Isolation Response      :

It doesn't matter, i have script who returned me this information but i want this report by  virtual machine ... Is it possible ?

Thx
Logged
esarakaitis
Administrator
Sr. Member
*****
Posts: 256


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« Reply #3 on: September 17, 2009, 07:14:28 AM »

here is my ouput:

Code:
Cluster                 : Lab Manager
Host                    : entlabsc01evdu
DRS Enabled             : True
Default Behavior        : fullyAutomated
Vmotion Rate            : 3
HA Enabled              : True
Failover Level          : 1
AdmissionControlEnabled : False
Restart Priority        : high
Isolation Response      : none

Cluster                 : Lab Manager
Host                    : entlabsc02evdu
DRS Enabled             : True
Default Behavior        : fullyAutomated
Vmotion Rate            : 3
HA Enabled              : True
Failover Level          : 1
AdmissionControlEnabled : False
Restart Priority        : high
Isolation Response      : none

Cluster                 : Lab Manager
Host                    : entlabsc03evdu
DRS Enabled             : True
Default Behavior        : fullyAutomated
Vmotion Rate            : 3
HA Enabled              : True
Failover Level          : 1
AdmissionControlEnabled : False
Restart Priority        : high
Isolation Response      : none


as per virtual machine, its not possible as HA/DRS rules are set per cluster, not on virtual machines...


are you talking DRS rules?
Logged
Halimou
Newbie
*
Posts: 3


View Profile
« Reply #4 on: September 17, 2009, 09:03:57 AM »

here is my ouput:

Code:
Cluster                 : Lab Manager
Host                    : entlabsc01evdu
DRS Enabled             : True
Default Behavior        : fullyAutomated
Vmotion Rate            : 3
HA Enabled              : True
Failover Level          : 1
AdmissionControlEnabled : False
Restart Priority        : high
Isolation Response      : none

Cluster                 : Lab Manager
Host                    : entlabsc02evdu
DRS Enabled             : True
Default Behavior        : fullyAutomated
Vmotion Rate            : 3
HA Enabled              : True
Failover Level          : 1
AdmissionControlEnabled : False
Restart Priority        : high
Isolation Response      : none

Cluster                 : Lab Manager
Host                    : entlabsc03evdu
DRS Enabled             : True
Default Behavior        : fullyAutomated
Vmotion Rate            : 3
HA Enabled              : True
Failover Level          : 1
AdmissionControlEnabled : False
Restart Priority        : high
Isolation Response      : none


as per virtual machine, its not possible as HA/DRS rules are set per cluster, not on virtual machines...


are you talking DRS rules?

No i need DRSAutomationLevel.

With this script i can have informations about HA isolation response and restart priority :

Code:
$clusName = <ClusterName>
$VMtab = @{}
$cluster = Get-Cluster -Name $clusName | Get-View | % {
if($_.ConfigurationEx.DasVmConfig -ne $null){
$_.ConfigurationEx.DasVmConfig | % {
$VMname = (Get-View -Id $_.Key).Name
$row = "" | Select VMname, HAIsolationResponse, HARestartPriority, DRSAutomationLevel
$row.VMname = $VMname
$row.HAIsolationResponse = $_.DasSettings.IsolationResponse
$row.HARestartPriority = $_.DasSettings.RestartPriority
$VMtab[$VMname] = $row
}
}
if($_.ConfigurationEx.DrsVmConfig -ne $null){
$_.COnfigurationEx.DrsVmCOnfig | %{
$VMname = (Get-View -Id $_.Key).Name
if( $VMtab.ContainsKey($VMName)){
$row = $VMtab[$VMname]
}
else{
$row = "" | Select VMname, HAIsolationResponse, HARestartPriority, DRSAutomationLevel
$row.VMname = $VMname
}
$row.DRSAutomationLevel = $_.Behavior
$VMtab[$VMname] = $row
}
}
}
$VMtab.Values | Export-Csv "C:\Program Files\VMware\Infrastructure\VIToolkitForWindows\Scripts\Report_Cluster_VM_HA_setting.csv" -noTypeInformation

« Last Edit: September 17, 2009, 09:41:27 AM by esarakaitis » Logged
esarakaitis
Administrator
Sr. Member
*****
Posts: 256


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« Reply #5 on: September 17, 2009, 09:41:06 AM »

you didn't say that you needed DRS automation level Smiley
Logged
Pages: [1]
Print
Jump to: