Is there a way to determine the hosts connected to a datastore cluster?
I found I can return the datastore clusters in vcenter by using the following:
var datastoreClusters = Server.findAllForType("Vc:StoragePod", null);
The problem is if I’m deploying to a cluster with only regular datastores for example, that piece of code returns the datastore cluster as a valid option when it isn’t since. I have already selected a host to deploy my vm to by this point in my workflow, so if I could determine what hosts are connected to the datastore cluster, I could eliminate it as an option.
So… anyone know how to find the hosts connected to a datastore cluster?
(I think the best option is to select datastore objects and datastore cluster objects connected to a given host though. I couldn’t figure it out so in the case of regular datastores, I just get all datastores and then loop though the results to see if it’s connected to my host. Probably not the most efficient way but it seems to work)
Thanks