src/vsphere_cpi/lib/cloud/vsphere/resources/cluster.rb
def fetch_resource_pool_utilization
        properties = @client.cloud_searcher.get_properties(resource_pool.mob, Vim::ResourcePool, 'summary')
        raise "Failed to get utilization for resource pool '#{resource_pool}'" if properties.nil?

        runtime_info = properties["summary"].runtime
        memory = runtime_info.memory
        return (memory.max_usage - memory.overall_usage) / BYTES_IN_MB
      end
# Fetches the resource pool utilization from vSphere.
#
# We can only rely on the vSphere data if the resource pool is healthy.
# Otherwise we mark the resources as unavailable.
#
# Unfortunately this method does not work for the root resource pool,
# so we can't use it for the raw clusters.
#
# @return [void]
Fetches the resource pool utilization from vSphere.
We can only rely on the vSphere data if the resource pool is healthy.
Otherwise we mark the resources as unavailable.

Unfortunately this method does not work for the root resource pool,
so we can't use it for the raw clusters.
Fetches the resource pool utilization from vSphere . We can only rely on the vSphere data if the resource pool is healthy . Otherwise we mark the resources as unavailable . Unfortunately this method does not work for the root resource pool so we can ' t use it for the raw clusters .
def fetch_resource_pool_utilization
        properties = @client.cloud_searcher.get_properties(resource_pool.mob, Vim::ResourcePool, 'summary')
        raise "Failed to get utilization for resource pool '#{resource_pool}'" if properties.nil?
        runtime_info = properties["summary"].runtime
        memory = runtime_info.memory
        return (memory.max_usage - memory.overall_usage) / BYTES_IN_MB
      end
def fetch_resource_pool_utilization properties = @client . cloud_searcher . get_properties ( resource_pool . mob , Vim :: ResourcePool , 'summary' ) raise "Failed to get utilization for resource pool '#{resource_pool}'" if properties . nil? runtime_info = properties [ "summary" ] . runtime memory = runtime_info . memory return ( memory . max_usage - memory . overall_usage ) / BYTES_IN_MB end
Fetches the resource pool utilization from vSphere.
Fetches the resource pool utilization from vSphere .
None
void