vagrant-vmware-esxi 2.2.2 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -7
- data/example_box/Vagrantfile +11 -4
- data/lib/vagrant-vmware-esxi/action/createvm.rb +94 -30
- data/lib/vagrant-vmware-esxi/config.rb +9 -0
- data/lib/vagrant-vmware-esxi/version.rb +1 -1
- data/locales/en.yml +1 -1
- data/vagrant-vmware-esxi.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caee10cdf29fc60a9893a73f38a6c8df05327aed
|
4
|
+
data.tar.gz: 9c6a5801595b8b879a125c4ff1efed3498d66966
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f454dd1e88570b3d53ed80105f851959ea562e5c747ebe11af49a8f05a3973f41b0aa33759794c990fc9f405a49a8cff619c3f6603a5ad2d1fe7ec842e347a0
|
7
|
+
data.tar.gz: 2342ce2974e24215521eae84de5946264c6af6a5717d041ca8dc65c31db9399fa99dd710d82ae97b6ffdfb7e35c38971e09853bf036cf9f3888330e11d69f981
|
data/README.md
CHANGED
@@ -81,13 +81,13 @@ Vagrant.configure('2') do |config|
|
|
81
81
|
# the box/vm doesn't have the vmware tools installed.
|
82
82
|
#
|
83
83
|
# Here are some of the MANY examples....
|
84
|
-
config.vm.box = '
|
84
|
+
config.vm.box = 'hashicorp/precise64'
|
85
|
+
#config.vm.box = 'generic/centos7'
|
85
86
|
#config.vm.box = 'generic/centos6'
|
86
87
|
#config.vm.box = 'generic/fedora27'
|
87
88
|
#config.vm.box = 'generic/freebsd11'
|
88
89
|
#config.vm.box = 'generic/ubuntu1710'
|
89
90
|
#config.vm.box = 'generic/debian9'
|
90
|
-
#config.vm.box = 'hashicorp/precise64'
|
91
91
|
#config.vm.box = 'steveant/CentOS-7.0-1406-Minimal-x64'
|
92
92
|
#config.vm.box = 'geerlingguy/centos7'
|
93
93
|
#config.vm.box = 'geerlingguy/ubuntu1604'
|
@@ -200,8 +200,9 @@ Vagrant.configure('2') do |config|
|
|
200
200
|
|
201
201
|
# OPTIONAL. Create additional storage for guests.
|
202
202
|
# You can specify an array of up to 13 virtual disk sizes (in GB) that you
|
203
|
-
# would like the provider to create once the guest has been created.
|
204
|
-
#
|
203
|
+
# would like the provider to create once the guest has been created. You
|
204
|
+
# can optionally specify the size and datastore using a hash.
|
205
|
+
#esxi.guest_storage = [ 10, 20, { size: 30, datastore: 'datastore1' } ]
|
205
206
|
|
206
207
|
# OPTIONAL. specify snapshot options.
|
207
208
|
#esxi.guest_snapshot_includememory = 'true'
|
@@ -229,6 +230,10 @@ Vagrant.configure('2') do |config|
|
|
229
230
|
# vm's and packages.
|
230
231
|
#esxi.local_allow_overwrite = 'True'
|
231
232
|
|
233
|
+
# Advanced Users.
|
234
|
+
# If set to 'True', all WARNINGS will produce a FAILURE and vagrant will stop.
|
235
|
+
#esxi.local_failonwarning = 'True'
|
236
|
+
|
232
237
|
# Plugin debug output.
|
233
238
|
# Please send any bug reports with debug this output...
|
234
239
|
#esxi.debug = 'true'
|
@@ -267,16 +272,21 @@ Known issues with vmware_esxi
|
|
267
272
|
-----------------------------
|
268
273
|
* The boxes must have open-vm-tools or vmware-tools installed to properly transition to the 'running' state.
|
269
274
|
* Invalid settings (bad IP address, netmask, MAC address, guest_custom_vmx_settings) could cause 'vagrant up' to fail. Review vSphere console and/or ESXi logs to help debug why it failed.
|
270
|
-
* Cleanup doesn't always destroy a VM that has been partially built. Use the local_allow_overwrite = 'True' option if you
|
275
|
+
* Cleanup doesn't always destroy a VM that has been partially built. To resolve this. Use the local_allow_overwrite = 'True' option if you want to force a rebuild, or you can delete the vm using the VSphere client.
|
271
276
|
* ovftool installer for windows doesn't put ovftool.exe in your path. You can manually set your path, or install ovftool in the \HashiCorp\Vagrant\bin directory.
|
272
277
|
* Vagrant NFS synced folders is not reliable on multi-homed clients (your vagrant pc/laptop/host). There is no 100% reliable way to know which IP is the correct, most reliable, most desirable, etc...
|
273
|
-
* V2.0.1 - 2.0.5 is not compatible with Windows (to support ed25519 ssh keys, net-ssh requires libsodium but it's not compatible with Windows). ed25519 support has been removed for now. It will be added back when net-ssh 5.x goes out of beta.
|
278
|
+
* Plugin V2.0.1 - 2.0.5 is not compatible with Windows (to support ed25519 ssh keys, net-ssh requires libsodium but it's not compatible with Windows). ed25519 support has been removed for now. It will be added back when net-ssh 5.x goes out of beta.
|
279
|
+
* Vagrant 2.1.0 is not compatible with this plugin. Avoid Vagrant 2.1.0.
|
274
280
|
* Cygwin & gitbash have console issues. Ruby module io/console does not have support. https://github.com/ruby/io-console/issues/2
|
275
|
-
* Setting the hostname
|
281
|
+
* Setting the hostname on some boxes can cause 'vagrant up' to fail (generic/centos7 for example). Avoid buggy boxes like generic/centos7, fix the box networking and repackage, or do not set the hostname via Vagrant.
|
276
282
|
|
277
283
|
|
278
284
|
Version History
|
279
285
|
---------------
|
286
|
+
* 2.3.0 Add support to specify DiskStore for guest_storage virtual disks.
|
287
|
+
Add local_failonwarning Vagrantfil option.
|
288
|
+
Fix, make plugin more compatible with Ovftool 4.3.0
|
289
|
+
|
280
290
|
* 2.2.2 Fix, Avoid crash if esxi_password is nil.
|
281
291
|
|
282
292
|
* 2.2.1 Fix, clone_from_vm not working on MAC.
|
data/example_box/Vagrantfile
CHANGED
@@ -12,13 +12,13 @@ Vagrant.configure('2') do |config|
|
|
12
12
|
# the system doesn't have the vmware tools installed.
|
13
13
|
#
|
14
14
|
# Here are some of the MANY examples....
|
15
|
-
config.vm.box = '
|
15
|
+
config.vm.box = 'hashicorp/precise64'
|
16
|
+
#config.vm.box = 'generic/centos7'
|
16
17
|
#config.vm.box = 'generic/centos6'
|
17
18
|
#config.vm.box = 'generic/fedora26'
|
18
19
|
#config.vm.box = 'generic/freebsd11'
|
19
20
|
#config.vm.box = 'generic/ubuntu1710'
|
20
21
|
#config.vm.box = 'generic/debian9'
|
21
|
-
#config.vm.box = 'hashicorp/precise64'
|
22
22
|
#config.vm.box = 'steveant/CentOS-7.0-1406-Minimal-x64'
|
23
23
|
#config.vm.box = 'geerlingguy/centos7'
|
24
24
|
#config.vm.box = 'geerlingguy/ubuntu1604'
|
@@ -172,11 +172,12 @@ Vagrant.configure('2') do |config|
|
|
172
172
|
|
173
173
|
# OPTIONAL. Create additional storage for guests.
|
174
174
|
# You can specify an array of upto 14 virtual disk sizes (in GB) that you
|
175
|
-
# would like the provider to create once the guest has been created.
|
175
|
+
# would like the provider to create once the guest has been created. You
|
176
|
+
# can optionally specify the size and datastore using a hash. The
|
176
177
|
# virtual disks will be created and added to the guest, however you must
|
177
178
|
# provision it. The disks can be used for lvm, partitioned, raw disk
|
178
179
|
# for data bases, etc...
|
179
|
-
#esxi.guest_storage = [10,20]
|
180
|
+
#esxi.guest_storage = [ 10, 20, { size: 30, datastore: 'datastore1' } ]
|
180
181
|
|
181
182
|
# OPTIONAL & RISKY. Specify up to 4 MAC addresses
|
182
183
|
# The default is ovftool to automatically generate a MAC address.
|
@@ -250,6 +251,12 @@ Vagrant.configure('2') do |config|
|
|
250
251
|
# This will also overwrite your box when using vagrant package.
|
251
252
|
#esxi.local_allow_overwrite = 'True'
|
252
253
|
|
254
|
+
# Advanced users.
|
255
|
+
# If unspecified or set to 'False', all WARNINGS will produce a WARNING and vagrant
|
256
|
+
# will continue. If set to 'True', all WARNINGS will produce a FAILURE and
|
257
|
+
# vagrant will stop.
|
258
|
+
#esxi.local_failonwarning = 'True'
|
259
|
+
|
253
260
|
# Plugin debug output.
|
254
261
|
# Send bug reports with debug output...
|
255
262
|
#esxi.debug = 'true'
|
@@ -4,8 +4,10 @@ require 'net/ssh'
|
|
4
4
|
module VagrantPlugins
|
5
5
|
module ESXi
|
6
6
|
module Action
|
7
|
-
# This action creates a new vmx file
|
8
|
-
#
|
7
|
+
# This action creates a new vmx file using a box or VM as it's source.
|
8
|
+
# Modifies the vmx file with customizations.
|
9
|
+
# Creates a new VM guest using ovftool.
|
10
|
+
# Does final tweeks to the VM, grow boot disk, create additional storage, etc...
|
9
11
|
class CreateVM
|
10
12
|
def initialize(app, _env)
|
11
13
|
@app = app
|
@@ -67,7 +69,12 @@ module VagrantPlugins
|
|
67
69
|
if config.clone_from_vm.nil?
|
68
70
|
vmx_file = Dir.glob("#{src_dir}/*.vmx").first
|
69
71
|
@logger.info("vagrant-vmware-esxi, createvm: vmx_file: #{vmx_file}")
|
70
|
-
|
72
|
+
begin
|
73
|
+
source_vmx_contents = File.read(vmx_file)
|
74
|
+
rescue
|
75
|
+
raise Errors::GeneralError,
|
76
|
+
message: "Unable to open #{src_dir}/*.vmx"
|
77
|
+
end
|
71
78
|
else
|
72
79
|
begin
|
73
80
|
tmpdir = Dir.mktmpdir
|
@@ -76,12 +83,18 @@ module VagrantPlugins
|
|
76
83
|
message: "Unable to create tmp dir #{tmpdir}"
|
77
84
|
end
|
78
85
|
|
79
|
-
|
86
|
+
if config.debug =~ %r{ovftool}i
|
87
|
+
ovf_debug = '--X:logLevel=info --X:logToConsole'
|
88
|
+
else
|
89
|
+
ovf_debug = "--X:logLevel=info --X:logFile=#{tmpdir}/ovftool.log"
|
90
|
+
end
|
91
|
+
|
80
92
|
#
|
81
93
|
# Source from Clone
|
82
94
|
clone_from_vm_path = "vi://#{config.esxi_username}:#{config.encoded_esxi_password}@#{config.esxi_hostname}/#{config.clone_from_vm}"
|
83
95
|
ovf_cmd = "ovftool --noSSLVerify --overwrite --X:useMacNaming=false "\
|
84
96
|
"--powerOffTarget --noDisks --targetType=vmx #{ovf_debug} "\
|
97
|
+
"--acceptAllEulas "\
|
85
98
|
"#{clone_from_vm_path} #{tmpdir}"
|
86
99
|
if config.debug =~ %r{password}i
|
87
100
|
@logger.info("vagrant-vmware-esxi, createvm: ovf_cmd #{ovf_cmd}")
|
@@ -145,6 +158,7 @@ module VagrantPlugins
|
|
145
158
|
message: 'WARNING : '\
|
146
159
|
"esxi_disk_store not set, using "\
|
147
160
|
"\"--- Least Used ---\"")
|
161
|
+
@iswarning = 'true'
|
148
162
|
else
|
149
163
|
desired_ds = config.esxi_disk_store.to_s
|
150
164
|
end
|
@@ -161,11 +175,49 @@ module VagrantPlugins
|
|
161
175
|
message: 'WARNING : '\
|
162
176
|
"Disk Store \"#{config.esxi_disk_store}\" not "\
|
163
177
|
"found, using #{@guestvm_dsname}")
|
178
|
+
@iswarning = 'true'
|
164
179
|
end
|
165
180
|
|
166
181
|
@logger.info('vagrant-vmware-esxi, createvm: '\
|
167
182
|
"@guestvm_dsname: #{@guestvm_dsname}")
|
168
183
|
|
184
|
+
#
|
185
|
+
# Validate guest Storage
|
186
|
+
if config.guest_storage.is_a? Array
|
187
|
+
new_guest_storage = []
|
188
|
+
0.upto(config.guest_storage.count - 1) do |index|
|
189
|
+
store = config.guest_storage[index]
|
190
|
+
if store.is_a? Hash
|
191
|
+
store_size = store[:size].to_i
|
192
|
+
guest_disk_datastore = store[:datastore].nil? ? @guestvm_dsname : store[:datastore]
|
193
|
+
r = ssh.exec!("test -d /vmfs/volumes/#{guest_disk_datastore}")
|
194
|
+
if (r.exitstatus != 0) || (guest_disk_datastore.length < 1)
|
195
|
+
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
196
|
+
message: 'WARNING : '\
|
197
|
+
"Disk DataStore[#{index}]: #{guest_disk_datastore} not "\
|
198
|
+
"found, using \"#{@guestvm_dsname}\"")
|
199
|
+
@iswarning = 'true'
|
200
|
+
guest_disk_datastore = @guestvm_dsname
|
201
|
+
end
|
202
|
+
else
|
203
|
+
store_size = store.to_i
|
204
|
+
guest_disk_datastore = @guestvm_dsname
|
205
|
+
end
|
206
|
+
|
207
|
+
if store_size < 1
|
208
|
+
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
209
|
+
message: 'WARNING : Ignored invalid '\
|
210
|
+
"storage size #{config.guest_storage[index]} at "\
|
211
|
+
"index[#{index}]")
|
212
|
+
@iswarning = 'true'
|
213
|
+
new_guest_storage[index] = { size: "invalid", datastore: guest_disk_datastore }
|
214
|
+
else
|
215
|
+
new_guest_storage[index] = { size: store_size, datastore: guest_disk_datastore }
|
216
|
+
end
|
217
|
+
end
|
218
|
+
config.guest_storage = new_guest_storage
|
219
|
+
end
|
220
|
+
|
169
221
|
#
|
170
222
|
# Figure out network
|
171
223
|
#
|
@@ -215,6 +267,7 @@ module VagrantPlugins
|
|
215
267
|
message: 'WARNING : '\
|
216
268
|
"esxi_virtual_network[#{networkID}] not "\
|
217
269
|
"set, using #{availnetworks.first}")
|
270
|
+
@iswarning = 'true'
|
218
271
|
elsif availnetworks.include? aVirtNet
|
219
272
|
# Network interface is good
|
220
273
|
@guestvm_network << aVirtNet
|
@@ -231,6 +284,7 @@ module VagrantPlugins
|
|
231
284
|
message: 'WARNING : '\
|
232
285
|
"#{aVirtNet_msg} not "\
|
233
286
|
"found, using #{availnetworks.first}")
|
287
|
+
@iswarning = 'true'
|
234
288
|
end
|
235
289
|
networkID += 1
|
236
290
|
break if networkID >= 4
|
@@ -256,6 +310,7 @@ module VagrantPlugins
|
|
256
310
|
message: 'WARNING : '\
|
257
311
|
"GuestOS: #{config.guest_guestos} not "\
|
258
312
|
"supported, using box/ovftool defaults")
|
313
|
+
@iswarning = 'true'
|
259
314
|
end
|
260
315
|
end
|
261
316
|
|
@@ -267,6 +322,7 @@ module VagrantPlugins
|
|
267
322
|
message: 'WARNING : '\
|
268
323
|
"Invalid guest_virtualhw_version: #{config.guest_virtualhw_version},"\
|
269
324
|
"using ovftool defaults")
|
325
|
+
@iswarning = 'true'
|
270
326
|
config.guest_virtualhw_version = nil
|
271
327
|
end
|
272
328
|
end
|
@@ -279,6 +335,7 @@ module VagrantPlugins
|
|
279
335
|
message: 'WARNING : '\
|
280
336
|
"NIC type: #{config.guest_nic_type} not "\
|
281
337
|
"found, using ovftool defaults.")
|
338
|
+
@iswarning = 'true'
|
282
339
|
config.guest_nic_type = nil
|
283
340
|
end
|
284
341
|
end
|
@@ -383,6 +440,7 @@ module VagrantPlugins
|
|
383
440
|
new_guest_mac_address[index] = "invalid"
|
384
441
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
385
442
|
message: "WARNING : Ignored invalid mac address at index[#{index}]")
|
443
|
+
@iswarning = 'true'
|
386
444
|
end
|
387
445
|
end
|
388
446
|
end
|
@@ -400,28 +458,11 @@ module VagrantPlugins
|
|
400
458
|
message: 'WARNING : '\
|
401
459
|
"Disk type: #{config.guest_disk_type} not "\
|
402
460
|
"found, using \"thin\"")
|
461
|
+
@iswarning = 'true'
|
403
462
|
guest_disk_type = "thin"
|
404
463
|
end
|
405
464
|
end
|
406
465
|
|
407
|
-
# Validate guest Storage
|
408
|
-
if config.guest_storage.is_a? Array
|
409
|
-
new_guest_storage = []
|
410
|
-
0.upto(config.guest_storage.count - 1) do |index|
|
411
|
-
store_size = config.guest_storage[index].to_i
|
412
|
-
if store_size < 1
|
413
|
-
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
414
|
-
message: 'WARNING : Ignored invalid '\
|
415
|
-
"storage size #{config.guest_storage[index]} at "\
|
416
|
-
"index[#{index}]")
|
417
|
-
new_guest_storage[index] = "invalid"
|
418
|
-
else
|
419
|
-
new_guest_storage[index] = store_size
|
420
|
-
end
|
421
|
-
end
|
422
|
-
config.guest_storage = new_guest_storage
|
423
|
-
end
|
424
|
-
|
425
466
|
# Validate local_lax setting (use relaxed (--lax) ovftool option)
|
426
467
|
unless config.local_lax.nil?
|
427
468
|
if config.local_lax == 'True'
|
@@ -444,7 +485,7 @@ module VagrantPlugins
|
|
444
485
|
message: "Disk Store : #{@guestvm_dsname}")
|
445
486
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
446
487
|
message: "Resource Pool : #{esxi_resource_pool}")
|
447
|
-
|
488
|
+
|
448
489
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
449
490
|
message: " --- Guest Summary ---")
|
450
491
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
@@ -496,15 +537,24 @@ module VagrantPlugins
|
|
496
537
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
497
538
|
message: 'Allow Overwrite : True')
|
498
539
|
end
|
540
|
+
unless config.local_failonwarning == 'False'
|
541
|
+
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
542
|
+
message: 'Fail on WARNING : True')
|
543
|
+
end
|
499
544
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
500
545
|
message: " --- Guest Build ---")
|
501
546
|
|
547
|
+
if (not @iswarning.nil?) and (config.local_failonwarning == 'True')
|
548
|
+
raise Errors::ESXiConfigError,
|
549
|
+
message: "Exit due to WARNING. See above for details."
|
550
|
+
end
|
502
551
|
if config.clone_from_vm.nil?
|
503
552
|
src_path = new_vmx_file
|
504
553
|
else
|
505
554
|
src_path = clone_from_vm_path
|
506
555
|
end
|
507
556
|
ovf_cmd = "ovftool --noSSLVerify #{overwrite_opts} #{ovf_debug} "\
|
557
|
+
"--acceptAllEulas "\
|
508
558
|
"-dm=#{guest_disk_type} #{local_laxoption} "\
|
509
559
|
"-ds=\"#{@guestvm_dsname}\" --name=\"#{desired_guest_name}\" "\
|
510
560
|
"\"#{src_path}\" vi://#{config.esxi_username}:"\
|
@@ -572,12 +622,12 @@ module VagrantPlugins
|
|
572
622
|
'grep vmPathName|grep -oE "\[.*\]"')
|
573
623
|
|
574
624
|
dst_vmx_dir = ssh.exec!("vim-cmd vmsvc/get.config #{env[:machine].id} |\
|
575
|
-
grep vmPathName|awk '{print $NF}'|awk -F'\/' '{print $1}'")
|
625
|
+
grep vmPathName|awk '{print $NF}'|awk -F'\/' '{print $1}'").strip
|
576
626
|
|
577
627
|
|
578
628
|
dst_vmx_file = "/vmfs/volumes/"
|
579
629
|
dst_vmx_file << dst_vmx_ds.gsub('[','').gsub(']','').strip + "/"
|
580
|
-
esxi_guest_dir = dst_vmx_file + dst_vmx_dir
|
630
|
+
esxi_guest_dir = dst_vmx_file + dst_vmx_dir
|
581
631
|
dst_vmx_file << dst_vmx
|
582
632
|
|
583
633
|
# Extend boot disk if required
|
@@ -595,8 +645,13 @@ module VagrantPlugins
|
|
595
645
|
puts "cmd: #{cmd}" if config.debug =~ %r{true}i
|
596
646
|
r = ssh.exec!(cmd)
|
597
647
|
if r.exitstatus != 0
|
598
|
-
|
599
|
-
|
648
|
+
if config.local_failonwarning == 'True'
|
649
|
+
raise Errors::ESXiError,
|
650
|
+
message: "WARNING : Unable to extend Boot Disk to #{config.guest_boot_disk_size}GB"
|
651
|
+
else
|
652
|
+
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
653
|
+
message: "WARNING : Unable to extend Boot Disk to #{config.guest_boot_disk_size}GB")
|
654
|
+
end
|
600
655
|
else
|
601
656
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
602
657
|
message: "Extend Boot dsk : #{config.guest_boot_disk_size}GB")
|
@@ -607,7 +662,11 @@ module VagrantPlugins
|
|
607
662
|
if config.guest_storage.is_a? Array
|
608
663
|
index = -1
|
609
664
|
config.guest_storage.each do |store|
|
610
|
-
|
665
|
+
puts "store[:size] : #{store[:size].to_s}"
|
666
|
+
store_size = store[:size].to_i
|
667
|
+
puts "store_size: #{store_size}"
|
668
|
+
guest_disk_datastore = store[:datastore].nil? ? @guestvm_dsname : store[:datastore]
|
669
|
+
|
611
670
|
index += 1
|
612
671
|
if store_size == 0
|
613
672
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
@@ -634,7 +693,12 @@ module VagrantPlugins
|
|
634
693
|
if r !~ %r{^#{slot.to_s}$}i
|
635
694
|
puts "Avail slot: #{slot}" if config.debug =~ %r{true}i
|
636
695
|
guest_disk_type = 'zeroedthick' if guest_disk_type == 'thick'
|
637
|
-
|
696
|
+
guest_volume_path = "/vmfs/volumes/#{guest_disk_datastore}"
|
697
|
+
guest_disk_folder = "#{guest_volume_path}/#{dst_vmx_dir}"
|
698
|
+
folder_cmd = "/bin/mkdir -p #{guest_disk_folder}"
|
699
|
+
cmd = "#{folder_cmd} && /bin/vmkfstools -c #{store_size}G "\
|
700
|
+
"-d #{guest_disk_type} \"#{guest_disk_folder}/disk_#{index}.vmdk\""
|
701
|
+
|
638
702
|
puts "cmd: #{cmd}" if config.debug =~ %r{true}i
|
639
703
|
r = ssh.exec!(cmd)
|
640
704
|
if r.exitstatus != 0
|
@@ -644,7 +708,7 @@ module VagrantPlugins
|
|
644
708
|
' Review ESXi logs for additional information!'
|
645
709
|
end
|
646
710
|
r = ssh.exec!("vim-cmd vmsvc/device.diskaddexisting #{env[:machine].id} "\
|
647
|
-
"#{
|
711
|
+
"#{guest_disk_folder}/disk_#{index}.vmdk 0 #{slot}")
|
648
712
|
if r.exitstatus != 0
|
649
713
|
raise Errors::ESXiError,
|
650
714
|
message: "Unable to create guest storage (vmkfstools failed):\n"\
|
@@ -32,6 +32,7 @@ module VagrantPlugins
|
|
32
32
|
attr_accessor :local_allow_overwrite
|
33
33
|
attr_accessor :local_lax
|
34
34
|
attr_accessor :local_use_ip_cache
|
35
|
+
attr_accessor :local_failonwarning
|
35
36
|
attr_accessor :debug
|
36
37
|
attr_accessor :supported_guest_virtualhw_versions
|
37
38
|
attr_accessor :supported_guest_disk_types
|
@@ -88,6 +89,7 @@ module VagrantPlugins
|
|
88
89
|
@local_allow_overwrite = 'False'
|
89
90
|
@local_lax = 'False'
|
90
91
|
@local_use_ip_cache = 'True'
|
92
|
+
@local_failonwarning = 'False'
|
91
93
|
@debug = 'False'
|
92
94
|
@saved_ipaddress = nil
|
93
95
|
@supported_guest_virtualhw_versions = [
|
@@ -362,6 +364,7 @@ module VagrantPlugins
|
|
362
364
|
@guest_boot_disk_size = nil if @guest_boot_disk_size == 0
|
363
365
|
@guest_storage = [@guest_storage.to_i] if @guest_storage.is_a? String
|
364
366
|
@guest_storage = [@guest_storage] if @guest_storage.is_a? Integer
|
367
|
+
@guest_storage = [{ size: @guest_storage[:size], datastore: @guest_storage[:datastore] }] if @guest_storage.is_a? Hash
|
365
368
|
|
366
369
|
@esxi_virtual_network = [@esxi_virtual_network] if @esxi_virtual_network.is_a? String
|
367
370
|
|
@@ -388,6 +391,12 @@ module VagrantPlugins
|
|
388
391
|
@local_use_ip_cache = 'True'
|
389
392
|
end
|
390
393
|
|
394
|
+
if @local_failonwarning =~ /true/i
|
395
|
+
@local_failonwarning = 'True'
|
396
|
+
else
|
397
|
+
@local_failonwarning = 'False'
|
398
|
+
end
|
399
|
+
|
391
400
|
if @guest_snapshot_includememory =~ /true/i
|
392
401
|
@guest_snapshot_includememory = 'includeMemory'
|
393
402
|
else
|
data/locales/en.yml
CHANGED
data/vagrant-vmware-esxi.gemspec
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path('../lib/vagrant-vmware-esxi/version', __FILE__)
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'vagrant-vmware-esxi'
|
5
5
|
s.version = VagrantPlugins::ESXi::VERSION
|
6
|
-
s.date = '2018-05-
|
6
|
+
s.date = '2018-05-16'
|
7
7
|
s.summary = 'Vagrant ESXi provider plugin'
|
8
8
|
s.description = 'A Vagrant plugin that adds a VMware ESXi provider support'
|
9
9
|
s.authors = ['Jonathan Senkerik']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-vmware-esxi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Senkerik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|