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 create_disk(pool_name, vm_name, disk_size)
          pool = pool_config(pool_name)
          raise("Pool #{pool_name} does not exist for the provider #{name}") if pool.nil?
          datastore_name = pool['datastore']
          raise("Pool #{pool_name} does not have a datastore defined for the provider #{name}") if datastore_name.nil?
          @connection_pool.with_metrics do |pool_object|
            connection = ensured_vsphere_connection(pool_object)
            vm_object = find_vm(pool_name, vm_name, connection)
            raise("VM #{vm_name} in pool #{pool_name} does not exist for the provider #{name}") if vm_object.nil?
            add_disk(vm_object, disk_size, datastore_name, connection, get_target_datacenter_from_config(pool_name))
          end
          true
        end
def create_disk ( pool_name , vm_name , disk_size ) pool = pool_config ( pool_name ) raise ( "Pool #{pool_name} does not exist for the provider #{name}" ) if pool . nil? datastore_name = pool [ 'datastore' ] raise ( "Pool #{pool_name} does not have a datastore defined for the provider #{name}" ) if datastore_name . nil? @connection_pool . with_metrics do | pool_object | connection = ensured_vsphere_connection ( pool_object ) vm_object = find_vm ( pool_name , vm_name , connection ) raise ( "VM #{vm_name} in pool #{pool_name} does not exist for the provider #{name}" ) if vm_object . nil? add_disk ( vm_object , disk_size , datastore_name , connection , get_target_datacenter_from_config ( pool_name ) ) end true end
The connection_pool method is normally used only for testing
The connection_pool method is normally used only for testing
pool_name
vm_name
disk_size