Class Fog::Compute::Vsphere::Real
In: lib/fog/vsphere/compute.rb
lib/fog/vsphere/requests/compute/vm_power_on.rb
lib/fog/vsphere/requests/compute/get_virtual_machine.rb
lib/fog/vsphere/requests/compute/create_folder.rb
lib/fog/vsphere/requests/compute/list_virtual_machines.rb
lib/fog/vsphere/requests/compute/get_cluster.rb
lib/fog/vsphere/requests/compute/vm_clone.rb
lib/fog/vsphere/requests/compute/list_datastores.rb
lib/fog/vsphere/requests/compute/current_time.rb
lib/fog/vsphere/requests/compute/list_resource_pools.rb
lib/fog/vsphere/requests/compute/vm_config_vnc.rb
lib/fog/vsphere/requests/compute/vm_reboot.rb
lib/fog/vsphere/requests/compute/list_networks.rb
lib/fog/vsphere/requests/compute/get_network.rb
lib/fog/vsphere/requests/compute/get_resource_pool.rb
lib/fog/vsphere/requests/compute/list_clusters.rb
lib/fog/vsphere/requests/compute/vm_reconfig_cpus.rb
lib/fog/vsphere/requests/compute/get_datacenter.rb
lib/fog/vsphere/requests/compute/list_vm_interfaces.rb
lib/fog/vsphere/requests/compute/get_folder.rb
lib/fog/vsphere/requests/compute/vm_destroy.rb
lib/fog/vsphere/requests/compute/create_vm.rb
lib/fog/vsphere/requests/compute/list_vm_volumes.rb
lib/fog/vsphere/requests/compute/list_folders.rb
lib/fog/vsphere/requests/compute/list_datacenters.rb
lib/fog/vsphere/requests/compute/get_datastore.rb
lib/fog/vsphere/requests/compute/vm_power_off.rb
lib/fog/vsphere/requests/compute/vm_reconfig_hardware.rb
lib/fog/vsphere/requests/compute/vm_reconfig_memory.rb
lib/fog/vsphere/requests/compute/vm_migrate.rb
Parent: Object

Methods

Included Modules

Shared Shared

Public Class methods

Public Instance methods

Grabs all sub folders within a given path folder.

Parameters

  • filters<~Hash>:
    • :datacenter<~String> - REQUIRED Your datacenter where you‘re looking for folders. Example: ‘my-datacenter-name’ (passed if you are using the models/collections)
        eg: vspconn.datacenters.first.vm_folders('mypath')
      
    • :path<~String> - Your path where you‘re looking for more folders, if return = none you will get an error. If you don‘t define it will look in the main datacenter folder for any folders in that datacenter.

Example Usage Testing Only:

 vspconn = Fog::Compute[:vsphere]
 mydc = vspconn.datacenters.first
 folders = mydc.vm_folders
 => VirtualE1000(

addressType: "assigned", backing: VirtualEthernetCardNetworkBackingInfo(

  deviceName: "VM Network",
  dynamicProperty: [],
  network: Network("network-163"),
  useAutoDetect: false

), connectable: VirtualDeviceConnectInfo(

  allowGuestControl: true,
  connected: true,
  dynamicProperty: [],
  startConnected: true,
  status: "ok"

), controllerKey: 100, deviceInfo: Description(

  dynamicProperty: [],
  label: "Network adapter 1",
  summary: "VM Network"

), dynamicProperty: [], key: 4000, macAddress: "00:50:56:a9:00:28", unitNumber: 7,

 [VirtualDisk(
  backing: VirtualDiskFlatVer2BackingInfo(
    contentId: "a172d19487e878e17d6b16ff2505d7eb",
    datastore: Datastore("datastore-162"),
    diskMode: "persistent",
    dynamicProperty: [],
    fileName: "[Storage1] rhel6-mfojtik/rhel6-mfojtik.vmdk",
    split: false,
    thinProvisioned: true,
    uuid: "6000C29c-a47d-4cd9-5249-c371de775f06",
    writeThrough: false
  ),
  capacityInKB: 8388608,
  controllerKey: 1000,
  deviceInfo: Description(
    dynamicProperty: [],
    label: "Hard disk 1",
    summary: "8,388,608 KB"
  ),
  dynamicProperty: [],
  key: 2001,
  shares: SharesInfo( dynamicProperty: [], level: "normal", shares: 1000 ),
  unitNumber: 1

)]

Clones a VM from a template or existing machine on your vSphere Server.

Parameters

  • options<~Hash>:
    • ‘datacenter’<~String> - REQUIRED Datacenter name your cloning in. Make sure this datacenter exists, should if you‘re using the clone function in server.rb model.
    • ‘template_path’<~String> - REQUIRED The path to the machine you want to clone FROM. Relative to Datacenter (Example: "FolderNameHere/VMNameHere")
    • ‘name’<~String> - REQUIRED The VMName of the Destination
    • ‘dest_folder’<~String> - Destination Folder of where ‘name’ will be placed on your cluster. Relative Path to Datacenter E.G. "FolderPlaceHere/anotherSub Folder/onemore"
    • ‘power_on’<~Boolean> - Whether to power on machine after clone. Defaults to true.
    • ‘wait’<~Boolean> - Whether the method should wait for the virtual machine to finish cloning before returning information from vSphere. Broken right now as you cannot return a model of a serer that isn‘t finished cloning. Defaults to True
    • ‘resource_pool’<~Array> - The resource pool on your datacenter cluster you want to use. Only works with clusters within same same datacenter as where you‘re cloning from. Datacenter grabbed from template_path option. Example: [‘cluster_name_here’,’resource_pool_name_here’]
    • ‘datastore’<~String> - The datastore you‘d like to use.
        (datacenterObj.datastoreFolder.find('name') in API)
      
    • ‘transform’<~String> - Not documented - see www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.vm.RelocateSpec.html
    • customization_spec<~Hash>: Options are marked as required if you use this customization_spec. Static IP Settings not configured. This only support cloning and setting DHCP on the first interface
      • ‘domain’<~String> - REQUIRED This is put into /etc/resolve.conf (we hope)
      • ‘hostname’<~String> - Hostname of the Guest Os - default is options[‘name’]
      • ‘hw_utc_clock’<~Boolean> - REQUIRED Is hardware clock UTC? Default true
      • ‘time_zone’<~String> - REQUIRED Only valid linux options are valid - example: ‘America/Denver‘

return a hash of VNC attributes required to view the console

Protected Instance methods

root ResourcePool + Children if they exists

[Validate]