fog-vsphere 3.4.0 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -4
- data/CHANGELOG.md +6 -0
- data/lib/fog/vsphere/compute.rb +10 -1
- data/lib/fog/vsphere/models/compute/clusters.rb +0 -2
- data/lib/fog/vsphere/models/compute/customfields.rb +0 -2
- data/lib/fog/vsphere/models/compute/customvalues.rb +0 -2
- data/lib/fog/vsphere/models/compute/datacenters.rb +0 -2
- data/lib/fog/vsphere/models/compute/datastores.rb +0 -2
- data/lib/fog/vsphere/models/compute/folders.rb +0 -2
- data/lib/fog/vsphere/models/compute/interfaces.rb +0 -2
- data/lib/fog/vsphere/models/compute/interfacetypes.rb +0 -2
- data/lib/fog/vsphere/models/compute/network.rb +1 -0
- data/lib/fog/vsphere/models/compute/networks.rb +0 -2
- data/lib/fog/vsphere/models/compute/resource_pools.rb +0 -2
- data/lib/fog/vsphere/models/compute/rules.rb +0 -2
- data/lib/fog/vsphere/models/compute/server.rb +3 -1
- data/lib/fog/vsphere/models/compute/servers.rb +0 -2
- data/lib/fog/vsphere/models/compute/servertypes.rb +0 -2
- data/lib/fog/vsphere/models/compute/templates.rb +0 -2
- data/lib/fog/vsphere/models/compute/tickets.rb +0 -2
- data/lib/fog/vsphere/models/compute/volumes.rb +0 -2
- data/lib/fog/vsphere/requests/compute/create_resource_pool.rb +5 -3
- data/lib/fog/vsphere/requests/compute/update_resource_pool.rb +1 -1
- data/lib/fog/vsphere/requests/compute/vm_clone.rb +8 -5
- data/lib/fog/vsphere/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18ada3fe97234aa0bf59aaab14ea04ba2ceaa40cb62abc6189026b6214d85759
|
4
|
+
data.tar.gz: 7894e6c462e8501eb2c9a16170300d75516ba8e4431a64be14d5cc6140271fbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8db1f07c4c800261506a22d0be60cc2c777a2da9e6001cee6a39a22218719af8eb4f105071383732c40f20201818645954a388420f7291bd0d3fecee0adc1a91
|
7
|
+
data.tar.gz: ba9313ddc1af94248d965ae9cda4734766cf36c494f33f5f84fc40581be22532ff96700539f63dce3583d955a60e86b75e367795bd3c0ca29291fa921717d1db
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## v3.5.0
|
2
|
+
* Clone vm from different datacenter (#263)
|
3
|
+
* Fix autoload issues (#267)
|
4
|
+
* Add extra_config attribute to server (#268)
|
5
|
+
* Expose `_ref` from Compute::Network (#265)
|
6
|
+
|
1
7
|
## v3.4.0
|
2
8
|
* list_resource_pools returns incorrect resource pool name (#256)
|
3
9
|
* Add ability to create update and delete Resource Pools (#253)
|
data/lib/fog/vsphere/compute.rb
CHANGED
@@ -168,7 +168,8 @@ module Fog
|
|
168
168
|
memoryHotAddEnabled: 'config.memoryHotAddEnabled',
|
169
169
|
firmware: 'config.firmware',
|
170
170
|
boot_order: 'config.bootOptions.bootOrder',
|
171
|
-
annotation: 'config.annotation'
|
171
|
+
annotation: 'config.annotation',
|
172
|
+
extra_config: 'config.extraConfig'
|
172
173
|
}.freeze
|
173
174
|
|
174
175
|
def convert_vm_view_to_attr_hash(vms)
|
@@ -250,6 +251,8 @@ module Fog
|
|
250
251
|
nil
|
251
252
|
end
|
252
253
|
}
|
254
|
+
|
255
|
+
attrs['extra_config'] = parse_extra_config(attrs['extra_config'])
|
253
256
|
end
|
254
257
|
# This inline rescue catches any standard error. While a VM is
|
255
258
|
# cloning, a call to the macs method will throw and NoMethodError
|
@@ -308,6 +311,12 @@ module Fog
|
|
308
311
|
end.compact.uniq
|
309
312
|
end
|
310
313
|
|
314
|
+
# Flattens Array of RbVmomi::VIM::OptionValue to simple hash
|
315
|
+
def parse_extra_config(vm_extra_config)
|
316
|
+
return unless vm_extra_config.is_a?(Array)
|
317
|
+
vm_extra_config.map { |entry| [entry[:key], entry[:value]] }.to_h
|
318
|
+
end
|
319
|
+
|
311
320
|
# returns vmware managed obj id string
|
312
321
|
def managed_obj_id(obj)
|
313
322
|
obj.to_s.match(/\("([^"]+)"\)/)[1]
|
@@ -52,6 +52,7 @@ module Fog
|
|
52
52
|
attribute :firmware
|
53
53
|
attribute :boot_order
|
54
54
|
attribute :annotation
|
55
|
+
attribute :extra_config
|
55
56
|
|
56
57
|
def initialize(attributes = {})
|
57
58
|
super defaults.merge(attributes)
|
@@ -157,7 +158,8 @@ module Fog
|
|
157
158
|
|
158
159
|
# Give our path to the request
|
159
160
|
req_options['template_path'] = "#{relative_path}/#{name}"
|
160
|
-
req_options['
|
161
|
+
req_options['template_datacenter'] = datacenter.to_s
|
162
|
+
req_options['datacenter'] ||= datacenter.to_s
|
161
163
|
|
162
164
|
# Perform the actual clone
|
163
165
|
clone_results = service.vm_clone(req_options)
|
@@ -6,17 +6,19 @@ module Fog
|
|
6
6
|
cluster = get_raw_cluster(attributes[:cluster], attributes[:datacenter])
|
7
7
|
|
8
8
|
root_resource_pool = if attributes[:root_resource_pool_name]
|
9
|
-
cluster.resourcePool.find attributes[:root_resource_pool_name]
|
9
|
+
cluster.resourcePool.find attributes[:root_resource_pool_name].gsub('/', '%2f')
|
10
10
|
else
|
11
11
|
cluster.resourcePool
|
12
12
|
end
|
13
13
|
|
14
|
-
root_resource_pool.
|
14
|
+
raise ArgumentError, 'Root resource pool could not be found' if root_resource_pool.nil?
|
15
|
+
|
16
|
+
resource_pool = root_resource_pool.CreateResourcePool(
|
15
17
|
name: attributes[:name],
|
16
18
|
spec: get_resource_pool_spec(attributes)
|
17
19
|
)
|
18
20
|
|
19
|
-
|
21
|
+
resource_pool_attributes(resource_pool, attributes[:cluster], attributes[:datacenter])
|
20
22
|
end
|
21
23
|
|
22
24
|
private
|
@@ -10,7 +10,7 @@ module Fog
|
|
10
10
|
config: get_resource_pool_spec(attributes)
|
11
11
|
)
|
12
12
|
|
13
|
-
|
13
|
+
resource_pool_attributes(raw_resource_pool, attributes[:cluster], attributes[:datacenter])
|
14
14
|
end
|
15
15
|
|
16
16
|
private
|
@@ -21,7 +21,10 @@ module Fog
|
|
21
21
|
end
|
22
22
|
raise ArgumentError, 'cluster option is required' unless options['resource_pool'][0]
|
23
23
|
raise Fog::Vsphere::Compute::NotFound, "Datacenter #{options['datacenter']} Doesn't Exist!" unless get_datacenter(options['datacenter'])
|
24
|
-
|
24
|
+
if options['template_datacenter'] && !get_datacenter(options['template_datacenter'])
|
25
|
+
raise Fog::Vsphere::Compute::NotFound, "Datacenter #{options['template_datacenter']} Doesn't Exist!"
|
26
|
+
end
|
27
|
+
raise Fog::Vsphere::Compute::NotFound, "Template #{options['template_path']} Doesn't Exist!" unless get_virtual_machine(options['template_path'], options['template_datacenter'] || options['datacenter'])
|
25
28
|
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
29
|
raise ArgumentError, 'path option is required' unless options.fetch('dest_folder', '/')
|
27
30
|
if options.key?('datastore') && !options['datastore'].nil? && !get_raw_datastore(options['datastore'], options['datacenter'])
|
@@ -50,6 +53,9 @@ module Fog
|
|
50
53
|
# want to clone FROM. Relative to Datacenter (Example:
|
51
54
|
# "FolderNameHere/VMNameHere")
|
52
55
|
# * 'name'<~String> - *REQUIRED* The VMName of the Destination
|
56
|
+
# * 'template_datacenter'<~String> - Datacenter name where template
|
57
|
+
# is. Make sure this datacenter exists, should if you're using
|
58
|
+
# the clone function in server.rb model.
|
53
59
|
# * 'dest_folder'<~String> - Destination Folder of where 'name' will
|
54
60
|
# be placed on your cluster. Relative Path to Datacenter E.G.
|
55
61
|
# "FolderPlaceHere/anotherSub Folder/onemore"
|
@@ -104,14 +110,11 @@ module Fog
|
|
104
110
|
# Option handling
|
105
111
|
options = vm_clone_check_options(options)
|
106
112
|
|
107
|
-
# Added for people still using options['path']
|
108
|
-
template_path = options['path'] || options['template_path']
|
109
|
-
|
110
113
|
# Options['template_path']<~String>
|
111
114
|
# Added for people still using options['path']
|
112
115
|
template_path = options['path'] || options['template_path']
|
113
116
|
# Now find the template itself using the efficient find method
|
114
|
-
vm_mob_ref = get_vm_ref(template_path, options['datacenter'])
|
117
|
+
vm_mob_ref = get_vm_ref(template_path, options['template_datacenter'] || options['datacenter'])
|
115
118
|
|
116
119
|
# Options['dest_folder']<~String>
|
117
120
|
# Grab the destination folder object if it exists else use cloned mach
|
data/lib/fog/vsphere/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-vsphere
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- J.R. Garcia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -338,7 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
338
338
|
- !ruby/object:Gem::Version
|
339
339
|
version: '0'
|
340
340
|
requirements: []
|
341
|
-
rubygems_version: 3.1.
|
341
|
+
rubygems_version: 3.1.4
|
342
342
|
signing_key:
|
343
343
|
specification_version: 4
|
344
344
|
summary: Module for the 'fog' gem to support VMware vSphere.
|