VMware Cloud Community
mpverr
Enthusiast
Enthusiast
Jump to solution

Enabling Host Monitoring on vSphere 6.5 via PowerCli not working

Greetings folks -

Between LucD and RvdNieuwendijk I have found a lot of help in some "advanced" coding for powercli.  However, this issue has me completely stumped and am hoping the community can help me out.

I'm trying to ENABLE host monitoring (vSphere 6.5 update 1).

https://books.google.com/books?id=91MoDwAAQBAJ&pg=PA308&lpg=PA308&dq=powercli+cannot+enable+host+mon...

Using the link above for example, they give an excellent run down on how to disable host monitoring.  At the end of that section it cites (and makes sense) to enable it, you just change "disabled" to "enabled".

When I do this, while it cites it works it actually does not.  Using that code I am able to DISABLE.  But it will not ENABLE.  Even after I run the code to enable if I take a look at :

$a = get-cluster

$a.extensiondata.configuration.dasconfig

I see that HostMonitoring was set to enabled.  But when you look in the GUI it's still disabled.

Any help would be truly appreciated as all the code snippets I have tried in this message board and found on the web do not actually work in 6.5.

pce!

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You can enable Host Monitoring with this

$clusterName = 'MyCluster'

$cluster = Get-Cluster -Name $clusterName

$spec = New-Object VMware.Vim.ClusterConfigSpec

$spec.DasConfig = New-Object VMware.Vim.ClusterDasConfigInfo

$spec.DasConfig.Enabled = $true

$spec.DasConfig.HostMonitoring = [VMware.Vim.ClusterDasConfigInfoServiceState]::enabled

$cluster.ExtensionData.ReconfigureCluster($spec,$true)

But it might take a couple of seconds and a Refresh in the Web Client before it show as being enabled.

It helps when you switch to <Cluster>-Monitor-vSphere HA and then back


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

View solution in original post

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

You can enable Host Monitoring with this

$clusterName = 'MyCluster'

$cluster = Get-Cluster -Name $clusterName

$spec = New-Object VMware.Vim.ClusterConfigSpec

$spec.DasConfig = New-Object VMware.Vim.ClusterDasConfigInfo

$spec.DasConfig.Enabled = $true

$spec.DasConfig.HostMonitoring = [VMware.Vim.ClusterDasConfigInfoServiceState]::enabled

$cluster.ExtensionData.ReconfigureCluster($spec,$true)

But it might take a couple of seconds and a Refresh in the Web Client before it show as being enabled.

It helps when you switch to <Cluster>-Monitor-vSphere HA and then back


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

Reply
0 Kudos
RvdNieuwendijk
Leadership
Leadership
Jump to solution

The script to enable host monitoring from my Learning PowerCLI Second Edition book works fine. You have to refresh the cluster in the vSphere Web Client to see the change.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Thanks for confirming that :smileygrin:


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

Reply
0 Kudos
mpverr
Enthusiast
Enthusiast
Jump to solution

Thanks for taking the time out of your day to reply.  Very weird.  Even doing a refresh didn't show it.  I actually had to log out/in for it to show up.  Even though my code showed that it was enabled.  That is what was causing me such confusion.  Silly GUI.

Reply
0 Kudos