fog-vsphere 2.5.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +4 -0
  3. data/.travis.yml +1 -1
  4. data/CHANGELOG.md +9 -0
  5. data/README.md +7 -1
  6. data/fog-vsphere.gemspec +2 -1
  7. data/lib/fog-vsphere.rb +1 -0
  8. data/lib/fog/bin/vsphere.rb +1 -1
  9. data/lib/fog/vsphere.rb +2 -4
  10. data/lib/fog/vsphere/compute.rb +23 -6
  11. data/lib/fog/vsphere/models/compute/cdrom.rb +2 -2
  12. data/lib/fog/vsphere/models/compute/cdroms.rb +3 -3
  13. data/lib/fog/vsphere/models/compute/cluster.rb +2 -2
  14. data/lib/fog/vsphere/models/compute/clusters.rb +3 -3
  15. data/lib/fog/vsphere/models/compute/customfield.rb +2 -2
  16. data/lib/fog/vsphere/models/compute/customfields.rb +3 -3
  17. data/lib/fog/vsphere/models/compute/customvalue.rb +2 -2
  18. data/lib/fog/vsphere/models/compute/customvalues.rb +5 -5
  19. data/lib/fog/vsphere/models/compute/datacenter.rb +2 -2
  20. data/lib/fog/vsphere/models/compute/datacenters.rb +3 -3
  21. data/lib/fog/vsphere/models/compute/datastore.rb +2 -2
  22. data/lib/fog/vsphere/models/compute/datastores.rb +3 -3
  23. data/lib/fog/vsphere/models/compute/folder.rb +2 -2
  24. data/lib/fog/vsphere/models/compute/folders.rb +3 -3
  25. data/lib/fog/vsphere/models/compute/host.rb +2 -2
  26. data/lib/fog/vsphere/models/compute/hosts.rb +4 -4
  27. data/lib/fog/vsphere/models/compute/interface.rb +2 -2
  28. data/lib/fog/vsphere/models/compute/interfaces.rb +8 -8
  29. data/lib/fog/vsphere/models/compute/interfacetype.rb +2 -2
  30. data/lib/fog/vsphere/models/compute/interfacetypes.rb +5 -5
  31. data/lib/fog/vsphere/models/compute/network.rb +2 -2
  32. data/lib/fog/vsphere/models/compute/networks.rb +3 -3
  33. data/lib/fog/vsphere/models/compute/process.rb +2 -2
  34. data/lib/fog/vsphere/models/compute/resource_pool.rb +2 -2
  35. data/lib/fog/vsphere/models/compute/resource_pools.rb +3 -3
  36. data/lib/fog/vsphere/models/compute/rule.rb +2 -2
  37. data/lib/fog/vsphere/models/compute/rules.rb +4 -4
  38. data/lib/fog/vsphere/models/compute/scsicontroller.rb +2 -2
  39. data/lib/fog/vsphere/models/compute/server.rb +6 -6
  40. data/lib/fog/vsphere/models/compute/servers.rb +4 -4
  41. data/lib/fog/vsphere/models/compute/servertype.rb +2 -2
  42. data/lib/fog/vsphere/models/compute/servertypes.rb +4 -4
  43. data/lib/fog/vsphere/models/compute/snapshot.rb +2 -2
  44. data/lib/fog/vsphere/models/compute/snapshots.rb +3 -3
  45. data/lib/fog/vsphere/models/compute/storage_pod.rb +2 -2
  46. data/lib/fog/vsphere/models/compute/storage_pods.rb +3 -3
  47. data/lib/fog/vsphere/models/compute/template.rb +2 -2
  48. data/lib/fog/vsphere/models/compute/templates.rb +3 -3
  49. data/lib/fog/vsphere/models/compute/ticket.rb +2 -2
  50. data/lib/fog/vsphere/models/compute/tickets.rb +4 -4
  51. data/lib/fog/vsphere/models/compute/volume.rb +3 -3
  52. data/lib/fog/vsphere/models/compute/volumes.rb +5 -5
  53. data/lib/fog/vsphere/requests/compute/cloudinit_to_customspec.rb +2 -2
  54. data/lib/fog/vsphere/requests/compute/create_folder.rb +2 -2
  55. data/lib/fog/vsphere/requests/compute/create_group.rb +2 -2
  56. data/lib/fog/vsphere/requests/compute/create_rule.rb +2 -2
  57. data/lib/fog/vsphere/requests/compute/create_vm.rb +2 -2
  58. data/lib/fog/vsphere/requests/compute/current_time.rb +2 -2
  59. data/lib/fog/vsphere/requests/compute/destroy_group.rb +2 -2
  60. data/lib/fog/vsphere/requests/compute/destroy_rule.rb +2 -2
  61. data/lib/fog/vsphere/requests/compute/folder_destroy.rb +2 -2
  62. data/lib/fog/vsphere/requests/compute/get_cluster.rb +5 -4
  63. data/lib/fog/vsphere/requests/compute/get_compute_resource.rb +3 -3
  64. data/lib/fog/vsphere/requests/compute/get_datacenter.rb +4 -4
  65. data/lib/fog/vsphere/requests/compute/get_datastore.rb +3 -3
  66. data/lib/fog/vsphere/requests/compute/get_folder.rb +6 -6
  67. data/lib/fog/vsphere/requests/compute/get_host.rb +3 -3
  68. data/lib/fog/vsphere/requests/compute/get_interface_type.rb +3 -3
  69. data/lib/fog/vsphere/requests/compute/get_network.rb +4 -4
  70. data/lib/fog/vsphere/requests/compute/get_resource_pool.rb +3 -3
  71. data/lib/fog/vsphere/requests/compute/get_server_type.rb +5 -5
  72. data/lib/fog/vsphere/requests/compute/get_storage_pod.rb +3 -3
  73. data/lib/fog/vsphere/requests/compute/get_template.rb +2 -2
  74. data/lib/fog/vsphere/requests/compute/get_virtual_machine.rb +4 -4
  75. data/lib/fog/vsphere/requests/compute/get_vm_first_scsi_controller.rb +3 -3
  76. data/lib/fog/vsphere/requests/compute/host_finish_maintenance.rb +2 -2
  77. data/lib/fog/vsphere/requests/compute/host_shutdown.rb +2 -2
  78. data/lib/fog/vsphere/requests/compute/host_start_maintenance.rb +2 -2
  79. data/lib/fog/vsphere/requests/compute/list_child_snapshots.rb +2 -2
  80. data/lib/fog/vsphere/requests/compute/list_clusters.rb +2 -2
  81. data/lib/fog/vsphere/requests/compute/list_compute_resources.rb +2 -2
  82. data/lib/fog/vsphere/requests/compute/list_customfields.rb +2 -2
  83. data/lib/fog/vsphere/requests/compute/list_datacenters.rb +2 -2
  84. data/lib/fog/vsphere/requests/compute/list_datastores.rb +4 -4
  85. data/lib/fog/vsphere/requests/compute/list_folders.rb +2 -2
  86. data/lib/fog/vsphere/requests/compute/list_groups.rb +2 -2
  87. data/lib/fog/vsphere/requests/compute/list_hosts.rb +2 -2
  88. data/lib/fog/vsphere/requests/compute/list_interface_types.rb +2 -2
  89. data/lib/fog/vsphere/requests/compute/list_networks.rb +4 -4
  90. data/lib/fog/vsphere/requests/compute/list_processes.rb +2 -2
  91. data/lib/fog/vsphere/requests/compute/list_resource_pools.rb +2 -2
  92. data/lib/fog/vsphere/requests/compute/list_rules.rb +2 -2
  93. data/lib/fog/vsphere/requests/compute/list_server_types.rb +2 -2
  94. data/lib/fog/vsphere/requests/compute/list_storage_pods.rb +2 -2
  95. data/lib/fog/vsphere/requests/compute/list_templates.rb +2 -2
  96. data/lib/fog/vsphere/requests/compute/list_virtual_machines.rb +2 -2
  97. data/lib/fog/vsphere/requests/compute/list_vm_cdroms.rb +3 -3
  98. data/lib/fog/vsphere/requests/compute/list_vm_customvalues.rb +2 -2
  99. data/lib/fog/vsphere/requests/compute/list_vm_interfaces.rb +3 -3
  100. data/lib/fog/vsphere/requests/compute/list_vm_scsi_controllers.rb +4 -4
  101. data/lib/fog/vsphere/requests/compute/list_vm_snapshots.rb +2 -2
  102. data/lib/fog/vsphere/requests/compute/list_vm_volumes.rb +2 -2
  103. data/lib/fog/vsphere/requests/compute/modify_vm_cdrom.rb +2 -2
  104. data/lib/fog/vsphere/requests/compute/modify_vm_controller.rb +2 -2
  105. data/lib/fog/vsphere/requests/compute/modify_vm_interface.rb +4 -4
  106. data/lib/fog/vsphere/requests/compute/modify_vm_volume.rb +2 -2
  107. data/lib/fog/vsphere/requests/compute/revert_to_snapshot.rb +2 -2
  108. data/lib/fog/vsphere/requests/compute/set_vm_customvalue.rb +2 -2
  109. data/lib/fog/vsphere/requests/compute/update_vm.rb +2 -2
  110. data/lib/fog/vsphere/requests/compute/upload_iso.rb +4 -4
  111. data/lib/fog/vsphere/requests/compute/vm_acquire_ticket.rb +2 -2
  112. data/lib/fog/vsphere/requests/compute/vm_clone.rb +11 -8
  113. data/lib/fog/vsphere/requests/compute/vm_config_vnc.rb +2 -2
  114. data/lib/fog/vsphere/requests/compute/vm_destroy.rb +2 -2
  115. data/lib/fog/vsphere/requests/compute/vm_execute.rb +2 -2
  116. data/lib/fog/vsphere/requests/compute/vm_migrate.rb +2 -2
  117. data/lib/fog/vsphere/requests/compute/vm_power_off.rb +2 -2
  118. data/lib/fog/vsphere/requests/compute/vm_power_on.rb +2 -2
  119. data/lib/fog/vsphere/requests/compute/vm_reboot.rb +2 -2
  120. data/lib/fog/vsphere/requests/compute/vm_reconfig_cdrom.rb +2 -2
  121. data/lib/fog/vsphere/requests/compute/vm_reconfig_cpus.rb +2 -2
  122. data/lib/fog/vsphere/requests/compute/vm_reconfig_hardware.rb +2 -2
  123. data/lib/fog/vsphere/requests/compute/vm_reconfig_memory.rb +2 -2
  124. data/lib/fog/vsphere/requests/compute/vm_reconfig_volumes.rb +2 -2
  125. data/lib/fog/vsphere/requests/compute/vm_relocate.rb +2 -2
  126. data/lib/fog/vsphere/requests/compute/vm_remove_snapshot.rb +2 -2
  127. data/lib/fog/vsphere/requests/compute/vm_rename.rb +2 -2
  128. data/lib/fog/vsphere/requests/compute/vm_revert_snapshot.rb +2 -2
  129. data/lib/fog/vsphere/requests/compute/vm_suspend.rb +2 -2
  130. data/lib/fog/vsphere/requests/compute/vm_take_snapshot.rb +2 -2
  131. data/lib/fog/vsphere/version.rb +1 -1
  132. data/tests/helper.rb +3 -0
  133. data/tests/models/compute/cluster_tests.rb +3 -3
  134. data/tests/models/compute/hosts_tests.rb +1 -1
  135. data/tests/models/compute/rules_tests.rb +1 -1
  136. data/tests/models/compute/server_tests.rb +4 -4
  137. data/tests/models/compute/server_unit_tests.rb +1 -1
  138. data/tests/models/compute/servers_tests.rb +1 -1
  139. data/tests/models/compute/tickets_tests.rb +1 -1
  140. data/tests/requests/compute/get_network_tests.rb +23 -15
  141. data/tests/requests/compute/revert_to_snapshot_tests.rb +1 -1
  142. data/tests/requests/compute/update_vm_tests.rb +1 -1
  143. data/tests/requests/compute/vm_clone_tests.rb +10 -5
  144. metadata +26 -5
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def list_interface_types(filters = {})
6
6
  datacenter_name = filters[:datacenter]
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def list_networks(filters = {})
6
6
  datacenter_name = filters[:datacenter]
@@ -107,10 +107,10 @@ module Fog
107
107
  cluster_name = filters.fetch(:cluster, nil)
108
108
  if cluster_name.nil?
109
109
  data[:networks].values.select { |d| d['datacenter'] == datacenter_name } ||
110
- raise(Fog::Compute::Vsphere::NotFound)
110
+ raise(Fog::Vsphere::Compute::NotFound)
111
111
  else
112
112
  data[:networks].values.select { |d| d['datacenter'] == datacenter_name && d['cluster'].include?(cluster_name) } ||
113
- raise(Fog::Compute::Vsphere::NotFound)
113
+ raise(Fog::Vsphere::Compute::NotFound)
114
114
  end
115
115
  end
116
116
  end
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def list_processes(vm_id, opts)
6
6
  vm = get_vm_ref(vm_id)
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def list_resource_pools(filters = {})
6
6
  datacenter_name = filters[:datacenter]
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def list_rules(filters = {})
6
6
  cluster = get_raw_cluster(filters[:cluster], filters[:datacenter])
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def list_server_types(filters = {})
6
6
  datacenter_name = filters[:datacenter]
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def list_storage_pods(filters = {})
6
6
  datacenter_name = filters[:datacenter]
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def list_templates(options = {})
6
6
  options[:folder] ||= options['folder']
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def list_virtual_machines(options = {})
6
6
  # Listing all VM's can be quite slow and expensive. Try and optimize
@@ -1,7 +1,7 @@
1
1
  # rubocop:disable Lint/RescueWithoutErrorClass
2
2
  module Fog
3
- module Compute
4
- class Vsphere
3
+ module Vsphere
4
+ class Compute
5
5
  class Real
6
6
  def list_vm_cdroms(vm_id)
7
7
  get_vm_ref(vm_id).config.hardware.device.select { |hw| hw.class == RbVmomi::VIM::VirtualCdrom }.map do |cdrom|
@@ -25,7 +25,7 @@ module Fog
25
25
  end
26
26
  class Mock
27
27
  def list_vm_cdroms(vm_id)
28
- raise Fog::Compute::Vsphere::NotFound, 'VM not Found' unless data[:servers].key?(vm_id)
28
+ raise Fog::Vsphere::Compute::NotFound, 'VM not Found' unless data[:servers].key?(vm_id)
29
29
  return [] unless data[:servers][vm_id].key?('cdroms')
30
30
  data[:servers][vm_id]['cdroms'].map { |h| h.merge(instance_uuid: vm_id) }
31
31
  end
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def list_vm_customvalues(vm_id)
6
6
  get_vm_ref(vm_id).summary.customValue.map do |customvalue|
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  # => VirtualE1000(
6
6
  # addressType: "assigned",
@@ -44,7 +44,7 @@ module Fog
44
44
  def get_raw_interface(vm_id, options = {})
45
45
  raise ArgumentError, 'instance id is a required parameter' unless vm_id
46
46
 
47
- if options.is_a? Fog::Compute::Vsphere::Interface
47
+ if options.is_a? Fog::Vsphere::Compute::Interface
48
48
  options
49
49
 
50
50
  else
@@ -1,10 +1,10 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def list_vm_scsi_controllers(vm_id)
6
6
  list_vm_scsi_controllers_raw(vm_id).map do |raw_controller|
7
- Fog::Compute::Vsphere::SCSIController.new(raw_controller)
7
+ Fog::Vsphere::Compute::SCSIController.new(raw_controller)
8
8
  end
9
9
  end
10
10
 
@@ -21,7 +21,7 @@ module Fog
21
21
  end
22
22
  class Mock
23
23
  def list_vm_scsi_controllers(vm_id)
24
- raise Fog::Compute::Vsphere::NotFound, 'VM not Found' unless data[:servers].key?(vm_id)
24
+ raise Fog::Vsphere::Compute::NotFound, 'VM not Found' unless data[:servers].key?(vm_id)
25
25
  return [] unless data[:servers][vm_id].key?('scsi_controllers')
26
26
  data[:servers][vm_id]['scsi_controllers'].map { |h| h.merge(server_id: vm_id) }
27
27
  end
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def list_vm_snapshots(vm_id, opts = {})
6
6
  vm_snapshot_info = get_vm_ref(vm_id).snapshot
@@ -1,7 +1,7 @@
1
1
  # rubocop:disable Lint/RescueWithoutErrorClass
2
2
  module Fog
3
- module Compute
4
- class Vsphere
3
+ module Vsphere
4
+ class Compute
5
5
  class Real
6
6
  # [VirtualDisk(
7
7
  # backing: VirtualDiskFlatVer2BackingInfo(
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def add_vm_cdrom(cdrom)
6
6
  vm_reconfig_hardware('instance_uuid' => cdrom.server.instance_uuid, 'hardware_spec' => { 'deviceChange' => [create_cdrom(cdrom, cdrom.unit_number, :add)] })
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def add_vm_controller(controller)
6
6
  vm_reconfig_hardware('instance_uuid' => controller.server_id, 'hardware_spec' => { 'deviceChange' => [create_controller(controller)] })
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def add_vm_interface(vmid, options = {})
6
6
  raise ArgumentError, 'instance id is a required parameter' unless vmid
@@ -49,10 +49,10 @@ module Fog
49
49
 
50
50
  elsif options[:key] && (options[:key] > 0)
51
51
  oldattributes = get_vm_interface(vmid, options)
52
- Fog::Compute::Vsphere::Interface.new(oldattributes.merge(options))
52
+ Fog::Vsphere::Compute::Interface.new(oldattributes.merge(options))
53
53
 
54
54
  elsif options[:type] && options[:network]
55
- Fog::Compute::Vsphere::Interface.new options
55
+ Fog::Vsphere::Compute::Interface.new options
56
56
 
57
57
  else
58
58
  raise ArgumentError, 'interface is a required parameter or pass options with type and network'
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def add_vm_volume(volume)
6
6
  vm_reconfig_hardware('instance_uuid' => volume.server_id, 'hardware_spec' => { 'deviceChange' => [create_disk(volume, :add)] })
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def revert_to_snapshot(snapshot)
6
6
  unless Snapshot === snapshot
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def set_vm_customvalue(vm_id, key, value)
6
6
  vm_ref = get_vm_ref(vm_id)
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def update_vm(server)
6
6
  attributes = server.attributes
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def upload_iso_check_options(options)
6
6
  default_options = {
@@ -11,8 +11,8 @@ module Fog
11
11
  required_options.each do |param|
12
12
  raise ArgumentError, "#{required_options.join(', ')} are required" unless options.key? param
13
13
  end
14
- raise Fog::Compute::Vsphere::NotFound, "Datacenter #{options['datacenter']} Doesn't Exist!" unless get_datacenter(options['datacenter'])
15
- raise Fog::Compute::Vsphere::NotFound, "Datastore #{options['datastore']} Doesn't Exist!" unless get_raw_datastore(options['datastore'], options['datacenter'])
14
+ raise Fog::Vsphere::Compute::NotFound, "Datacenter #{options['datacenter']} Doesn't Exist!" unless get_datacenter(options['datacenter'])
15
+ raise Fog::Vsphere::Compute::NotFound, "Datastore #{options['datastore']} Doesn't Exist!" unless get_raw_datastore(options['datastore'], options['datacenter'])
16
16
  options
17
17
  end
18
18
 
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def vm_acquire_ticket(options = {})
6
6
  raise ArgumentError, 'instance_uuid is a required parameter' unless options.key?('instance_uuid')
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  module Shared
5
5
  private
6
6
 
@@ -19,10 +19,13 @@ module Fog
19
19
  required_options.each do |param|
20
20
  raise ArgumentError, "#{required_options.join(', ')} are required" unless options.key? param
21
21
  end
22
- raise Fog::Compute::Vsphere::NotFound, "Datacenter #{options['datacenter']} Doesn't Exist!" unless get_datacenter(options['datacenter'])
23
- raise Fog::Compute::Vsphere::NotFound, "Template #{options['template_path']} Doesn't Exist!" unless get_virtual_machine(options['template_path'], options['datacenter'])
22
+ raise ArgumentError, 'cluster option is required' unless options['resource_pool'][0]
23
+ raise Fog::Vsphere::Compute::NotFound, "Datacenter #{options['datacenter']} Doesn't Exist!" unless get_datacenter(options['datacenter'])
24
+ raise Fog::Vsphere::Compute::NotFound, "Template #{options['template_path']} Doesn't Exist!" unless get_virtual_machine(options['template_path'], options['datacenter'])
25
+ raise Fog::Vsphere::Compute::NotFound, "Cluster #{options['resource_pool'][0]} Doesn't Exist in the DC!" unless get_raw_cluster(options["resource_pool"][0], options['datacenter'])
26
+ raise ArgumentError, 'path option is required' unless options.fetch('dest_folder', '/')
24
27
  if options.key?('storage_pod') && !options['storage_pod'].nil? && !get_raw_storage_pod(options['storage_pod'], options['datacenter'])
25
- raise Fog::Compute::Vsphere::NotFound, "Storage Pod #{options['storage_pod']} Doesn't Exist!"
28
+ raise Fog::Vsphere::Compute::NotFound, "Storage Pod #{options['storage_pod']} Doesn't Exist!"
26
29
  end
27
30
  options
28
31
  end
@@ -641,7 +644,7 @@ module Fog
641
644
  config: virtual_machine_config_spec,
642
645
  customization: customization_spec,
643
646
  powerOn: options.key?('power_on') ? options['power_on'] : true,
644
- template: false)
647
+ template: options.key?('template') ? options['template'] : false)
645
648
 
646
649
  # Perform the actual Clone Task
647
650
  # Clone VM on a storage pod
@@ -774,7 +777,7 @@ module Fog
774
777
  device: template_nic
775
778
  }
776
779
  else
777
- interface = Fog::Compute::Vsphere::Interface.new(raw_to_hash(template_nic))
780
+ interface = Fog::Vsphere::Compute::Interface.new(raw_to_hash(template_nic))
778
781
  specs << create_interface(interface, interface.key, :remove, datacenter: datacenter)
779
782
  end
780
783
  end
@@ -833,7 +836,7 @@ module Fog
833
836
  def vm_clone(options = {})
834
837
  # Option handling TODO Needs better method of checking
835
838
  options = vm_clone_check_options(options)
836
- notfound = -> { raise Fog::Compute::Vsphere::NotFound, 'Could not find VM template' }
839
+ notfound = -> { raise Fog::Vsphere::Compute::NotFound, 'Could not find VM template' }
837
840
  template = list_virtual_machines.find(notfound) do |vm|
838
841
  vm['name'] == options['template_path'].split('/')[-1]
839
842
  end
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def vm_config_vnc(options = {})
6
6
  raise ArgumentError, 'instance_uuid is a required parameter' unless options.key? 'instance_uuid'
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def vm_destroy(options = {})
6
6
  raise ArgumentError, 'instance_uuid is a required parameter' unless options.key? 'instance_uuid'
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  # NOTE: you must be using vsphere_rev 5.0 or greater to use this functionality
6
6
  # e.g. Fog::Compute.new(provider: "vsphere", vsphere_rev: "5.5", etc)
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def vm_migrate(options = {})
6
6
  # priority is the only required option, and it has a sane default option.
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def vm_power_off(options = {})
6
6
  options = { 'force' => false }.merge(options)
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def vm_power_on(options = {})
6
6
  raise ArgumentError, 'instance_uuid is a required parameter' unless options.key? 'instance_uuid'
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def vm_reboot(options = {})
6
6
  options = { 'force' => false }.merge(options)
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def vm_reconfig_cdrom(options = {})
6
6
  raise ArgumentError, 'instance_uuid is a required parameter' unless options.key? 'instance_uuid'
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def vm_reconfig_cpus(options = {})
6
6
  raise ArgumentError, 'cpus is a required parameter' unless options.key? 'cpus'
@@ -1,6 +1,6 @@
1
1
  module Fog
2
- module Compute
3
- class Vsphere
2
+ module Vsphere
3
+ class Compute
4
4
  class Real
5
5
  def vm_reconfig_hardware(options = {})
6
6
  raise ArgumentError, 'hardware_spec is a required parameter' unless options.key? 'hardware_spec'