diff --git a/src/vmm_mad/remotes/vcenter/vcenter_driver.rb b/src/vmm_mad/remotes/vcenter/vcenter_driver.rb index 3c5c617252..4cc09b46b2 100644 --- a/src/vmm_mad/remotes/vcenter/vcenter_driver.rb +++ b/src/vmm_mad/remotes/vcenter/vcenter_driver.rb @@ -160,6 +160,9 @@ class VIClient ######################################################################## # The associated resource pool for this connection + # @return [ResourcePool] an array of resource pools including the default + #  resource pool. If the connection is confined to a particular + #  resource pool, then return just that one ######################################################################## def resource_pool rp_name = @one_host["TEMPLATE/VCENTER_RESOURCE_POOL"] @@ -173,6 +176,15 @@ class VIClient end end + ######################################################################## + # Get the default resource pool of the connection. Only valid if + # the connection is not confined in a resource pool + # @return ResourcePool the default resource pool + ######################################################################## + def default_resource_pool + @cluster.resourcePool + end + ######################################################################## # Searches the desired ResourcePool of the DataCenter for the current # connection. Returns a RbVmomi::VIM::ResourcePool or the default pool @@ -1421,7 +1433,7 @@ private if connection.rp_confined? rp = connection.cluster.resource_pool.first else - rp = connection.cluster.resourcePool + rp = connection.cluster.default_resource_pool end relocate_spec = RbVmomi::VIM.VirtualMachineRelocateSpec(