kitchen-vcenter 2.10.2 → 2.11.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen-vcenter/version.rb +1 -1
- data/lib/support/clone_vm.rb +26 -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: 50205f05bf2e5fca3977374cccbd79fa2c703dea89fee58336aeb4d4286a9c1b
|
4
|
+
data.tar.gz: 5ce2309de70acd22033ea4871903371c1948f4433d85650aebe15bc629a5897d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a5103e264c87f170405022b9b2fd0e9873365a7707ab023822276c6d312072ccd7ddb4d3de9ac3fef45f99c0c9c530a94e4627e367c8c5b7dfc2f92929ddcc0
|
7
|
+
data.tar.gz: fcf0c459ebd8805fafe813d5d34e9bc085936c2df84e3679a3564ae27e464757564ae23579c01e18358aa394c2fd013330132ee934d59bc41d668a31cfab109b
|
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,
|
@@ -393,6 +395,12 @@ class Support
|
|
393
395
|
end
|
394
396
|
end
|
395
397
|
|
398
|
+
guestinfo = options[:vm_customization].select { |key, _| key =~ /^guestinfo\..*/ }
|
399
|
+
unless guestinfo.empty?
|
400
|
+
gi = guestinfo.map { |k, v| { key: k, value: v } }
|
401
|
+
config[:extraConfig] = gi
|
402
|
+
end
|
403
|
+
|
396
404
|
config_spec = RbVmomi::VIM.VirtualMachineConfigSpec(config)
|
397
405
|
|
398
406
|
task = vm.ReconfigVM_Task(spec: config_spec)
|
@@ -496,13 +504,15 @@ class Support
|
|
496
504
|
relocate_spec.pool = options[:resource_pool]
|
497
505
|
|
498
506
|
# Change network, if wanted
|
499
|
-
|
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?
|
500
511
|
networks = dc.network.select { |n| n.name == options[:network_name] }
|
501
512
|
raise Support::CloneError.new(format("Could not find network named %s", options[:network_name])) if networks.empty?
|
502
513
|
|
503
514
|
Kitchen.logger.warn format("Found %d networks named %s, picking first one", networks.count, options[:network_name]) if networks.count > 1
|
504
515
|
network_obj = networks.first
|
505
|
-
network_device = network_device(src_vm)
|
506
516
|
|
507
517
|
if network_obj.is_a? RbVmomi::VIM::DistributedVirtualPortgroup
|
508
518
|
Kitchen.logger.info format("Assigning network %s...", network_obj.pretty_path)
|
@@ -566,19 +576,20 @@ class Support
|
|
566
576
|
# MAC at least with 6.7.0 build 9433931
|
567
577
|
|
568
578
|
# Disconnect network device, so wo don't get IP collisions on start
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
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
|
582
593
|
|
583
594
|
clone_spec = RbVmomi::VIM.VirtualMachineInstantCloneSpec(location: relocate_spec,
|
584
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.
|
4
|
+
version: 2.11.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-28 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
|
- - ">="
|