fog-vsphere 3.6.0 → 3.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/fog/vsphere/compute.rb +18 -0
- data/lib/fog/vsphere/models/compute/server.rb +2 -0
- data/lib/fog/vsphere/requests/compute/get_network.rb +3 -3
- data/lib/fog/vsphere/requests/compute/list_networks.rb +8 -6
- data/lib/fog/vsphere/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ffd073bf26a6cd8fac5eecedbae2cd0ce3b7f0edb11ca52f3f5fc2b45dd6653
|
4
|
+
data.tar.gz: e3e921ba25609b8e13a0523918dc25b6b5db6cb1dde66a6f66cad15d0809dc87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48ea23c5093f1e8640d74c856fe40b9d7319c71e8475de3405e28769ebe238284f572c4a1d4b587f6d48b767ff9f652441569935b36746b863f5b2622f26e4a4
|
7
|
+
data.tar.gz: e39985451598902c910e565c38f1e9e110feae3aa15014802e0c69628aa28318dc0e8831ea1002630a2697861d4d9889dd2e60c422b425e1782a29e67f898b7a
|
data/CHANGELOG.md
CHANGED
data/lib/fog/vsphere/compute.rb
CHANGED
@@ -160,6 +160,8 @@ module Fog
|
|
160
160
|
tools_version: 'guest.toolsVersionStatus',
|
161
161
|
memory_mb: 'config.hardware.memoryMB',
|
162
162
|
cpus: 'config.hardware.numCPU',
|
163
|
+
disks: 'config.hardware.device',
|
164
|
+
partitions: 'guest.disk',
|
163
165
|
corespersocket: 'config.hardware.numCoresPerSocket',
|
164
166
|
overall_status: 'overallStatus',
|
165
167
|
guest_id: 'config.guestId',
|
@@ -252,6 +254,8 @@ module Fog
|
|
252
254
|
end
|
253
255
|
}
|
254
256
|
|
257
|
+
attrs['disks'] = parse_disks(attrs['disks'])
|
258
|
+
attrs['partitions'] = parse_partitions(attrs['partitions'])
|
255
259
|
attrs['extra_config'] = parse_extra_config(attrs['extra_config'])
|
256
260
|
end
|
257
261
|
# This inline rescue catches any standard error. While a VM is
|
@@ -317,6 +321,20 @@ module Fog
|
|
317
321
|
vm_extra_config.map { |entry| [entry[:key], entry[:value]] }.to_h
|
318
322
|
end
|
319
323
|
|
324
|
+
def parse_disks(vm_disks)
|
325
|
+
return unless vm_disks.is_a?(Array)
|
326
|
+
vm_disks.grep(RbVmomi::VIM::VirtualDisk).map do |d|
|
327
|
+
{ :label => d.deviceInfo.label, :capacity => d.capacityInBytes }
|
328
|
+
end
|
329
|
+
end
|
330
|
+
|
331
|
+
def parse_partitions(vm_partitions)
|
332
|
+
return unless vm_partitions.is_a?(Array)
|
333
|
+
vm_partitions.grep(RbVmomi::VIM::GuestDiskInfo).map do |p|
|
334
|
+
{ :path => p.diskPath, :free => p.freeSpace, :capacity => p.capacity }
|
335
|
+
end
|
336
|
+
end
|
337
|
+
|
320
338
|
# returns vmware managed obj id string
|
321
339
|
def managed_obj_id(obj)
|
322
340
|
obj.to_s.match(/\("([^"]+)"\)/)[1]
|
@@ -38,7 +38,7 @@ module Fog
|
|
38
38
|
# only the one will do
|
39
39
|
proc do |n|
|
40
40
|
n._ref == ref_or_name || (
|
41
|
-
n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && (n.name == ref_or_name) &&
|
41
|
+
n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && (n.name == ref_or_name || n.key == ref_or_name) &&
|
42
42
|
(n.config.distributedVirtualSwitch.name == distributedswitch)
|
43
43
|
)
|
44
44
|
end
|
@@ -46,12 +46,12 @@ module Fog
|
|
46
46
|
# the first distributed virtual switch will do - selected by network - gives control to vsphere
|
47
47
|
proc do |n|
|
48
48
|
n._ref == ref_or_name || (
|
49
|
-
n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && (n.name == ref_or_name)
|
49
|
+
n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && (n.name == ref_or_name || n.key == ref_or_name)
|
50
50
|
)
|
51
51
|
end
|
52
52
|
else
|
53
53
|
# the first matching network will do, seems like the non-distributed networks come first
|
54
|
-
proc { |n| n._ref == ref_or_name || n.name == ref_or_name }
|
54
|
+
proc { |n| n._ref == ref_or_name || n.name == ref_or_name || (n.is_a?(RbVmomi::VIM::DistributedVirtualPortgroup) && n.key == ref_or_name) }
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
@@ -30,15 +30,17 @@ module Fog
|
|
30
30
|
virtualswitch: dvswitches[network['config.distributedVirtualSwitch']._ref]
|
31
31
|
)
|
32
32
|
elsif network.obj.is_a?(RbVmomi::VIM::OpaqueNetwork)
|
33
|
-
map_attrs_to_hash(network,
|
33
|
+
map_attrs_to_hash(network, network_dvportgroup_attribute_mapping).merge(
|
34
|
+
id: network.obj._ref,
|
34
35
|
opaqueNetworkId: network.obj.summary.opaqueNetworkId
|
35
36
|
)
|
36
37
|
else
|
37
|
-
map_attrs_to_hash(network, network_attribute_mapping)
|
38
|
+
map_attrs_to_hash(network, network_attribute_mapping).merge(
|
39
|
+
id: network.obj._ref
|
40
|
+
)
|
38
41
|
end.merge(
|
39
|
-
|
40
|
-
|
41
|
-
datacenter: datacenter_name
|
42
|
+
datacenter: datacenter_name,
|
43
|
+
_ref: network.obj._ref
|
42
44
|
)
|
43
45
|
end.compact
|
44
46
|
end
|
@@ -54,7 +56,7 @@ module Fog
|
|
54
56
|
|
55
57
|
def network_dvportgroup_attribute_mapping
|
56
58
|
network_attribute_mapping.merge(
|
57
|
-
|
59
|
+
id: 'config.key'
|
58
60
|
)
|
59
61
|
end
|
60
62
|
|
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.6.
|
4
|
+
version: 3.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- J.R. Garcia
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -359,7 +359,7 @@ homepage: https://github.com/fog/fog-vsphere
|
|
359
359
|
licenses:
|
360
360
|
- MIT
|
361
361
|
metadata: {}
|
362
|
-
post_install_message:
|
362
|
+
post_install_message:
|
363
363
|
rdoc_options: []
|
364
364
|
require_paths:
|
365
365
|
- lib
|
@@ -374,8 +374,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
374
374
|
- !ruby/object:Gem::Version
|
375
375
|
version: '0'
|
376
376
|
requirements: []
|
377
|
-
rubygems_version: 3.
|
378
|
-
signing_key:
|
377
|
+
rubygems_version: 3.1.6
|
378
|
+
signing_key:
|
379
379
|
specification_version: 4
|
380
380
|
summary: Module for the 'fog' gem to support VMware vSphere.
|
381
381
|
test_files: []
|