server/lib/deltacloud/drivers/vsphere/vsphere_client.rb
# Find a ResourcePool[1] object associated by given Datastore
# ResourcePool is defined for Datacenter and is used for launching a new
# instance
#
# [1] http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.ResourcePool.html
#
Find a ResourcePool[1] object associated by given Datastore
ResourcePool is defined for Datacenter and is used for launching a new
instance


Find a ResourcePool [ 1 ] object associated by given Datastore ResourcePool is defined for Datacenter and is used for launching a new instance
def find_resource_pool(credentials, name)
      vsphere = new_client(credentials)
      safely do
        rootFolder = vsphere.serviceInstance.content.rootFolder
        dc = rootFolder.childEntity.grep(RbVmomi::VIM::Datacenter).select do |dc|
          dc.datastoreFolder.childEntity.find { |d| d.name == name }.nil? == false
        end.flatten.compact.first
        dc = rootFolder.childEntity.grep(RbVmomi::VIM::Datacenter).first
        dc.hostFolder.childEntity.collect.first.resourcePool
      end
    end
def find_resource_pool ( credentials , name ) vsphere = new_client ( credentials ) safely do rootFolder = vsphere . serviceInstance . content . rootFolder dc = rootFolder . childEntity . grep ( RbVmomi :: VIM :: Datacenter ) . select do | dc | dc . datastoreFolder . childEntity . find { | d | d . name == name } . nil? == false end . flatten . compact . first dc = rootFolder . childEntity . grep ( RbVmomi :: VIM :: Datacenter ) . first dc . hostFolder . childEntity . collect . first . resourcePool end end
Find a ResourcePool[1] object associated by given Datastore
ResourcePool is defined for Datacenter and is used for launching a new
instance
Find a ResourcePool [ 1 ] object associated by given Datastore ResourcePool is defined for Datacenter and is used for launching a new instance
credentials
<not_specific>
name
<not_specific>