VMware: Check if cluster exists or not (#38517)
This fix adds a check if Datacenter contains cluster but does not have ESXi server associated with that cluster. Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
efc3f4f824
commit
93fbfbe4cf
1 changed files with 2 additions and 0 deletions
|
@ -1722,6 +1722,8 @@ class PyVmomiHelper(PyVmomi):
|
|||
# next priority, cluster given, take the root of the pool
|
||||
elif self.params['cluster']:
|
||||
cluster = self.cache.get_cluster(self.params['cluster'])
|
||||
if cluster is None:
|
||||
self.module.fail_json(msg="Unable to find cluster '%(cluster)s'" % self.params)
|
||||
resource_pool = cluster.resourcePool
|
||||
# fallback, pick any RP
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue