mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 03:42:52 +09:00
Bug #4124: Add comments for resource pool code and minor refactor
(cherry picked from commit fffcc62d0a)
This commit is contained in:
1 parent
4557db3d93
commit
b5be1631d9
1 file changed
+13
-1
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user