kitchen-vcenter 2.11.0 → 2.11.4
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/lib/kitchen-vcenter/version.rb +1 -1
- data/lib/support/clone_vm.rb +20 -15
- 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: 28119d22d4b763e0ddbe3bcacc0fdf119e7d477a78aaab050dd0433a6656935e
|
|
4
|
+
data.tar.gz: 0d4ebe88e1dd7c970729c426c4b5eb19d5319a8c048ef5db1c705835efbb4a1a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f5bf290eee4065039cd41a3b2fb74f6cdf3d6b3caf1b82b78353c84bf1e28fb69c04e029ec22327f8bc2ae0b3a60a01d60f14801c4dbf14f54b6d291b468774b
|
|
7
|
+
data.tar.gz: 54a3d86d39d3aa303097eab94f898d2ff015bf33af1ee2af18b2c75c8f7064f46e5b44fe13d040529321f30f44c08cb9bf64a0305c9bdace988fa6394b6ddc6d
|
data/lib/support/clone_vm.rb
CHANGED
|
@@ -184,6 +184,8 @@ class Support
|
|
|
184
184
|
|
|
185
185
|
def reconnect_network_device(vm)
|
|
186
186
|
network_device = network_device(vm)
|
|
187
|
+
return unless network_device
|
|
188
|
+
|
|
187
189
|
network_device.connectable = RbVmomi::VIM.VirtualDeviceConnectInfo(
|
|
188
190
|
allowGuestControl: true,
|
|
189
191
|
startConnected: true,
|
|
@@ -502,13 +504,15 @@ class Support
|
|
|
502
504
|
relocate_spec.pool = options[:resource_pool]
|
|
503
505
|
|
|
504
506
|
# Change network, if wanted
|
|
505
|
-
|
|
507
|
+
network_device = network_device(src_vm)
|
|
508
|
+
Kitchen.logger.warn format("Source VM/template does not have any network device (use VMware IPPools and vsphere-gom transport or govc to access)") unless network_device
|
|
509
|
+
|
|
510
|
+
unless network_device.nil? || options[:network_name].nil?
|
|
506
511
|
networks = dc.network.select { |n| n.name == options[:network_name] }
|
|
507
512
|
raise Support::CloneError.new(format("Could not find network named %s", options[:network_name])) if networks.empty?
|
|
508
513
|
|
|
509
514
|
Kitchen.logger.warn format("Found %d networks named %s, picking first one", networks.count, options[:network_name]) if networks.count > 1
|
|
510
515
|
network_obj = networks.first
|
|
511
|
-
network_device = network_device(src_vm)
|
|
512
516
|
|
|
513
517
|
if network_obj.is_a? RbVmomi::VIM::DistributedVirtualPortgroup
|
|
514
518
|
Kitchen.logger.info format("Assigning network %s...", network_obj.pretty_path)
|
|
@@ -572,19 +576,20 @@ class Support
|
|
|
572
576
|
# MAC at least with 6.7.0 build 9433931
|
|
573
577
|
|
|
574
578
|
# Disconnect network device, so wo don't get IP collisions on start
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
579
|
+
if network_device
|
|
580
|
+
network_device.connectable = RbVmomi::VIM.VirtualDeviceConnectInfo(
|
|
581
|
+
allowGuestControl: true,
|
|
582
|
+
startConnected: true,
|
|
583
|
+
connected: false,
|
|
584
|
+
migrateConnect: "disconnect"
|
|
585
|
+
)
|
|
586
|
+
relocate_spec.deviceChange = [
|
|
587
|
+
RbVmomi::VIM.VirtualDeviceConfigSpec(
|
|
588
|
+
operation: RbVmomi::VIM::VirtualDeviceConfigSpecOperation("edit"),
|
|
589
|
+
device: network_device
|
|
590
|
+
),
|
|
591
|
+
]
|
|
592
|
+
end
|
|
588
593
|
|
|
589
594
|
clone_spec = RbVmomi::VIM.VirtualMachineInstantCloneSpec(location: relocate_spec,
|
|
590
595
|
name: vm_name)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kitchen-vcenter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.11.
|
|
4
|
+
version: 2.11.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chef Software
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-11-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: net-ping
|
|
@@ -109,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
109
109
|
requirements:
|
|
110
110
|
- - ">="
|
|
111
111
|
- !ruby/object:Gem::Version
|
|
112
|
-
version: '2.
|
|
112
|
+
version: '2.6'
|
|
113
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
|
115
115
|
- - ">="
|