vagrant-vmware-esxi 2.4.5 → 2.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b80dcf0cc3caa8e246414af38314d56ce1d65ace893eba8a4ca20611afb25e2b
4
- data.tar.gz: 146dc97e235a67195648198e00b71cd54fa77d5a8860ab7035b5fdb6f236d5f0
3
+ metadata.gz: fc3837233e1568c8692fd622f92933786854f0ec3723c4cd3152f9f78da857ca
4
+ data.tar.gz: 6f4c96f69695c835c886bd794c6992a486851b39e9453f1a247b5ecd96a54b36
5
5
  SHA512:
6
- metadata.gz: 6bc121399632dd6d5c5764f3261bcb2880072497720b97974234884f862123fcd5d8fd567f69fb1dcc8027f3af3bfe643b1d9acb552081d628f9311ecabf8176
7
- data.tar.gz: 876ece37a1da0dfdd2109311decd1eae654680991cc879a18dbd991f9a34708f22d8f5bd3f5df64e230bfddcdd657503c5cb4ed675ce5626a13267e793b0f839
6
+ metadata.gz: 2a7b2ee288b8c77394e3ec2dafa9bbc428bb985b36dc9109fbd8916283597e7053f80e4c392681a9149397fadf023ebe72899c0dbdc4650a4a20aad23a77c935
7
+ data.tar.gz: 8ad9f3ac34fa9dc6fe0b306800d471617038ff2e2f30782bf87bdf0451ab7040ac4ceb302ba2300592db280ce34ed6433c386dc304dc0e281a098ea13b7e6ee4
data/README.md CHANGED
@@ -171,7 +171,6 @@ Vagrant.configure('2') do |config|
171
171
  # OPTIONAL. When automatically naming VMs, use this prefix.
172
172
  #esxi.guest_name_prefix = 'V-'
173
173
 
174
-
175
174
  # OPTIONAL. Set the guest username login. The default is 'vagrant'.
176
175
  #esxi.guest_username = 'vagrant'
177
176
 
@@ -215,13 +214,17 @@ Vagrant.configure('2') do |config|
215
214
  #esxi.guest_snapshot_quiesced = 'true'
216
215
 
217
216
  # RISKY. guest_guestos
218
- # https://github.com/josenk/vagrant-vmware-esxi/ESXi_guest_guestos_types.md
217
+ # https://github.com/josenk/vagrant-vmware-esxi/wiki/VMware-ESXi-6.5-guestOS-types
219
218
  #esxi.guest_guestos = 'centos-64'
220
219
 
221
220
  # OPTIONAL. guest_virtualhw_version
222
221
  # ESXi 6.5 supports these versions. 4,7,8,9,10,11,12,13 & 14.
223
222
  #esxi.guest_virtualhw_version = '9'
224
223
 
224
+ # OPTIONAL. Guest Autostart
225
+ # Guest VM will autostart when esxi host is booted. 'true' or 'false'(default)
226
+ #esxi.guest_autostart = 'false'
227
+
225
228
  # RISKY. guest_custom_vmx_settings
226
229
  #esxi.guest_custom_vmx_settings = [['vhv.enable','TRUE'], ['floppy0.present','TRUE']]
227
230
 
@@ -284,6 +287,7 @@ Known issues with vmware_esxi
284
287
 
285
288
  Version History
286
289
  ---------------
290
+ * 2.5.0 Add support to set guest vm to Autostart.
287
291
  * 2.4.5 Do not wait for `running` when resuming a VM that is not able to be resumed.
288
292
  * 2.4.4 Show stderr if unable to connect to ESXi host. Update GuestOS types.
289
293
  * 2.4.3 Update GuestOS types.
@@ -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
@@ -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
@@ -202,7 +202,8 @@ module VagrantPlugins
202
202
  "ESXi host access : #{access_error_message}")
203
203
 
204
204
  raise Errors::ESXiError,
205
- message: 'Unable to connect to ESXi host!'
205
+ message: 'Unable to connect to ESXi host! '\
206
+ "Error: #{$!}"
206
207
  end
207
208
  end
208
209
  end
@@ -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
@@ -1,7 +1,7 @@
1
1
  # VERSION
2
2
  module VagrantPlugins
3
3
  module ESXi
4
- VERSION = '2.4.5'
4
+ VERSION = '2.5.0'
5
5
  $vagrant_vmware_esxi_version = VERSION
6
6
  end
7
7
  end
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.5
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Senkerik