VMware Cloud Community
krishnaprasad
Hot Shot
Hot Shot

how to verify if HA agent is properly enabled on a particular host in HA cluster

Hello list,

I have used VI toolkit and found pretty useful for doing automation . Thanks to the list.

I have a query regarding how to enable the HA agent on a particular host through VI Toolkit cmdlets.

I have tried the following.

Get-Cluster | Get-View | %{

foreach($h in $_.Host){

if((Get-View $h).Name -eq $esxtgt){

Write-Host $esxtgt

Write-Host "`tDRS enabled : " $_.Configuration.DRSConfig.Enabled

Write-Host "`tHA enabled : " $_.Configuration.DasConfig.Enabled

}

}

}

But this will give you whether the cluster you have created is enabled with HA / DRS. actually what i need is how to see the status of HA agent in a particular host in the HA cluster. your suggestions will be greatly appreciated.

thanks,

Krishnaprasad

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership

Afaik this not possible with the current build of the VITK (nor with the current SDK).

There is a cmdlet ( Get-VMHostService ) and a SDK method (RefreshServices) but they currently only return info for

the ntpd, sshd and vmware-vpxa services. Not for the HA agent.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

krishnaprasad
Hot Shot
Hot Shot

Thanks Lucd. Understood !

Another stuff is i was trying to extract the error messages from VIevents using the below command . but somehow it returns error messages only for today's date.even i have tried with start and finish parameters. here is the command i have executed . it returns all the error messages which happended today. does that mean the buffer is cleared after some time?

Get-VIEvent -Start (Get-Date).AddHours(-24) -Type Error | Format-Table CreatedTime, FullFormattedMessage -AutoSize

I can put my question in another way, is there any way to completely extract the error logs from VC Tasks and Events tab.?

Thanks,

krishnaprasad

Reply
0 Kudos
LucD
Leadership
Leadership

You should add the -Maxsamples parameter to the Get-VIEvent cmdlet.

The default is to return only 100 events.

Could that explain why you see only the most recent events ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
krishnaprasad
Hot Shot
Hot Shot

Great !! Thanks LucD. It worked for me :smileygrin: Thanks a lot !

- Krisnaprasad

Reply
0 Kudos