server/lib/deltacloud/drivers/vsphere/vsphere_client.rb
# This helper will try to find a Datastore[1] object in all Datacenters.
# Datastore is used to place instance on create to correct place
#
# [1] http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.Datastore.html
#
This helper will try to find a Datastore[1] object in all Datacenters.
Datastore is used to place instance on create to correct place


This helper will try to find a Datastore [ 1 ] object in all Datacenters . Datastore is used to place instance on create to correct place
def find_datastore(credentials, name)
      vsphere = new_client(credentials)
      safely do
        rootFolder = vsphere.serviceInstance.content.rootFolder
        rootFolder.childEntity.grep(RbVmomi::VIM::Datacenter).collect do |dc|
          list_datastores(dc.datastoreFolder).each do |d|
            if d.name == name
              return d
            end
          end
        end
      end
    end
def find_datastore ( credentials , name ) vsphere = new_client ( credentials ) safely do rootFolder = vsphere . serviceInstance . content . rootFolder rootFolder . childEntity . grep ( RbVmomi :: VIM :: Datacenter ) . collect do | dc | list_datastores ( dc . datastoreFolder ) . each do | d | if d . name == name return d end end end end end
This helper will try to find a Datastore[1] object in all Datacenters.
This helper will try to find a Datastore [ 1 ] object in all Datacenters .
credentials
<not_specific>
name
<not_specific>