vagrant-vmware-esxi 2.4.3 → 2.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/ESXi_guestos_types.md +2 -1
- data/Gemfile +18 -3
- data/Gemfile.path +3 -0
- data/README.md +44 -40
- data/example_box/Vagrantfile +8 -1
- data/example_box/Vagrantfile-multimachine +24 -25
- data/lib/vagrant-vmware-esxi/action.rb +13 -5
- data/lib/vagrant-vmware-esxi/action/createvm.rb +21 -0
- data/lib/vagrant-vmware-esxi/action/esxi_password.rb +4 -2
- data/lib/vagrant-vmware-esxi/action/package.rb +1 -1
- data/lib/vagrant-vmware-esxi/action/read_ssh_info.rb +2 -2
- data/lib/vagrant-vmware-esxi/action/read_state.rb +14 -9
- data/lib/vagrant-vmware-esxi/action/resume.rb +1 -1
- data/lib/vagrant-vmware-esxi/config.rb +10 -0
- data/lib/vagrant-vmware-esxi/version.rb +1 -1
- data/vagrant-vmware-esxi.gemspec +5 -1
- metadata +35 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 76151ba498e2ccdeed28546c14080ad07d5dddcc1a38c7d1440395a5e048e26c
|
4
|
+
data.tar.gz: 71784b81f37391e04d87820100ad2812575a69ed58ee0416e941908ef6309768
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da117ede08301a0952056b5cc7792a8f9f3c2cf6f690bb83349ab24705a8a0840ebeb24d59de4218abcfb00c9ad98cb984bbdae34f6401d96d905ff31da02c03
|
7
|
+
data.tar.gz: 8a79b1027feedf617a694168a114c3cae6798aab0c95da92515bc7686395fc0794ed3ab332d09c255c805cd7794260f526195844fe0801efe6c1ee465308aa9d
|
data/ESXi_guestos_types.md
CHANGED
@@ -3,7 +3,8 @@ VMware ESXi 6.5 guestOS types
|
|
3
3
|
|
4
4
|
Based on my research and some trial & error, I made this list of guestOS types that are compatible with ESXi 6.5. I started with some api documenation from vmware that listed guestOS types.
|
5
5
|
|
6
|
-
>http://pubs.vmware.com/vsphere-
|
6
|
+
>http://pubs.vmware.com/vsphere-65/topic/com.vmware.wssdk.apiref.doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html
|
7
|
+
>https://code.vmware.com/apis/358/vsphere#/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html
|
7
8
|
|
8
9
|
But they didn't quite work when put directly in the vmx file... I noticed none of my existing vmx files had the word "Guest" in guestOS line. I also noticed in the list that the 64 bit entries were inconsistent. (Some have _64, others are -64, and others are just 64.) I removed the word Guest and set all the 64 bit OS's to be standard "-64". The results seems to work for various OS's I installed, but I certainly didn't try all of these. So here is my list... Please report any errors.
|
9
10
|
|
data/Gemfile
CHANGED
@@ -1,9 +1,24 @@
|
|
1
|
-
source 'https://rubygems.org'
|
1
|
+
#source 'https://rubygems.org'
|
2
|
+
#
|
3
|
+
#group :development do
|
4
|
+
# #gem 'vagrant', git: 'https://github.com/hashicorp/vagrant.git', :branch => 'v2.2.3'
|
5
|
+
# gem 'vagrant', git: 'https://github.com/hashicorp/vagrant.git'
|
6
|
+
#end
|
7
|
+
#
|
8
|
+
#group :plugins do
|
9
|
+
# #gemspec
|
10
|
+
# gem "vagrant-vmware-esxi", path: "."
|
11
|
+
#end
|
12
|
+
|
13
|
+
source "https://rubygems.org"
|
2
14
|
|
3
15
|
group :development do
|
4
|
-
|
16
|
+
# Need to tag to 2.2.4, there is still a bug.
|
17
|
+
# https://github.com/hashicorp/vagrant/pull/10945
|
18
|
+
gem "vagrant", git: "https://github.com/hashicorp/vagrant.git", :tag => 'v2.2.4'
|
5
19
|
end
|
6
20
|
|
7
21
|
group :plugins do
|
8
|
-
|
22
|
+
gem "vagrant-vmware-esxi", path: "."
|
9
23
|
end
|
24
|
+
|
data/Gemfile.path
ADDED
data/README.md
CHANGED
@@ -3,26 +3,25 @@ vagrant-vmware-esxi plugin
|
|
3
3
|
This is a Vagrant plugin that adds a VMware ESXi provider support. This allows Vagrant to control and provision VMs directly on an ESXi hypervisor without a need for vCenter or VShpere. ESXi hypervisor is a free download from VMware!
|
4
4
|
>https://www.vmware.com/go/get-free-esxi
|
5
5
|
|
6
|
+
|
6
7
|
Documentation:
|
7
8
|
-------------
|
8
9
|
Refer to the WIKI for documentation, examples and other information...
|
9
10
|
>https://github.com/josenk/vagrant-vmware-esxi/wiki
|
10
11
|
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
If you are using vagrant as
|
13
|
+
Vagrant vs Terraform.
|
14
|
+
---------------------
|
15
|
+
If you are using vagrant as a deployment tool (infra as code), you may want to consider a better tool: Terraform. Vagrant is better for development environments, while Terraform is better at managing infrastructure. Please give my Terraform plugin a try and give me some feedback. What you're trying to do, what's missing, what works, what doesn't work, etc...
|
16
|
+
>https://www.vagrantup.com/intro/vs/terraform.html
|
17
|
+
|
15
18
|
>https://github.com/josenk/terraform-provider-esxi
|
19
|
+
>https://github.com/josenk/vagrant-vmware-esxi
|
16
20
|
|
17
21
|
|
18
|
-
What's new!
|
19
|
-
-----------
|
20
|
-
Added support to clone from a VM! Refer to the WIKI for documentation, example and other information.
|
21
|
-
>https://github.com/josenk/vagrant-vmware-esxi/wiki/How-to-clone_from_vm
|
22
|
-
|
23
22
|
Features and Compatibility
|
24
23
|
--------------------------
|
25
|
-
* Clone from VMs. Clone a VM on the
|
24
|
+
* Clone from VMs. (see wiki) Clone a VM on the ESXi host instead of transferring a box stored on your local pc.
|
26
25
|
* Any of the vmware Box formats should be compatible.
|
27
26
|
* vmware_desktop, vmware_fusion, vmware_workstation...
|
28
27
|
* To be fully functional, you must have open-vm-tools or vmware tools installed.
|
@@ -35,7 +34,7 @@ Features and Compatibility
|
|
35
34
|
* suspend, resume, snapshots.
|
36
35
|
* rsync & NFS using built-in Vagrant synced folders.
|
37
36
|
* Provision using built-in Vagrant provisioner.
|
38
|
-
* package your
|
37
|
+
* package your VMs into boxes.
|
39
38
|
* Create additional network interfaces, set nic type, MAC addresses, static IPs.
|
40
39
|
* Use Vagrants private_network, public_network options to set a static IP addresses on additional network interfaces. (not the primary interface)
|
41
40
|
* Disks can be provisioned using thin, thick or eagerzeroedthick.
|
@@ -43,15 +42,17 @@ Features and Compatibility
|
|
43
42
|
* Specify GuestOS types, virtual HW version.
|
44
43
|
* Any custom vmx settings can be added or modified.
|
45
44
|
|
45
|
+
|
46
46
|
Requirements
|
47
47
|
------------
|
48
48
|
1. This is a vagrant plugin, so you need vagrant installed... :-)
|
49
49
|
2. This plugin requires ovftool from VMware. Download from VMware website. NOTE: 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.
|
50
50
|
>https://www.vmware.com/support/developer/ovf/
|
51
51
|
3. You MUST enable ssh access on your ESXi hypervisor.
|
52
|
-
* Google 'How to enable ssh access on
|
52
|
+
* Google 'How to enable ssh access on ESXi'
|
53
53
|
4. The boxes must have open-vm-tools or vmware-tools installed to properly transition to the 'running' state.
|
54
54
|
5. In general, you should know how to use vagrant, esxi and some networking...
|
55
|
+
6. You will most likely need a DHCP server on your primary network if you are deploying public boxes.
|
55
56
|
|
56
57
|
Why this plugin?
|
57
58
|
----------------
|
@@ -168,10 +169,9 @@ Vagrant.configure('2') do |config|
|
|
168
169
|
# The Default will be automatically generated.
|
169
170
|
#esxi.guest_name = 'Custom-Guest-VM_Name'
|
170
171
|
|
171
|
-
# OPTIONAL. When automatically naming VMs, use this
|
172
|
+
# OPTIONAL. When automatically naming VMs, use this prefix.
|
172
173
|
#esxi.guest_name_prefix = 'V-'
|
173
174
|
|
174
|
-
|
175
175
|
# OPTIONAL. Set the guest username login. The default is 'vagrant'.
|
176
176
|
#esxi.guest_username = 'vagrant'
|
177
177
|
|
@@ -215,13 +215,17 @@ Vagrant.configure('2') do |config|
|
|
215
215
|
#esxi.guest_snapshot_quiesced = 'true'
|
216
216
|
|
217
217
|
# RISKY. guest_guestos
|
218
|
-
# https://github.com/josenk/vagrant-vmware-esxi/
|
218
|
+
# https://github.com/josenk/vagrant-vmware-esxi/wiki/VMware-ESXi-6.5-guestOS-types
|
219
219
|
#esxi.guest_guestos = 'centos-64'
|
220
220
|
|
221
221
|
# OPTIONAL. guest_virtualhw_version
|
222
222
|
# ESXi 6.5 supports these versions. 4,7,8,9,10,11,12,13 & 14.
|
223
223
|
#esxi.guest_virtualhw_version = '9'
|
224
224
|
|
225
|
+
# OPTIONAL. Guest Autostart
|
226
|
+
# Guest VM will autostart when esxi host is booted. 'true' or 'false'(default)
|
227
|
+
#esxi.guest_autostart = 'false'
|
228
|
+
|
225
229
|
# RISKY. guest_custom_vmx_settings
|
226
230
|
#esxi.guest_custom_vmx_settings = [['vhv.enable','TRUE'], ['floppy0.present','TRUE']]
|
227
231
|
|
@@ -233,11 +237,11 @@ Vagrant.configure('2') do |config|
|
|
233
237
|
|
234
238
|
# DANGEROUS! Allow Overwrite
|
235
239
|
# If unspecified, the default is to produce an error if overwriting
|
236
|
-
#
|
240
|
+
# VMs and packages.
|
237
241
|
#esxi.local_allow_overwrite = 'True'
|
238
242
|
|
239
243
|
# Advanced Users.
|
240
|
-
# If set to 'True', all WARNINGS will produce a FAILURE and
|
244
|
+
# If set to 'True', all WARNINGS will produce a FAILURE and Vagrant will stop.
|
241
245
|
#esxi.local_failonwarning = 'True'
|
242
246
|
|
243
247
|
# Plugin debug output.
|
@@ -265,23 +269,17 @@ Basic usage
|
|
265
269
|
* `vagrant snapshot pop`
|
266
270
|
* `vagrant halt`
|
267
271
|
* `vagrant provision`
|
268
|
-
* `vagrant address` #
|
269
|
-
|
272
|
+
* `vagrant address` # ESXi provided plugin. Output IP address of guest.
|
270
273
|
|
271
274
|
|
272
|
-
Upgrading from vagrant-vmware-esxi 1.x.x
|
273
|
-
----------------------------------------
|
274
|
-
See wiki for more information.
|
275
|
-
>https://github.com/josenk/vagrant-vmware-esxi/wiki/Upgrading-from-vagrant-vmware-esxi-1.x.x
|
276
|
-
|
277
275
|
|
278
276
|
Known issues with vmware_esxi
|
279
277
|
-----------------------------
|
280
278
|
* The boxes must have open-vm-tools or vmware-tools installed to properly transition to the 'running' state.
|
281
279
|
* 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.
|
282
|
-
* If you break an install ([CTRL]-C), the cleanup task doesn't always destroy the VM that has been partially built. To resolve this, use the local_allow_overwrite = 'True' Vagrantfile option if you want to force a rebuild, or you can delete the vm using the
|
283
|
-
* ovftool installer for
|
284
|
-
* Vagrant NFS synced folders cannot not 100% reliable on multi-homed clients (your
|
280
|
+
* If you break an install ([CTRL]-C), the cleanup task doesn't always destroy the VM that has been partially built. To resolve this, use the local_allow_overwrite = 'True' Vagrantfile option if you want to force a rebuild, or you can delete the vm using the vSphere client.
|
281
|
+
* 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.
|
282
|
+
* Vagrant NFS synced folders cannot not be 100% 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, way to reach the VM guest.
|
285
283
|
* 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.
|
286
284
|
* Vagrant 2.1.0 is not compatible with this plugin. Avoid Vagrant 2.1.0.
|
287
285
|
* Cygwin & gitbash have console issues. Ruby module io/console does not have support. https://github.com/ruby/io-console/issues/2
|
@@ -290,11 +288,17 @@ Known issues with vmware_esxi
|
|
290
288
|
|
291
289
|
Version History
|
292
290
|
---------------
|
293
|
-
* 2.
|
294
|
-
* 2.
|
295
|
-
* 2.
|
296
|
-
|
297
|
-
* 2.4.
|
291
|
+
* 2.5.2 Fix, snapshot restore will execute regardless of current state.
|
292
|
+
* 2.5.1 Fix, filter localhost from local IP detection for nfs sync.
|
293
|
+
* 2.5.0 Add support to set guest vm to Autostart.
|
294
|
+
* 2.4.5 Do not wait for `running` when resuming a VM that is not able to be resumed.
|
295
|
+
* 2.4.4 Show stderr if unable to connect to ESXi host. Update GuestOS types.
|
296
|
+
* 2.4.3 Update GuestOS types.
|
297
|
+
* 2.4.3 Fix, Allow disk stores with "(" or ")" in their name. Add support for up to 10 virtual NICs
|
298
|
+
* 2.4.2 Fix i18n dependency.
|
299
|
+
* 2.4.1 Change/Fix output of 'vagrant address' when a single machine is configured or specified.
|
300
|
+
|
301
|
+
* 2.4.0 Add support for 'vagrant address', output IP address of guest.
|
298
302
|
Fix, exit 1 on vagrant up if unable to reach "running" state.
|
299
303
|
Some code cleanup.
|
300
304
|
|
@@ -304,16 +308,16 @@ Version History
|
|
304
308
|
|
305
309
|
* 2.3.0 Add support to specify DiskStore for guest_storage virtual disks.
|
306
310
|
Add local_failonwarning Vagrantfile option.
|
307
|
-
Fix, make plugin more compatible with
|
311
|
+
Fix, make plugin more compatible with OVFTool 4.3.0
|
308
312
|
|
309
313
|
* 2.2.2 Fix, Avoid crash if esxi_password is nil.
|
310
314
|
|
311
315
|
* 2.2.1 Fix, clone_from_vm not working on MAC.
|
312
316
|
Fix, enabled SetHostname.
|
313
|
-
Fix, Multimachine not working with multiple
|
317
|
+
Fix, Multimachine not working with multiple ESXi hosts and different passwords.
|
314
318
|
|
315
319
|
* 2.2.0 Add support to extend boot disk size.
|
316
|
-
Fix, add many more special characters to encode in
|
320
|
+
Fix, add many more special characters to encode in ESXi passwords.
|
317
321
|
|
318
322
|
* 2.1.0 Add support for clone_from_vm.
|
319
323
|
Fix, use esxcli to get storage information.
|
@@ -321,22 +325,22 @@ Version History
|
|
321
325
|
* 2.0.7 Fix, Doesn't wait for running when executing "vagrant reload"
|
322
326
|
Fix, "vagrant halt" will now attempt a graceful shutdown before doing a hard power off.
|
323
327
|
|
324
|
-
* 2.0.6 Fix Windows compatibility by not supporting ed25519 ssh keys. When net-ssh 5.x is released AND
|
328
|
+
* 2.0.6 Fix Windows compatibility by not supporting ed25519 ssh keys. When net-ssh 5.x is released AND Vagrant allows its use, I will support ed25519 again.
|
325
329
|
Fix, encode '/' in esxi passwords.
|
326
330
|
Fix, Get local IP address for NFS syncd folders. Filter out localhost 127.0.0.0/8.
|
327
331
|
Work-around 'prompt:' issues with unsupported consoles. Cygwin & gitbash, for example.
|
328
332
|
|
329
333
|
* 2.0.5 Performance enhancement. Guest IP caching
|
330
|
-
Performance enhancement. Optimize
|
334
|
+
Performance enhancement. Optimize ESXi connectivity checks.
|
331
335
|
Performance enhancement & bugfix. Get local IP address for NFS syncd folders.
|
332
|
-
Fix, unable to get VMID if getallvms command produces any errors (for other
|
336
|
+
Fix, unable to get VMID if getallvms command produces any errors (for other VMs).
|
333
337
|
|
334
|
-
* 2.0.2 Add support to add additional storage to guest
|
335
|
-
Fix, encode (space) in
|
338
|
+
* 2.0.2 Add support to add additional storage to guest VMs.
|
339
|
+
Fix, encode (space) in ESXi passwords.
|
336
340
|
|
337
341
|
* 2.0.1 Updated version:
|
338
342
|
Most Vagrantfile options have been renamed to be consistent and for clarity.
|
339
|
-
vagrant up, more organized summary by
|
343
|
+
vagrant up, more organized summary by ESXi/guest options.
|
340
344
|
Lots of Code cleanup.
|
341
345
|
Add support for snapshot options (includeMemory & quiesced)
|
342
346
|
Snapshot save/push adds a description.
|
data/example_box/Vagrantfile
CHANGED
@@ -141,7 +141,7 @@ Vagrant.configure('2') do |config|
|
|
141
141
|
# Otherwise you can set a fixed guest VM name here.
|
142
142
|
#esxi.guest_name = 'Custom-Guest-VM_Name'
|
143
143
|
|
144
|
-
# OPTIONAL. When automatically naming VMs, use this
|
144
|
+
# OPTIONAL. When automatically naming VMs, use this prefix.
|
145
145
|
#esxi.guest_name_prefix = 'V-'
|
146
146
|
|
147
147
|
# OPTIONAL. Set the guest username login. The default is 'vagrant'.
|
@@ -219,6 +219,13 @@ Vagrant.configure('2') do |config|
|
|
219
219
|
# ESXi 6.5 supports these versions. 4,7,8,9,10,11,12,13 & 14.
|
220
220
|
#esxi.guest_virtualhw_version = '9'
|
221
221
|
|
222
|
+
# OPTIONAL. guest_autostart
|
223
|
+
# If unspecified, the guest VM will not autostart. Set this to 'true' if
|
224
|
+
# you want the guest VM to autostart when the esxi host is booted. The autostart
|
225
|
+
# options are all DEFAULT and there is no options in this plugin to modify them.
|
226
|
+
# Valid options. 'true' or 'false'(default)
|
227
|
+
#esxi.guest_autostart = 'false'
|
228
|
+
|
222
229
|
# RISKY. guest_custom_vmx_settings
|
223
230
|
# You can specify an array of custom vmx settings to add (or to override
|
224
231
|
# existing settings). **** I don't do any validation, so if you
|
@@ -1,33 +1,32 @@
|
|
1
1
|
#
|
2
2
|
# Multi machine, essential options Vagrant file example. (documentation removed)
|
3
3
|
#
|
4
|
+
nodes = {
|
5
|
+
"vm-multi1" => ["hashicorp/precise64", 1, 1024, 21 ],
|
6
|
+
"vm-multi2" => ["generic/centos7", 2, 2048, 22 ],
|
7
|
+
}
|
4
8
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
]
|
9
|
+
Vagrant.configure(2) do |config|
|
10
|
+
nodes.each do | (name, cfg) |
|
11
|
+
box, numvcpus, memory, storage = cfg
|
9
12
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
node_config.vm.box = node[:box]
|
15
|
-
node_config.vm.synced_folder('.', '/Vagrantfiles', type: 'rsync')
|
16
|
-
end
|
17
|
-
end
|
13
|
+
config.vm.define name do |machine|
|
14
|
+
machine.vm.box = box
|
15
|
+
machine.vm.hostname = name
|
16
|
+
machine.vm.synced_folder('.', '/Vagrantfiles', type: 'rsync')
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
18
|
+
machine.vm.provider :vmware_esxi do |esxi|
|
19
|
+
esxi.esxi_hostname = 'esxi'
|
20
|
+
esxi.esxi_username = 'root'
|
21
|
+
esxi.esxi_password = 'file:'
|
22
|
+
esxi.esxi_virtual_network = "VM Network"
|
23
|
+
esxi.guest_numvcpus = numvcpus
|
24
|
+
esxi.guest_memsize = memory
|
25
|
+
esxi.guest_storage = storage
|
26
|
+
#esxi.clone_from_vm = box
|
27
|
+
esxi.local_allow_overwrite = 'True'
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
32
31
|
end
|
33
32
|
end
|
@@ -47,9 +47,14 @@ module VagrantPlugins
|
|
47
47
|
def self.action_resume
|
48
48
|
Vagrant::Action::Builder.new.tap do |b|
|
49
49
|
b.use SetESXiPassword
|
50
|
-
b.use ReadState
|
51
|
-
|
52
|
-
|
50
|
+
b.use Call, ReadState do |env1, b1|
|
51
|
+
if env1[:machine_state].to_s == 'not_created'
|
52
|
+
b1.use Resume
|
53
|
+
else
|
54
|
+
b1.use Resume
|
55
|
+
b1.use WaitForState, :running, 240
|
56
|
+
end
|
57
|
+
end
|
53
58
|
end
|
54
59
|
end
|
55
60
|
|
@@ -108,8 +113,11 @@ module VagrantPlugins
|
|
108
113
|
def self.action_snapshot_restore
|
109
114
|
Vagrant::Action::Builder.new.tap do |b|
|
110
115
|
b.use SetESXiPassword
|
111
|
-
b.use
|
112
|
-
|
116
|
+
b.use Call, ReadState do |env1, b1|
|
117
|
+
b1.use Halt unless env1[:machine_state] == 'powered_off'
|
118
|
+
b1.use ReadState
|
119
|
+
end
|
120
|
+
b.use Call, WaitForState, :powered_off, 30 do |env1, b1|
|
113
121
|
if env1[:result] == 'True'
|
114
122
|
b1.use SnapshotRestore
|
115
123
|
b1.use ReadState
|
@@ -526,6 +526,10 @@ module VagrantPlugins
|
|
526
526
|
end
|
527
527
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
528
528
|
message: "Guest OS type : #{desired_guestos}")
|
529
|
+
unless config.guest_autostart.nil?
|
530
|
+
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
531
|
+
message: "Autostart : #{config.guest_autostart}")
|
532
|
+
end
|
529
533
|
unless config.virtualhw_version.nil?
|
530
534
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
531
535
|
message: "Virtual HW ver : #{desired_virtualhw_version}")
|
@@ -832,6 +836,23 @@ module VagrantPlugins
|
|
832
836
|
message: "Unable to reload vmx."
|
833
837
|
end
|
834
838
|
|
839
|
+
if !config.guest_autostart.nil?
|
840
|
+
if config.guest_autostart.casecmp('true') == 0
|
841
|
+
startOrder = ssh.exec!('vim-cmd hostsvc/autostartmanager/get_autostartseq |grep startOrder |awk -F"=" "{print $2}" | sort -n |tail -1 |grep -o "[0-9]*"').to_i + 1
|
842
|
+
startDelay = ssh.exec!('vim-cmd hostsvc/autostartmanager/get_defaults |grep startDelay |grep -o "[0-9]*"').to_i
|
843
|
+
stopDelay = ssh.exec!('vim-cmd hostsvc/autostartmanager/get_defaults |grep stopDelay |grep -o "[0-9]*"').to_i
|
844
|
+
|
845
|
+
cmd = "vim-cmd hostsvc/autostartmanager/update_autostartentry "\
|
846
|
+
"#{env[:machine].id} PowerOn #{startDelay} #{startOrder} systemDefault #{stopDelay} systemDefault"
|
847
|
+
puts "cmd: #{cmd}"
|
848
|
+
r = ssh.exec!(cmd)
|
849
|
+
if r.exitstatus != 0
|
850
|
+
raise Errors::ESXiError,
|
851
|
+
message: "Unable to set autostart."
|
852
|
+
end
|
853
|
+
end
|
854
|
+
end
|
855
|
+
|
835
856
|
# Done
|
836
857
|
end
|
837
858
|
end
|
@@ -178,7 +178,8 @@ module VagrantPlugins
|
|
178
178
|
@logger.info('vagrant-vmware-esxi, set_esxi_password: '\
|
179
179
|
"ESXi version: #{esxi_version}")
|
180
180
|
raise Errors::ESXiError,
|
181
|
-
message: 'Unable to connect to ESXi host!'
|
181
|
+
message: 'Unable to connect to ESXi host!'\
|
182
|
+
"Error: #{esxi_version}"
|
182
183
|
end
|
183
184
|
end
|
184
185
|
rescue
|
@@ -201,7 +202,8 @@ module VagrantPlugins
|
|
201
202
|
"ESXi host access : #{access_error_message}")
|
202
203
|
|
203
204
|
raise Errors::ESXiError,
|
204
|
-
message: 'Unable to connect to ESXi host!'
|
205
|
+
message: 'Unable to connect to ESXi host! '\
|
206
|
+
"Error: #{$!}"
|
205
207
|
end
|
206
208
|
end
|
207
209
|
end
|
@@ -92,7 +92,7 @@ module VagrantPlugins
|
|
92
92
|
' install from http://www.vmware.com.'
|
93
93
|
end
|
94
94
|
|
95
|
-
ovf_cmd = "ovftool --noSSLVerify -tt=VMX --name=\"#{boxname}\" "\
|
95
|
+
ovf_cmd = "ovftool --noSSLVerify -tt=VMX --X:useMacNaming=false --name=\"#{boxname}\" "\
|
96
96
|
"#{overwrite_opts} vi://#{config.esxi_username}:"\
|
97
97
|
"#{config.encoded_esxi_password}@#{config.esxi_hostname}"\
|
98
98
|
"?moref=vim.VirtualMachine:#{machine.id} #{tmpdir}"
|
@@ -57,8 +57,8 @@ module VagrantPlugins
|
|
57
57
|
# Try to get first interface. This is the prefered method
|
58
58
|
# when you have multiple network interfaces
|
59
59
|
ssh_execute_cmd = "vim-cmd vmsvc/get.guest #{machine.id} 2>/dev/null |"
|
60
|
-
ssh_execute_cmd << '
|
61
|
-
ssh_execute_cmd << 'grep -oE "((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])"'
|
60
|
+
ssh_execute_cmd << 'sed \'1!G;h;$!d\' |awk \'/deviceConfigId = 4000/,/ipAddress/\' |'
|
61
|
+
ssh_execute_cmd << 'grep -oE "((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])" |tail -1'
|
62
62
|
r = ssh.exec!(ssh_execute_cmd)
|
63
63
|
ipaddress = r.strip
|
64
64
|
|
@@ -8,6 +8,7 @@ module VagrantPlugins
|
|
8
8
|
# This action reads the state of the machine and puts it in the
|
9
9
|
# `:machine_state_id` key in the environment.
|
10
10
|
class ReadState
|
11
|
+
@@nfs_valid_ids = []
|
11
12
|
def initialize(app, env)
|
12
13
|
@app = app
|
13
14
|
@logger = Log4r::Logger.new('vagrant_vmware_esxi::action::read_state')
|
@@ -17,18 +18,22 @@ module VagrantPlugins
|
|
17
18
|
env[:machine_state] = read_state(env)
|
18
19
|
|
19
20
|
# Do NFS stuff
|
20
|
-
if (env[:machine_state].to_s.include? "running") && (
|
21
|
+
if (env[:machine_state].to_s.include? "running") && (@nfs_host_ip.nil?)
|
21
22
|
ssh_info = env[:machine].ssh_info
|
22
23
|
if defined?(ssh_info[:host])
|
23
24
|
env[:nfs_machine_ip] = [ssh_info[:host]]
|
24
|
-
|
25
|
-
|
26
|
-
|
25
|
+
@nfs_machine_ip = [ssh_info[:host]].dup
|
26
|
+
@@nfs_valid_ids |= [env[:machine].id]
|
27
|
+
env[:nfs_valid_ids] = @@nfs_valid_ids
|
27
28
|
|
28
29
|
begin
|
29
30
|
puts "Get local IP address for NFS. (pri)" if env[:machine].provider_config.debug =~ %r{ip}i
|
30
31
|
# The Standard way to get your IP. Get your hostname, resolv it.
|
31
|
-
|
32
|
+
addr_info = Socket::getaddrinfo(Socket.gethostname,"echo",Socket::AF_INET)
|
33
|
+
|
34
|
+
non_localhost = addr_info.select{ |info| info[3] !~ /^127./}
|
35
|
+
|
36
|
+
env[:nfs_host_ip] = non_localhost[0][3]
|
32
37
|
rescue
|
33
38
|
puts "Get local IP address for NFS. (alt)" if env[:machine].provider_config.debug =~ %r{ip}i
|
34
39
|
# Alt method. Get list of ip_addresses on system and use the first.
|
@@ -40,7 +45,7 @@ module VagrantPlugins
|
|
40
45
|
end
|
41
46
|
end
|
42
47
|
|
43
|
-
|
48
|
+
@nfs_host_ip = env[:nfs_host_ip].dup
|
44
49
|
if env[:nfs_host_ip].nil?
|
45
50
|
# Something bad happened above. Give up on NFS.
|
46
51
|
env[:nfs_machine_ip] = nil
|
@@ -56,9 +61,9 @@ module VagrantPlugins
|
|
56
61
|
end
|
57
62
|
else
|
58
63
|
# Use Cached entries
|
59
|
-
env[:nfs_machine_ip] =
|
60
|
-
env[:nfs_host_ip] =
|
61
|
-
env[:nfs_valid_ids] =
|
64
|
+
env[:nfs_machine_ip] = @nfs_machine_ip
|
65
|
+
env[:nfs_host_ip] = @nfs_host_ip
|
66
|
+
env[:nfs_valid_ids] = @@nfs_valid_ids
|
62
67
|
end
|
63
68
|
|
64
69
|
@app.call(env)
|
@@ -30,7 +30,7 @@ module VagrantPlugins
|
|
30
30
|
(env[:machine_state].to_s == 'running')
|
31
31
|
env[:ui].info I18n.t('vagrant_vmware_esxi.already_powered_on')
|
32
32
|
elsif env[:machine_state].to_s == 'not_created'
|
33
|
-
|
33
|
+
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
34
34
|
message: 'Cannot resume in this state')
|
35
35
|
elsif (env[:machine_state].to_s == 'powered_off') ||
|
36
36
|
(env[:machine_state].to_s == 'suspended')
|
@@ -28,6 +28,7 @@ module VagrantPlugins
|
|
28
28
|
attr_accessor :guest_snapshot_includememory
|
29
29
|
attr_accessor :guest_snapshot_quiesced
|
30
30
|
attr_accessor :guest_custom_vmx_settings
|
31
|
+
attr_accessor :guest_autostart
|
31
32
|
attr_accessor :local_private_keys
|
32
33
|
attr_accessor :local_allow_overwrite
|
33
34
|
attr_accessor :local_lax
|
@@ -121,6 +122,7 @@ module VagrantPlugins
|
|
121
122
|
'centos6',
|
122
123
|
'centos7-64',
|
123
124
|
'centos7',
|
125
|
+
'centos8-64',
|
124
126
|
'centos',
|
125
127
|
'coreos-64',
|
126
128
|
'darwin10-64',
|
@@ -132,6 +134,9 @@ module VagrantPlugins
|
|
132
134
|
'darwin14-64',
|
133
135
|
'darwin15-64',
|
134
136
|
'darwin16-64',
|
137
|
+
'darwin17-64',
|
138
|
+
'darwin18-64',
|
139
|
+
'darwin19-64',
|
135
140
|
'darwin-64',
|
136
141
|
'darwin',
|
137
142
|
'debian10-64',
|
@@ -155,6 +160,10 @@ module VagrantPlugins
|
|
155
160
|
'fedora',
|
156
161
|
'freebsd-64',
|
157
162
|
'freebsd',
|
163
|
+
'freebsd11-64',
|
164
|
+
'freebsd11',
|
165
|
+
'freebsd12-64',
|
166
|
+
'freebsd12',
|
158
167
|
'genericlinux',
|
159
168
|
'mandrake',
|
160
169
|
'mandriva-64',
|
@@ -197,6 +206,7 @@ module VagrantPlugins
|
|
197
206
|
'rhel6',
|
198
207
|
'rhel7-64',
|
199
208
|
'rhel7',
|
209
|
+
'rhel8-64',
|
200
210
|
'sjds',
|
201
211
|
'sles10-64',
|
202
212
|
'sles10',
|
data/vagrant-vmware-esxi.gemspec
CHANGED
@@ -15,11 +15,15 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.files = `git ls-files`.split($\)
|
16
16
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
17
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
18
|
+
s.require_path = 'lib'
|
18
19
|
|
19
20
|
s.add_runtime_dependency 'i18n', '~> 1.0'
|
20
21
|
s.add_runtime_dependency 'log4r', '~> 1.1'
|
21
22
|
s.add_runtime_dependency "iniparse", '> 1.0'
|
22
|
-
s.add_runtime_dependency
|
23
|
+
s.add_runtime_dependency 'nokogiri', '~> 1.6'
|
24
|
+
|
25
|
+
s.add_development_dependency 'rake'
|
26
|
+
s.add_development_dependency 'rspec'
|
23
27
|
|
24
28
|
# Needed only to support ed25519 ssh keys with net-ssh 4.x. Won't need this for net-ssh 5.x.
|
25
29
|
#s.add_runtime_dependency 'rbnacl', '>= 4.0', '< 5.0'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Senkerik
|
@@ -56,16 +56,44 @@ dependencies:
|
|
56
56
|
name: nokogiri
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
61
|
+
version: '1.6'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.6'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
67
95
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
96
|
+
version: '0'
|
69
97
|
description: A Vagrant plugin that adds a VMware ESXi provider support
|
70
98
|
email: josenk@jintegrate.co
|
71
99
|
executables: []
|
@@ -74,6 +102,7 @@ extra_rdoc_files: []
|
|
74
102
|
files:
|
75
103
|
- ESXi_guestos_types.md
|
76
104
|
- Gemfile
|
105
|
+
- Gemfile.path
|
77
106
|
- LICENSE
|
78
107
|
- README.md
|
79
108
|
- Rakefile
|
@@ -129,8 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
158
|
- !ruby/object:Gem::Version
|
130
159
|
version: '0'
|
131
160
|
requirements: []
|
132
|
-
|
133
|
-
rubygems_version: 2.6.13
|
161
|
+
rubygems_version: 3.0.3
|
134
162
|
signing_key:
|
135
163
|
specification_version: 4
|
136
164
|
summary: Vagrant ESXi provider plugin
|