VMware {code} Community
e_vmware
Contributor
Contributor

Howto get the clustername of a esx host

Hi,

I' ve no idea howto get the clustername of a esx host?

Regards,

Ulf

0 Kudos
2 Replies
jrackliffe
Hot Shot
Hot Shot

The only way I have done it is to get the parent property of the HostSystem mor. I double check that it is a Computres and then I consider myself done.

Don't know your tool of choice for hitting VI, but I think that should suffice unless someone knows where the parent of a HostSystem would not be a CompRes?

J

0 Kudos
dmhaynes
Enthusiast
Enthusiast

I think that the parent of a HostSystem could be a ComputeResource or a ClusterComputeResource depending on whether the HostSystem is actually associated with a cluster or not. If the original poster wants to differentiate between clustered and non-clustered systems, checking the parent MoRef type for these values would be important since only those HostSystems with the ClusterComputeResource parent would be associated with a cluster.

0 Kudos