vagrant-vmware-esxi 2.3.2 → 2.4.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 +4 -4
- data/README.md +12 -7
- data/example_box/Vagrantfile +2 -2
- data/lib/vagrant-vmware-esxi/action.rb +8 -0
- data/lib/vagrant-vmware-esxi/action/address.rb +38 -0
- data/lib/vagrant-vmware-esxi/action/package.rb +2 -2
- data/lib/vagrant-vmware-esxi/action/read_ssh_info.rb +1 -1
- data/lib/vagrant-vmware-esxi/action/snapshot_delete.rb +2 -2
- data/lib/vagrant-vmware-esxi/action/snapshot_info.rb +6 -6
- data/lib/vagrant-vmware-esxi/action/snapshot_list.rb +2 -2
- data/lib/vagrant-vmware-esxi/action/snapshot_restore.rb +2 -2
- data/lib/vagrant-vmware-esxi/action/snapshot_save.rb +2 -2
- data/lib/vagrant-vmware-esxi/action/wait_for_state.rb +9 -3
- data/lib/vagrant-vmware-esxi/command.rb +15 -1
- data/lib/vagrant-vmware-esxi/config.rb +1 -1
- data/lib/vagrant-vmware-esxi/plugin.rb +6 -0
- data/lib/vagrant-vmware-esxi/version.rb +1 -1
- data/vagrant-vmware-esxi.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dcbc0face9e5a7ebbfcfd749b15d83b1f42b2ea
|
4
|
+
data.tar.gz: dddf553b0781d7f60907b6d5c474d8b22778907f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bd9c80da6a1f44c3cfb70bdca1f35c05d0c5f0caa81d4fbcbbacb55913c087027203b3f6c29f4a282b4a73bb225de467b8a724d4f64c89075873102a8eac3fd
|
7
|
+
data.tar.gz: f9c74b17cc5d35fb3be15c03039a56d793fe611ce477d4f457ba88a659aabf013ff3b2845e30ae5b68b03e0900417c95599584e363088e65bf5669c5f5268de1
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ Features and Compatibility
|
|
33
33
|
* Create additional network interfaces, set nic type, MAC addresses, static IPs.
|
34
34
|
* Use Vagrants private_network, public_network options to set a static IP addresses on additional network interfaces. (not the primary interface)
|
35
35
|
* Disks can be provisioned using thin, thick or eagerzeroedthick.
|
36
|
-
* Create additional guest storage (
|
36
|
+
* Create additional guest storage (up to 14 virtual disks).
|
37
37
|
* Specify GuestOS types, virtual HW version.
|
38
38
|
* Any custom vmx settings can be added or modified.
|
39
39
|
|
@@ -213,7 +213,7 @@ Vagrant.configure('2') do |config|
|
|
213
213
|
#esxi.guest_guestos = 'centos-64'
|
214
214
|
|
215
215
|
# OPTIONAL. guest_virtualhw_version
|
216
|
-
# ESXi 6.5 supports these versions. 4,7,8,9,10,11,12 &
|
216
|
+
# ESXi 6.5 supports these versions. 4,7,8,9,10,11,12,13 & 14.
|
217
217
|
#esxi.guest_virtualhw_version = '9'
|
218
218
|
|
219
219
|
# RISKY. guest_custom_vmx_settings
|
@@ -235,7 +235,7 @@ Vagrant.configure('2') do |config|
|
|
235
235
|
#esxi.local_failonwarning = 'True'
|
236
236
|
|
237
237
|
# Plugin debug output.
|
238
|
-
# Please send any bug reports with debug
|
238
|
+
# Please send any bug reports with this debug output...
|
239
239
|
#esxi.debug = 'true'
|
240
240
|
|
241
241
|
end
|
@@ -255,10 +255,11 @@ Basic usage
|
|
255
255
|
* `vagrant ssh-config`
|
256
256
|
* `vagrant snapshot push`
|
257
257
|
* `vagrant snapshot list`
|
258
|
-
* `vagrant snapshot-info`
|
258
|
+
* `vagrant snapshot-info` # esxi provided plugin. Output snapshot information/tree.
|
259
259
|
* `vagrant snapshot pop`
|
260
260
|
* `vagrant halt`
|
261
261
|
* `vagrant provision`
|
262
|
+
* `vagrant address` # esxi provided plugin. Output IP address of guest.
|
262
263
|
|
263
264
|
|
264
265
|
|
@@ -272,17 +273,21 @@ Known issues with vmware_esxi
|
|
272
273
|
-----------------------------
|
273
274
|
* The boxes must have open-vm-tools or vmware-tools installed to properly transition to the 'running' state.
|
274
275
|
* 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.
|
275
|
-
*
|
276
|
+
* 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.
|
276
277
|
* 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.
|
277
|
-
* Vagrant NFS synced folders
|
278
|
+
* 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.
|
278
279
|
* 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
280
|
* Vagrant 2.1.0 is not compatible with this plugin. Avoid Vagrant 2.1.0.
|
280
281
|
* Cygwin & gitbash have console issues. Ruby module io/console does not have support. https://github.com/ruby/io-console/issues/2
|
281
|
-
* Setting the hostname on some boxes can cause 'vagrant up' to fail
|
282
|
+
* Setting the hostname on some boxes can cause 'vagrant up' to fail if the network configuration wasn't previously cleaned up. Avoid buggy boxes, fix the box networking and repackage, or do not set the hostname via Vagrant.
|
282
283
|
|
283
284
|
|
284
285
|
Version History
|
285
286
|
---------------
|
287
|
+
* 2.4.0 Add support for 'vagrant address', output ip address of guest.
|
288
|
+
Fix, exit 1 on vagrant up if unable to reach "running" state.
|
289
|
+
Some code cleanup.
|
290
|
+
|
286
291
|
* 2.3.2 Fix, vagrant ssh -c now works.
|
287
292
|
|
288
293
|
* 2.3.1 Fix, Disk stores can now contain spaces.
|
data/example_box/Vagrantfile
CHANGED
@@ -216,7 +216,7 @@ Vagrant.configure('2') do |config|
|
|
216
216
|
# If unspecified, the default will be generated by the OVFTool. Most
|
217
217
|
# of the time, you don't need to change this unless you are using advanced
|
218
218
|
# custom vmx settings that require it.
|
219
|
-
# ESXi 6.5 supports these versions. 4,7,8,9,10,11,12 &
|
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
222
|
# RISKY. guest_custom_vmx_settings
|
@@ -258,7 +258,7 @@ Vagrant.configure('2') do |config|
|
|
258
258
|
#esxi.local_failonwarning = 'True'
|
259
259
|
|
260
260
|
# Plugin debug output.
|
261
|
-
# Send bug reports with debug output...
|
261
|
+
# Send bug reports with this debug output...
|
262
262
|
#esxi.debug = 'true'
|
263
263
|
|
264
264
|
end
|
@@ -78,6 +78,13 @@ module VagrantPlugins
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
+
def self.action_address
|
82
|
+
Vagrant::Action::Builder.new.tap do |b|
|
83
|
+
b.use SetESXiPassword
|
84
|
+
b.use Address
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
81
88
|
def self.action_snapshot_info
|
82
89
|
Vagrant::Action::Builder.new.tap do |b|
|
83
90
|
b.use SetESXiPassword
|
@@ -201,6 +208,7 @@ module VagrantPlugins
|
|
201
208
|
autoload :SnapshotDelete, action_root.join('snapshot_delete')
|
202
209
|
autoload :SnapshotRestore, action_root.join('snapshot_restore')
|
203
210
|
autoload :WaitForState, action_root.join('wait_for_state')
|
211
|
+
autoload :Address, action_root.join('address')
|
204
212
|
end
|
205
213
|
end
|
206
214
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'log4r'
|
2
|
+
require 'net/ssh'
|
3
|
+
|
4
|
+
module VagrantPlugins
|
5
|
+
module ESXi
|
6
|
+
module Action
|
7
|
+
# This action will print the IP address
|
8
|
+
class Address
|
9
|
+
def initialize(app, _env)
|
10
|
+
@app = app
|
11
|
+
@logger = Log4r::Logger.new('vagrant_vmware_esxi::action::address')
|
12
|
+
end
|
13
|
+
|
14
|
+
def call(env)
|
15
|
+
address(env)
|
16
|
+
@app.call(env)
|
17
|
+
end
|
18
|
+
|
19
|
+
def address(env)
|
20
|
+
@logger.info('vagrant-vmware-esxi, address: start...')
|
21
|
+
|
22
|
+
# Get config.
|
23
|
+
machine = env[:machine]
|
24
|
+
config = env[:machine].provider_config
|
25
|
+
|
26
|
+
# return IP if it's known.
|
27
|
+
return nil if machine.state.id != :running
|
28
|
+
|
29
|
+
ssh_info = machine.ssh_info
|
30
|
+
return nil if !ssh_info
|
31
|
+
|
32
|
+
env[:ui].info ssh_info[:host]
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -58,7 +58,7 @@ module VagrantPlugins
|
|
58
58
|
# when you have multiple network interfaces
|
59
59
|
ssh_execute_cmd = "vim-cmd vmsvc/get.guest #{machine.id} 2>/dev/null |"
|
60
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])
|
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])"'
|
62
62
|
r = ssh.exec!(ssh_execute_cmd)
|
63
63
|
ipaddress = r.strip
|
64
64
|
|
@@ -12,11 +12,11 @@ module VagrantPlugins
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def call(env)
|
15
|
-
|
15
|
+
snapshotdelete(env)
|
16
16
|
@app.call(env)
|
17
17
|
end
|
18
18
|
|
19
|
-
def
|
19
|
+
def snapshotdelete(env)
|
20
20
|
@logger.info('vagrant-vmware-esxi, snapshot_delete: start...')
|
21
21
|
|
22
22
|
# Get config.
|
@@ -12,11 +12,11 @@ module VagrantPlugins
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def call(env)
|
15
|
-
|
15
|
+
snapshotinfo(env)
|
16
16
|
@app.call(env)
|
17
17
|
end
|
18
18
|
|
19
|
-
def
|
19
|
+
def snapshotinfo(env)
|
20
20
|
@logger.info('vagrant-vmware-esxi, snapshot_info: start...')
|
21
21
|
|
22
22
|
# Get config.
|
@@ -26,9 +26,9 @@ module VagrantPlugins
|
|
26
26
|
@logger.info("vagrant-vmware-esxi, snapshot_info: machine id: #{machine.id}")
|
27
27
|
@logger.info("vagrant-vmware-esxi, snapshot_info: current state: #{env[:machine_state]}")
|
28
28
|
|
29
|
-
if
|
29
|
+
if machine.id == ''
|
30
30
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
31
|
-
message: 'Cannot
|
31
|
+
message: 'Cannot snapshot-info in this state')
|
32
32
|
else
|
33
33
|
|
34
34
|
Net::SSH.start(config.esxi_hostname, config.esxi_username,
|
@@ -43,9 +43,9 @@ module VagrantPlugins
|
|
43
43
|
r = ssh.exec!(
|
44
44
|
"vim-cmd vmsvc/snapshot.get #{machine.id} 2>&1 | "\
|
45
45
|
"sed 's/Get Snapshot:/ /g' | "\
|
46
|
-
"grep -v "\
|
46
|
+
"grep -v -e '^ $' "\
|
47
47
|
"-e 'Snapshot Id ' "\
|
48
|
-
"-e 'Snapshot
|
48
|
+
"-e 'Snapshot Created On ' "\
|
49
49
|
"-e 'Snapshot State '")
|
50
50
|
|
51
51
|
snapshotinfo = r
|
@@ -12,11 +12,11 @@ module VagrantPlugins
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def call(env)
|
15
|
-
|
15
|
+
snapshotrestore(env)
|
16
16
|
@app.call(env)
|
17
17
|
end
|
18
18
|
|
19
|
-
def
|
19
|
+
def snapshotrestore(env)
|
20
20
|
@logger.info('vagrant-vmware-esxi, snapshot_restore: start...')
|
21
21
|
|
22
22
|
# Get config.
|
@@ -30,10 +30,16 @@ module VagrantPlugins
|
|
30
30
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
31
31
|
message: "Success, state is now \"#{@state}\"")
|
32
32
|
end
|
33
|
+
|
33
34
|
rescue Timeout::Error
|
34
|
-
|
35
|
-
|
36
|
-
|
35
|
+
if @state.to_s == 'running'
|
36
|
+
raise Errors::GeneralError,
|
37
|
+
message: 'Failed, timeout waiting for "running".'
|
38
|
+
else
|
39
|
+
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
40
|
+
message: "Timeout waiting for \"#{@state}\"")
|
41
|
+
env[:result] = 'False' # couldn't reach state in time
|
42
|
+
end
|
37
43
|
end
|
38
44
|
end
|
39
45
|
env[:machine].provider_config.saved_ipaddress = nil
|
@@ -1,14 +1,28 @@
|
|
1
1
|
module VagrantPlugins
|
2
2
|
module ESXi
|
3
|
+
|
3
4
|
class SnapshotInfo < Vagrant.plugin(2, :command)
|
4
5
|
def self.synopsis
|
5
6
|
"Snapshot additional information."
|
6
|
-
|
7
|
+
end
|
7
8
|
def execute
|
8
9
|
with_target_vms(nil, :provider => "vmware_esxi") do |vm|
|
9
10
|
vm.action(:snapshot_info)
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
14
|
+
|
15
|
+
class CapAddress < Vagrant.plugin(2, :command)
|
16
|
+
def self.synopsis
|
17
|
+
"outputs the IP address of a guest."
|
18
|
+
end
|
19
|
+
def execute
|
20
|
+
with_target_vms(nil, :provider => "vmware_esxi") do |vm|
|
21
|
+
vm.action(:address)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
|
13
27
|
end
|
14
28
|
end
|
@@ -22,6 +22,12 @@ module VagrantPlugins
|
|
22
22
|
Provider
|
23
23
|
end
|
24
24
|
|
25
|
+
# Prints the IP address of the guest
|
26
|
+
command('address') do
|
27
|
+
require_relative 'command'
|
28
|
+
CapAddress
|
29
|
+
end
|
30
|
+
|
25
31
|
provider_capability('vmware_esxi', 'snapshot_list') do
|
26
32
|
require_relative 'cap/snapshot_list'
|
27
33
|
Cap::SnapshotList
|
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-07-
|
6
|
+
s.date = '2018-07-23'
|
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.4.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-07-
|
11
|
+
date: 2018-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- example_box/metadata.json
|
83
83
|
- lib/vagrant-vmware-esxi.rb
|
84
84
|
- lib/vagrant-vmware-esxi/action.rb
|
85
|
+
- lib/vagrant-vmware-esxi/action/address.rb
|
85
86
|
- lib/vagrant-vmware-esxi/action/boot.rb
|
86
87
|
- lib/vagrant-vmware-esxi/action/createvm.rb
|
87
88
|
- lib/vagrant-vmware-esxi/action/destroy.rb
|