lib/vmpooler/providers/vsphere.rb
# The connection_pool method is normally used only for testing
The connection_pool method is normally used only for testing
The connection_pool method is normally used only for testing
def find_vm(pool_name, vmname, connection)
          pool_configuration = pool_config(pool_name)
          return nil if pool_configuration.nil?
          folder = pool_configuration['folder']
          datacenter = get_target_datacenter_from_config(pool_name)
          return nil if datacenter.nil?
          propSpecs = { 
            entity: self,
            inventoryPath: "#{datacenter}/vm/#{folder}/#{vmname}"
          }
          connection.searchIndex.FindByInventoryPath(propSpecs) 
        end
def find_vm ( pool_name , vmname , connection ) pool_configuration = pool_config ( pool_name ) return nil if pool_configuration . nil? folder = pool_configuration [ 'folder' ] datacenter = get_target_datacenter_from_config ( pool_name ) return nil if datacenter . nil? propSpecs = { entity : self , inventoryPath : "#{datacenter}/vm/#{folder}/#{vmname}" } connection . searchIndex . FindByInventoryPath ( propSpecs ) end
The connection_pool method is normally used only for testing
The connection_pool method is normally used only for testing
# Find a VM by its inventory path and return the VM object # Returns nil when a VM, or pool configuration, cannot be found # rubocop:disable Naming/VariableName # rubocop:disable Naming/VariableName
pool_name
vmname
connection