vagrant-vmware-esxi 2.4.2 → 2.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3fbcbcf238cd9c3004f555ba0f621146df5a3438
4
- data.tar.gz: a73ab4958864e6267ce091d2dd917a2bd4f487b7
2
+ SHA256:
3
+ metadata.gz: 40331b3198d6a85293719e3bd1c529ce7d01de80f151b2cdeed7aa771e0f127a
4
+ data.tar.gz: a500020408fe69d6d81a057a390013cb8f3d897d062fc7a634ff243c018743b1
5
5
  SHA512:
6
- metadata.gz: 0a6981d7ec2a2a09768d8f96ef7bca408fb5c76f3287e20b807fd12c28add2a68f4071c44d866d798fd3560d94b6abd58d1b57b0f497a705376295557c652473
7
- data.tar.gz: c1d51476360b5345f7a9634a6cc5d82c4535644946fa578cb54697abc538ecf4a9613d5bb226d44e46372be1ffe887367fa380930e5b49ef3b6a2400ab0c6497
6
+ metadata.gz: eacbdb2b3d689b16cfe45c36ee7fe42d475ea3a3e6f4f19de22cb034bc1922d8bd9585449ed537894e99a9f2b94c7a50a1326bbf30261f193016d6a964020d55
7
+ data.tar.gz: 736975fe3243fd1f847048e9131e619a27788279b03eae7518c54dd4910f7506ad6c3d7549fdadab0ca3190e7ac3a13133365dbcad6b0bdf3db8b11832e03284
@@ -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-5/index.jsp#com.vmware.wssdk.apiref.doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html
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
- gem 'vagrant', git: 'https://github.com/hashicorp/vagrant.git'
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
- gemspec
22
+ gem "vagrant-vmware-esxi", path: "."
9
23
  end
24
+
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'vagrant', path: '../vagrant' # checked out 'cca36d9'
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
- Looking for volunteers to help with terraform-provider-esxi
13
- -----------------------------------------------------------
14
- If you are using vagrant as an esxi vm deployment tool (infa as code), you may want to consider a better tool. Terraform. 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...
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 esxi host instead of transferring a box stored on your local pc.
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 vm's into boxes.
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 esxi'
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
  ----------------
@@ -111,7 +112,7 @@ Vagrant.configure('2') do |config|
111
112
  # optionally netmask. ESXi doesn't use the concept of public or private
112
113
  # networks so both are valid here. The primary network interface is considered the
113
114
  # "vagrant management" interface and cannot be changed and this plugin
114
- # supports 4 NICS, so you can specify 3 entries here!
115
+ # supports 10 NICS, so you can specify 9 entries here!
115
116
  #
116
117
  # https://www.vagrantup.com/docs/networking/public_network.html
117
118
  # https://www.vagrantup.com/docs/networking/private_network.html
@@ -146,7 +147,7 @@ Vagrant.configure('2') do |config|
146
147
 
147
148
  # HIGHLY RECOMMENDED! ESXi Virtual Network
148
149
  # You should specify an ESXi Virtual Network! If it's not specified, the
149
- # default is to use the first found. You can specify up to 4 virtual
150
+ # default is to use the first found. You can specify up to 10 virtual
150
151
  # networks using an array format.
151
152
  #esxi.esxi_virtual_network = ['VM Network','VM Network2','VM Network3','VM Network4']
152
153
 
@@ -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 prifix.
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
 
@@ -181,7 +181,7 @@ Vagrant.configure('2') do |config|
181
181
  # OPTIONAL. Virtual CPUs override
182
182
  #esxi.guest_numvcpus = '2'
183
183
 
184
- # OPTIONAL & RISKY. Specify up to 4 MAC addresses
184
+ # OPTIONAL & RISKY. Specify up to 10 MAC addresses
185
185
  # The default is ovftool to automatically generate a MAC address.
186
186
  # You can specify an array of MAC addresses using upper or lower case,
187
187
  # separated by colons ':'.
@@ -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/ESXi_guest_guestos_types.md
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
- # vm's and packages.
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 vagrant will stop.
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` # esxi provided plugin. Output IP address of guest.
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 VSphere client.
283
- * 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.
284
- * Vagrant NFS synced folders cannot not 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.
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,10 +288,16 @@ Known issues with vmware_esxi
290
288
 
291
289
  Version History
292
290
  ---------------
293
- * 2.4.2 Fix i18n dependancy.
294
- * 2.4.1 Change/Fix output of 'vagrant address' when a single machine is configured or specifed.
295
-
296
- * 2.4.0 Add support for 'vagrant address', output ip address of guest.
291
+ * 2.5.1 Fix, filter localhost from local IP detection for nfs sync.
292
+ * 2.5.0 Add support to set guest vm to Autostart.
293
+ * 2.4.5 Do not wait for `running` when resuming a VM that is not able to be resumed.
294
+ * 2.4.4 Show stderr if unable to connect to ESXi host. Update GuestOS types.
295
+ * 2.4.3 Update GuestOS types.
296
+ * 2.4.3 Fix, Allow disk stores with "(" or ")" in their name. Add support for up to 10 virtual NICs
297
+ * 2.4.2 Fix i18n dependency.
298
+ * 2.4.1 Change/Fix output of 'vagrant address' when a single machine is configured or specified.
299
+
300
+ * 2.4.0 Add support for 'vagrant address', output IP address of guest.
297
301
  Fix, exit 1 on vagrant up if unable to reach "running" state.
298
302
  Some code cleanup.
299
303
 
@@ -303,16 +307,16 @@ Version History
303
307
 
304
308
  * 2.3.0 Add support to specify DiskStore for guest_storage virtual disks.
305
309
  Add local_failonwarning Vagrantfile option.
306
- Fix, make plugin more compatible with Ovftool 4.3.0
310
+ Fix, make plugin more compatible with OVFTool 4.3.0
307
311
 
308
312
  * 2.2.2 Fix, Avoid crash if esxi_password is nil.
309
313
 
310
314
  * 2.2.1 Fix, clone_from_vm not working on MAC.
311
315
  Fix, enabled SetHostname.
312
- Fix, Multimachine not working with multiple esxi hosts and different passwords.
316
+ Fix, Multimachine not working with multiple ESXi hosts and different passwords.
313
317
 
314
318
  * 2.2.0 Add support to extend boot disk size.
315
- Fix, add many more special characters to encode in esxi passwords.
319
+ Fix, add many more special characters to encode in ESXi passwords.
316
320
 
317
321
  * 2.1.0 Add support for clone_from_vm.
318
322
  Fix, use esxcli to get storage information.
@@ -320,22 +324,22 @@ Version History
320
324
  * 2.0.7 Fix, Doesn't wait for running when executing "vagrant reload"
321
325
  Fix, "vagrant halt" will now attempt a graceful shutdown before doing a hard power off.
322
326
 
323
- * 2.0.6 Fix Windows compatibility by not supporting ed25519 ssh keys. When net-ssh 5.x is released AND vagrant allows it's use, I will support ed25519 again.
327
+ * 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.
324
328
  Fix, encode '/' in esxi passwords.
325
329
  Fix, Get local IP address for NFS syncd folders. Filter out localhost 127.0.0.0/8.
326
330
  Work-around 'prompt:' issues with unsupported consoles. Cygwin & gitbash, for example.
327
331
 
328
332
  * 2.0.5 Performance enhancement. Guest IP caching
329
- Performance enhancement. Optimize esxi connectivity checks.
333
+ Performance enhancement. Optimize ESXi connectivity checks.
330
334
  Performance enhancement & bugfix. Get local IP address for NFS syncd folders.
331
- Fix, unable to get VMID if getallvms command produces any errors (for other vms).
335
+ Fix, unable to get VMID if getallvms command produces any errors (for other VMs).
332
336
 
333
- * 2.0.2 Add support to add additional storage to guest vms.
334
- Fix, encode (space) in esxi passwords.
337
+ * 2.0.2 Add support to add additional storage to guest VMs.
338
+ Fix, encode (space) in ESXi passwords.
335
339
 
336
340
  * 2.0.1 Updated version:
337
341
  Most Vagrantfile options have been renamed to be consistent and for clarity.
338
- vagrant up, more organized summary by esxi/guest options.
342
+ vagrant up, more organized summary by ESXi/guest options.
339
343
  Lots of Code cleanup.
340
344
  Add support for snapshot options (includeMemory & quiesced)
341
345
  Snapshot save/push adds a description.
@@ -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 prifix.
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
- nodes = [
6
- { hostname: 'VM-multi1', box: 'hashicorp/precise64' },
7
- { hostname: 'VM-multi2', box: 'hashicorp/precise64' }
8
- ]
9
+ Vagrant.configure(2) do |config|
10
+ nodes.each do | (name, cfg) |
11
+ box, numvcpus, memory, storage = cfg
9
12
 
10
- Vagrant.configure('2') do |config|
11
- nodes.each do |node|
12
- config.vm.define node[:hostname] do |node_config|
13
- node_config.vm.hostname = node[:hostname]
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
- config.vm.provider :vmware_esxi do |esxi|
20
- #
21
- # Provider settings
22
- #
23
- esxi.esxi_hostname = 'esxi'
24
- esxi.esxi_username = 'root'
25
- esxi.esxi_password = 'file:'
26
- #esxi.esxi_hostport = 22
27
- #esxi.esxi_virtual_network = 'vmnet_example'
28
- #esxi.esxi_disk_store = 'DS_001'
29
- #esxi.esxi_resource_pool = '/Vagrant'
30
- #esxi.guest_memsize = '2048'
31
- #esxi.guest_numvcpus = '2'
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
- b.use Resume
52
- b.use WaitForState, :running, 240
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
 
@@ -139,7 +139,8 @@ module VagrantPlugins
139
139
  # Figure out DataStore
140
140
  r = ssh.exec!(
141
141
  'esxcli storage filesystem list | grep "/vmfs/volumes/.*[VMFS|NFS]" | '\
142
- "awk -F' ' '{print $NF\",\"$2}' | sort -n | awk -F',' '{print $2}'")
142
+ "awk '{printf $NF\",\" ; for(i=2;i<=NF-5;++i)printf $i\"\"FS ; printf \"\\n\"}' | "\
143
+ "sort -n | awk -F',' '{print $2}' | sed 's/ $//g'")
143
144
 
144
145
  availvolumes = r.split(/\n/)
145
146
  if config.debug =~ %r{true}i
@@ -287,7 +288,7 @@ module VagrantPlugins
287
288
  @iswarning = 'true'
288
289
  end
289
290
  networkID += 1
290
- break if networkID >= 4
291
+ break if networkID >= 10
291
292
  end
292
293
  end
293
294
 
@@ -480,7 +481,7 @@ module VagrantPlugins
480
481
  env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
481
482
  message: "ESXi host : #{config.esxi_hostname}")
482
483
  env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
483
- message: "Virtual Network : #{@guestvm_network[0..3]}")
484
+ message: "Virtual Network : #{@guestvm_network[0..9]}")
484
485
  env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
485
486
  message: "Disk Store : #{@guestvm_dsname}")
486
487
  env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
@@ -505,7 +506,7 @@ module VagrantPlugins
505
506
  message: "CPUS : #{desired_guest_numvcpus}")
506
507
  unless config.guest_mac_address[0].eql? ''
507
508
  env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
508
- message: "Mac Address : #{config.guest_mac_address[0..3]}")
509
+ message: "Mac Address : #{config.guest_mac_address[0..9]}")
509
510
  end
510
511
  unless config.guest_nic_type.nil?
511
512
  env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
@@ -525,6 +526,10 @@ module VagrantPlugins
525
526
  end
526
527
  env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
527
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
528
533
  unless config.virtualhw_version.nil?
529
534
  env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
530
535
  message: "Virtual HW ver : #{desired_virtualhw_version}")
@@ -626,7 +631,7 @@ module VagrantPlugins
626
631
 
627
632
 
628
633
  dst_vmx_file = "/vmfs/volumes/"
629
- dst_vmx_file << dst_vmx_ds.gsub('[','').gsub(']','').strip + "/"
634
+ dst_vmx_file << dst_vmx_ds.gsub('[','').gsub(']','').gsub('(','\(').gsub(')','\)').strip + "/"
630
635
  esxi_guest_dir = dst_vmx_file + dst_vmx_dir
631
636
  dst_vmx_file << dst_vmx
632
637
  dst_vmx_file = dst_vmx_file.strip.gsub(/\s/, '\ ')
@@ -831,6 +836,23 @@ module VagrantPlugins
831
836
  message: "Unable to reload vmx."
832
837
  end
833
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
+
834
856
  # Done
835
857
  end
836
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 << 'grep -A 5 "deviceConfigId = 4000" |tail -1|'
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") && ($nfs_host_ip.nil?)
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
- $nfs_machine_ip = [ssh_info[:host]].dup
25
- env[:nfs_valid_ids] = [env[:machine].id]
26
- $nfs_valid_ids = [env[:machine].id].dup
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
- env[:nfs_host_ip] = Socket::getaddrinfo(Socket.gethostname,"echo",Socket::AF_INET)[0][3]
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
- $nfs_host_ip = env[:nfs_host_ip].dup
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] = $nfs_machine_ip
60
- env[:nfs_host_ip] = $nfs_host_ip
61
- env[:nfs_valid_ids] = $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
- env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
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',
@@ -1,7 +1,7 @@
1
1
  # VERSION
2
2
  module VagrantPlugins
3
3
  module ESXi
4
- VERSION = '2.4.2'
4
+ VERSION = '2.5.1'
5
5
  $vagrant_vmware_esxi_version = VERSION
6
6
  end
7
7
  end
@@ -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 "nokogiri", '> 1.5'
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.2
4
+ version: 2.5.1
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.5'
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: '1.5'
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
- rubyforge_project:
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