vagrant-vmware-esxi 2.0.2 → 2.0.5

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
  SHA1:
3
- metadata.gz: 5d0834aff046d2b6fdb5d399570a17e186db96af
4
- data.tar.gz: 7a102b5eda42f9314a8cb80ed75caae98b286f38
3
+ metadata.gz: b27af15025065ae2b975b2dace40a65ad09aadab
4
+ data.tar.gz: 8d7b51d2ee434aca4c1acb52496907fcf30c9a93
5
5
  SHA512:
6
- metadata.gz: 4319d1e60822a7fe713b5300e14f5bb7a77ef5a369eed508c41de448e1b0d20ad85c0667c8e03572a9a0a19db6375a7623e41975bfe1c3b4b10d343c594e6779
7
- data.tar.gz: b951da71fc3e6fef1ce65f698bc18d1175f4c94f9a9638c83103df89675e228ab4db7d801cd3c55c39f42914a55dec775300a1e6d78f4ff0da2214275b3d8157
6
+ metadata.gz: 7ffacc56f89bcdcba403c52a151bfa92c5ba3dcbfeaf69abc6a0e5ebb2db140d1b1bdd3a16bd5f3792625b05d174bf7705f138a986dd20e3ef6f6f8acf90df23
7
+ data.tar.gz: 02f91eb5356872ea1d301e1e027940f1a960c3ec136d6cc1e406349eab36e2f65a13998725e533e0e119652f4f8d92de8756c6b0fdcf7576266bea8f6a0d77a9
data/Gemfile CHANGED
@@ -1,10 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in vagrant-exsi.gemspec
4
- gemspec
4
+ #gemspec
5
5
 
6
6
  group :development do
7
- #gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git'
8
7
  gem 'vagrant', git: 'https://github.com/hashicorp/vagrant.git'
9
8
  #gem 'vagrant-vmware-esxi', path: '.'
10
9
  end
data/README.md CHANGED
@@ -27,9 +27,10 @@ Features and Compatibility
27
27
  * package your vm's into boxes.
28
28
  * Create additional network interfaces, set nic type, MAC addresses, static IPs.
29
29
  * Use Vagrants private_network, public_network options to set a static IP addresses on additional network interfaces. (not the primary interface)
30
- * Disks provisioned using thin, thick or eagerzeroedthick.
30
+ * Disks can be provisioned using thin, thick or eagerzeroedthick.
31
31
  * Create additional guest storage (upto 14 virtual disks).
32
- * Specify GuestOS types, virtual HW version, or any custom vmx settings.
32
+ * Specify GuestOS types, virtual HW version.
33
+ * Any custom vmx settings can be added or modified.
33
34
 
34
35
  Requirements
35
36
  ------------
@@ -173,7 +174,7 @@ Vagrant.configure('2') do |config|
173
174
  #esxi.guest_disk_type = 'thick'
174
175
 
175
176
  # OPTIONAL. Create additional storage for guests.
176
- # You can specify an array of upto 14 virtual disk sizes (in GB) that you
177
+ # You can specify an array of upto 14 virtual disk sizes (in GB) that you
177
178
  # would like the provider to create once the guest has been created.
178
179
  #esxi.guest_storage = [10,20]
179
180
 
@@ -195,13 +196,16 @@ Vagrant.configure('2') do |config|
195
196
  # OPTIONAL. local_lax
196
197
  #esxi.local_lax = 'true'
197
198
 
199
+ # OPTIONAL. Guest IP Caching
200
+ #esxi.local_use_ip_cache = 'True'
201
+
198
202
  # DANGEROUS! Allow Overwrite
199
203
  # If unspecified, the default is to produce an error if overwriting
200
204
  # vm's and packages.
201
205
  #esxi.local_allow_overwrite = 'True'
202
206
 
203
207
  # Plugin debug output.
204
- # Send bug reports with debug output...
208
+ # Please send any bug reports with debug this output...
205
209
  #esxi.debug = 'true'
206
210
 
207
211
  end
@@ -250,14 +254,19 @@ Basic usage
250
254
  Known issues with vmware_esxi
251
255
  -----------------------------
252
256
  * The boxes must have open-vm-tools or vmware-tools installed to properly transition to the 'running' state.
253
- * Invalid settings (bad IP address, netmask, MAC address, guest_custom_vmx_settings) could cause 'vagrant up' to fail. Review your ESXi logs to help debug why it failed.
254
- * Cleanup doesn't always destroy a VM that has been partially built. Use the local_allow_overwrite = 'True' option if you need to force a rebuild, or delete the vm using the VSphere client.
257
+ * 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.
258
+ * Cleanup doesn't always destroy a VM that has been partially built. Use the local_allow_overwrite = 'True' option if you need to force a rebuild, or you can delete the vm using the VSphere client.
255
259
  * 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.
256
- * In general I find NFS synced folders a little 'flaky'...
260
+ * In general I find the vagrant NFS synced folders a little 'flaky'...
257
261
 
258
262
 
259
263
  Version History
260
264
  ---------------
265
+ * 2.0.5 Performance enhancement. Guest IP caching
266
+ Performance enhancement. Optimize esxi connectivity checks.
267
+ Performance enhancement & bugfix. Get local IP address for NFS syncd folders.
268
+ Fix, unable to get VMID if getallvms command produces any errors (for other vms).
269
+
261
270
  * 2.0.2 Add support to add additional storage to guest vms.
262
271
  Fix, encode (space) in esxi passwords.
263
272
 
@@ -216,6 +216,13 @@ Vagrant.configure('2') do |config|
216
216
  # to convert the errors to warning. (then the import could succeed)
217
217
  #esxi.local_lax = 'true'
218
218
 
219
+ # OPTIONAL. Guest IP Caching
220
+ # If unspecified, guest IP caching will be enabled. This will result in
221
+ # faster vagrant command executution. However, vagrant could get incorrect
222
+ # information if an IP changes on the guest. Set this 'False' to disable
223
+ # IP caching.
224
+ #esxi.local_use_ip_cache = 'False'
225
+
219
226
  # DANGEROUS! Allow Overwrite
220
227
  # If unspecified, the default is to produce an error if overwriting
221
228
  # vm's and packages.
@@ -9,7 +9,6 @@ module VagrantPlugins
9
9
  def self.action_read_state
10
10
  Vagrant::Action::Builder.new.tap do |b|
11
11
  b.use SetESXiPassword
12
- b.use ReadSSHInfo
13
12
  b.use ReadState
14
13
  end
15
14
  end
@@ -49,6 +49,7 @@ module VagrantPlugins
49
49
  # A guest_name has been set, so use it.
50
50
  desired_guest_name = config.guest_name.strip
51
51
  end
52
+ desired_guest_name = desired_guest_name[0..252].gsub(/_/,'-').gsub(/[^0-9A-Za-z\-\.]/i, '').strip
52
53
  @logger.info("vagrant-vmware-esxi, createvm: config.guest_name: #{config.guest_name}")
53
54
 
54
55
  #
@@ -514,10 +515,11 @@ module VagrantPlugins
514
515
  non_interactive: true
515
516
  ) do |ssh|
516
517
  r = ssh.exec!(
517
- 'vim-cmd vmsvc/getallvms |'\
518
- "grep \" #{desired_guest_name} \"|awk '{print $1}'")
518
+ 'vim-cmd vmsvc/getallvms 2>/dev/null | sort -n |'\
519
+ "grep \"[0-9] * #{desired_guest_name} .*#{desired_guest_name}\"|"\
520
+ "awk '{print $1}'|tail -1")
519
521
  vmid = r
520
- if (vmid == '') || (r.exitstatus != 0)
522
+ if (vmid == '') || (vmid == '0') || (r.exitstatus != 0)
521
523
  raise Errors::ESXiError,
522
524
  message: "Unable to register #{desired_guest_name}"
523
525
  end
@@ -578,7 +580,7 @@ module VagrantPlugins
578
580
  puts "Avail slot: #{slot}" if config.debug =~ %r{true}i
579
581
  guest_disk_type = 'zeroedthick' if guest_disk_type == 'thick'
580
582
 
581
- cmd = "/bin/vmkfstools -c #{store_size}G -d #{guest_disk_type} #{esxi_guest_dir}/disk_#{index}.vmdk"
583
+ cmd = "/bin/vmkfstools -c #{store_size}G -d #{guest_disk_type} \"#{esxi_guest_dir}/disk_#{index}.vmdk\""
582
584
  puts "cmd: #{cmd}" if config.debug =~ %r{true}i
583
585
  r = ssh.exec!(cmd)
584
586
  if r.exitstatus != 0
@@ -93,75 +93,76 @@ module VagrantPlugins
93
93
  # Use plain text password from config
94
94
  $esxi_password = config.esxi_password
95
95
  end
96
- end
97
96
 
98
- #
99
- # Encode special characters in PW
100
- #
101
- $encoded_esxi_password = $esxi_password.gsub('%', '%25').gsub(\
102
- '<', '%3c').gsub('>', '%3e').gsub(\
103
- '[', '%5b').gsub(']', '%5d').gsub(\
104
- '(', '%28').gsub(')', '%29').gsub(\
105
- '@', '%40').gsub('#', '%23').gsub(\
106
- '&', '%26').gsub(':', '%3a').gsub(\
107
- '/', '%2f').gsub('\\','%5c').gsub(\
108
- '"', '%22').gsub('\'','%27').gsub(\
109
- '*', '%2a').gsub('?', '%3f').gsub(\
110
- '$', '%24').gsub(' ', '%20')
97
+ #
98
+ # Encode special characters in PW
99
+ #
100
+ $encoded_esxi_password = $esxi_password.gsub('%', '%25').gsub(\
101
+ '<', '%3c').gsub('>', '%3e').gsub(\
102
+ '[', '%5b').gsub(']', '%5d').gsub(\
103
+ '(', '%28').gsub(')', '%29').gsub(\
104
+ '@', '%40').gsub('#', '%23').gsub(\
105
+ '&', '%26').gsub(':', '%3a').gsub(\
106
+ '/', '%2f').gsub('\\','%5c').gsub(\
107
+ '"', '%22').gsub('\'','%27').gsub(\
108
+ '*', '%2a').gsub('?', '%3f').gsub(\
109
+ '$', '%24').gsub(' ', '%20')
111
110
 
112
- @logger.info('vagrant-vmware-esxi, connect_esxi: local_private_keys: '\
113
- "#{config.local_private_keys}")
111
+ @logger.info('vagrant-vmware-esxi, connect_esxi: local_private_keys: '\
112
+ "#{config.local_private_keys}")
114
113
 
115
- #
116
- # Test ESXi host connectivity
117
- #
118
- begin
119
- Net::SSH.start(config.esxi_hostname, config.esxi_username,
120
- password: $esxi_password,
121
- port: config.esxi_hostport,
122
- keys: config.local_private_keys,
123
- timeout: 20,
124
- number_of_password_prompts: 0,
125
- non_interactive: true
126
- ) do |ssh|
114
+ #
115
+ # Test ESXi host connectivity
116
+ #
117
+ begin
118
+ puts "Testing esxi connectivity" if config.debug =~ %r{ip}i
119
+ Net::SSH.start(config.esxi_hostname, config.esxi_username,
120
+ password: $esxi_password,
121
+ port: config.esxi_hostport,
122
+ keys: config.local_private_keys,
123
+ timeout: 20,
124
+ number_of_password_prompts: 0,
125
+ non_interactive: true
126
+ ) do |ssh|
127
127
 
128
- esxi_version = ssh.exec!('vmware -v')
129
- ssh.close
128
+ esxi_version = ssh.exec!('vmware -v')
129
+ ssh.close
130
130
 
131
- @logger = Log4r::Logger.new('vagrant_vmware_esxi::action::set_esxi_password')
132
- if (config.debug =~ %r{true}i) && $showVersionFlag.nil?
133
- $showVersionFlag = true
134
- env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
135
- message: "ESXi version : #{esxi_version}")
131
+ @logger = Log4r::Logger.new('vagrant_vmware_esxi::action::set_esxi_password')
132
+ if (config.debug =~ %r{true}i) && $showVersionFlag.nil?
133
+ $showVersionFlag = true
134
+ env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
135
+ message: "ESXi version : #{esxi_version}")
136
+ end
137
+ if esxi_version !~ %r{^vmware esxi}i
138
+ @logger.info('vagrant-vmware-esxi, set_esxi_password: '\
139
+ "ESXi version: #{esxi_version}")
140
+ raise Errors::ESXiError,
141
+ message: 'Unable to connect to ESXi host!'
142
+ end
136
143
  end
137
- if esxi_version !~ %r{^vmware esxi}i
138
- @logger.info('vagrant-vmware-esxi, set_esxi_password: '\
139
- "ESXi version: #{esxi_version}")
140
- raise Errors::ESXiError,
141
- message: 'Unable to connect to ESXi host!'
144
+ rescue
145
+ if config.esxi_password =~ %r{^prompt:}i
146
+ access_error_message = 'Prompt for password'
147
+ elsif config.esxi_password =~ %r{^env:}i
148
+ access_error_message = "env:#{esxi_password_env}"
149
+ elsif config.esxi_password =~ %r{^file:}i
150
+ access_error_message = "file:#{esxi_password_file}"
151
+ elsif config.esxi_password =~ %r{^key:}i
152
+ access_error_message = "key:#{config.local_private_keys}"
153
+ else
154
+ access_error_message = 'password in Vagrantfile'
142
155
  end
143
- end
144
- rescue
145
- if config.esxi_password =~ %r{^prompt:}i
146
- access_error_message = 'Prompt for password'
147
- elsif config.esxi_password =~ %r{^env:}i
148
- access_error_message = "env:#{esxi_password_env}"
149
- elsif config.esxi_password =~ %r{^file:}i
150
- access_error_message = "file:#{esxi_password_file}"
151
- elsif config.esxi_password =~ %r{^key:}i
152
- access_error_message = "key:#{config.local_private_keys}"
153
- else
154
- access_error_message = 'password in Vagrantfile'
155
- end
156
156
 
157
- env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
158
- message: "ESXi host access : #{access_error_message}")
157
+ env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
158
+ message: "ESXi host access : #{access_error_message}")
159
159
 
160
- @logger.info('vagrant-vmware-esxi, set_esxi_password: '\
161
- "ESXi host access : #{access_error_message}")
160
+ @logger.info('vagrant-vmware-esxi, set_esxi_password: '\
161
+ "ESXi host access : #{access_error_message}")
162
162
 
163
- raise Errors::ESXiError,
164
- message: 'Unable to connect to ESXi host!'
163
+ raise Errors::ESXiError,
164
+ message: 'Unable to connect to ESXi host!'
165
+ end
165
166
  end
166
167
  end
167
168
  end
@@ -25,9 +25,12 @@ module VagrantPlugins
25
25
 
26
26
  return nil if machine.id.nil?
27
27
 
28
+ # most of the time, state will be nil. But that's OK, we need to
29
+ # continue to read_ssh_info...
28
30
  if (env[:machine_state].to_s == 'not_created' ||
29
31
  env[:machine_state].to_s == 'powered_off' ||
30
32
  env[:machine_state].to_s == 'suspended')
33
+ config.saved_ipaddress = nil
31
34
  return nil
32
35
  end
33
36
 
@@ -35,49 +38,61 @@ module VagrantPlugins
35
38
  @logger.info('vagrant-vmware-esxi, read_ssh_info: current state:'\
36
39
  " #{env[:machine_state]}")
37
40
 
38
- # Figure out vm_ipaddress
39
- Net::SSH.start(config.esxi_hostname, config.esxi_username,
40
- password: $esxi_password,
41
- port: config.esxi_hostport,
42
- keys: config.local_private_keys,
43
- timeout: 20,
44
- number_of_password_prompts: 0,
45
- non_interactive: true
46
- ) do |ssh|
47
-
48
- @logger = Log4r::Logger.new('vagrant_vmware_esxi::action::'\
49
- 'read_ssh_info-net_ssh')
50
-
51
- # ugly, but it works...
52
- # Try to get first interface. This is the prefered method
53
- # when you have multiple network interfaces
54
- ssh_execute_cmd = "vim-cmd vmsvc/get.guest #{machine.id} 2>/dev/null |"
55
- ssh_execute_cmd << 'grep -A 5 "deviceConfigId = 4000" |tail -1|'
56
- 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])"'
57
- r = ssh.exec!(ssh_execute_cmd)
58
- ipaddress = r.strip
59
-
60
- # Some OS's don't like above method, so use IP from summary (after 60 seconds uptime)
61
- ssh_execute_cmd = "vim-cmd vmsvc/get.guest #{machine.id} 2>/dev/null |"
62
- ssh_execute_cmd << 'grep "^ ipAddress = "|head -1|'
63
- 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])"'
64
- r2 = ssh.exec!(ssh_execute_cmd)
65
-
66
- ssh_execute_cmd = "vim-cmd vmsvc/get.summary #{machine.id} 2>/dev/null |"
67
- ssh_execute_cmd << 'grep "uptimeSeconds ="|sed "s/^.*= //g"|sed s/,//g'
68
- uptime = ssh.exec!(ssh_execute_cmd)
69
-
70
- if ( r.length == 0 && uptime.to_i > 120)
71
- ipaddress = r2.strip
72
- else
41
+ if config.saved_ipaddress.nil? or config.local_use_ip_cache == 'False'
42
+ puts "Determine guest IP address." if config.debug =~ %r{ip}i
43
+
44
+ # Figure out vm_ipaddress
45
+ Net::SSH.start(config.esxi_hostname, config.esxi_username,
46
+ password: $esxi_password,
47
+ port: config.esxi_hostport,
48
+ keys: config.local_private_keys,
49
+ timeout: 20,
50
+ number_of_password_prompts: 0,
51
+ non_interactive: true
52
+ ) do |ssh|
53
+
54
+ @logger = Log4r::Logger.new('vagrant_vmware_esxi::action::'\
55
+ 'read_ssh_info-net_ssh')
56
+
57
+ # ugly, but it works...
58
+ # Try to get first interface. This is the prefered method
59
+ # when you have multiple network interfaces
60
+ ssh_execute_cmd = "vim-cmd vmsvc/get.guest #{machine.id} 2>/dev/null |"
61
+ ssh_execute_cmd << 'grep -A 5 "deviceConfigId = 4000" |tail -1|'
62
+ 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])"'
63
+ r = ssh.exec!(ssh_execute_cmd)
73
64
  ipaddress = r.strip
74
- end
75
65
 
76
- if (config.debug =~ %r{ip}i)
77
- puts "ip1 (prim):#{r.strip} ip2 (alt):#{r2.strip} Final: #{ipaddress}"
66
+ # Some OS's don't like above method, so use IP from summary (after 120 seconds uptime)
67
+ r2 = ''
68
+ if r.length == 0
69
+ ssh_execute_cmd = "vim-cmd vmsvc/get.summary #{machine.id} 2>/dev/null |"
70
+ ssh_execute_cmd << 'grep "uptimeSeconds ="|sed "s/^.*= //g"|sed s/,//g'
71
+ uptime = ssh.exec!(ssh_execute_cmd)
72
+ if uptime.to_i > 120
73
+ puts "Get IP alt method, uptime: #{uptime.to_i}" if config.debug =~ %r{ip}i
74
+ ssh_execute_cmd = "vim-cmd vmsvc/get.guest #{machine.id} 2>/dev/null |"
75
+ ssh_execute_cmd << 'grep "^ ipAddress = "|head -1|'
76
+ 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])"'
77
+ r2 = ssh.exec!(ssh_execute_cmd)
78
+ ipaddress = r2.strip
79
+ end
80
+ end
81
+
82
+ puts "ip1 (pri):#{r.strip} ip2 (alt):#{r2.strip}" if config.debug =~ %r{ip}i
83
+
84
+ return nil if (ipaddress == '')
85
+
86
+ config.saved_ipaddress = ipaddress
87
+
88
+ return {
89
+ host: ipaddress,
90
+ port: 22
91
+ }
78
92
  end
79
-
80
- return nil if (ipaddress == '')
93
+ else
94
+ puts "Using cached guest IP address" if config.debug =~ %r{ip}i
95
+ ipaddress = config.saved_ipaddress
81
96
 
82
97
  return {
83
98
  host: ipaddress,
@@ -17,13 +17,48 @@ module VagrantPlugins
17
17
  env[:machine_state] = read_state(env)
18
18
 
19
19
  # Do NFS stuff
20
- if env[:machine_state].to_s.include? "running"
20
+ if (env[:machine_state].to_s.include? "running") && ($nfs_host_ip.nil?)
21
21
  ssh_info = env[:machine].ssh_info
22
22
  if defined?(ssh_info[:host])
23
23
  env[:nfs_machine_ip] = [ssh_info[:host]]
24
- env[:nfs_host_ip] = Socket::getaddrinfo(Socket.gethostname,"echo",Socket::AF_INET)[0][3]
24
+ $nfs_machine_ip = [ssh_info[:host]].dup
25
25
  env[:nfs_valid_ids] = [env[:machine].id]
26
+ $nfs_valid_ids = [env[:machine].id].dup
27
+
28
+ begin
29
+ puts "Get local IP address for NFS. (pri)" if env[:machine].provider_config.debug =~ %r{ip}i
30
+ # 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
+ rescue
33
+ puts "Get local IP address for NFS. (alt)" if env[:machine].provider_config.debug =~ %r{ip}i
34
+ # Alt method. Get list of ip_addresses on system and use the first.
35
+ Socket.ip_address_list.each do |ip|
36
+ if (ip.ip_address =~ /^(\d{1,3}).(\d{1,3}).(\d{1,3}).(\d{1,3})$/) && (ip.ip_address !~ /^127.0.0/)
37
+ env[:nfs_host_ip] = ip.ip_address
38
+ break
39
+ end
40
+ end
41
+ end
42
+
43
+ $nfs_host_ip = env[:nfs_host_ip].dup
44
+ if env[:nfs_host_ip].nil?
45
+ # Something bad happened above. Give up on NFS.
46
+ env[:nfs_machine_ip] = nil
47
+ env[:nfs_host_ip] = nil
48
+ env[:nfs_valid_ids] = nil
49
+ # Give an error, but continue..
50
+ env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
51
+ message: 'Configure NFS : ERROR, Unable to configure NFS on this machine.')
52
+ end
53
+ if (env[:machine].provider_config.debug =~ %r{ip}i) && !env[:nfs_host_ip].nil?
54
+ puts "nfs_host_ip: #{env[:nfs_host_ip]}"
55
+ end
26
56
  end
57
+ else
58
+ # 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
27
62
  end
28
63
 
29
64
  @app.call(env)
@@ -50,9 +85,7 @@ module VagrantPlugins
50
85
  non_interactive: true
51
86
  ) do |ssh|
52
87
 
53
- r = ssh.exec!(
54
- "vim-cmd vmsvc/getallvms|grep -q \"^#{machine.id} \" && "\
55
- "vim-cmd vmsvc/power.getstate #{machine.id} || return 254")
88
+ r = ssh.exec!("vim-cmd vmsvc/power.getstate #{machine.id} || return 254")
56
89
  power_status = r
57
90
 
58
91
  return :not_created if r.exitstatus == 254
@@ -28,12 +28,15 @@ module VagrantPlugins
28
28
  attr_accessor :local_private_keys
29
29
  attr_accessor :local_allow_overwrite
30
30
  attr_accessor :local_lax
31
+ attr_accessor :local_use_ip_cache
31
32
  attr_accessor :local_private_keys_path
32
33
  attr_accessor :debug
33
34
  attr_accessor :supported_guest_virtualhw_versions
34
35
  attr_accessor :supported_guest_disk_types
35
36
  attr_accessor :supported_guest_nic_types
36
37
  attr_accessor :supported_guest_guestos
38
+ attr_accessor :saved_ipaddress
39
+ attr_accessor :saved_ipaddress_count
37
40
 
38
41
  #
39
42
  # legacy (1.x) config entries
@@ -80,7 +83,10 @@ module VagrantPlugins
80
83
  @local_private_keys = nil
81
84
  @local_allow_overwrite = 'False'
82
85
  @local_lax = 'False'
86
+ @local_use_ip_cache = 'True'
83
87
  @debug = 'False'
88
+ @saved_ipaddress = nil
89
+ @saved_ipaddress_count = 0
84
90
  @system_private_keys_path = [
85
91
  '~/.ssh/id_rsa',
86
92
  '~/.ssh/id_ecdsa',
@@ -369,7 +375,12 @@ module VagrantPlugins
369
375
  @local_lax = 'True'
370
376
  else
371
377
  @local_lax = 'False'
378
+ end
372
379
 
380
+ if @local_use_ip_cache =~ /false/i
381
+ @local_use_ip_cache = 'False'
382
+ else
383
+ @local_use_ip_cache = 'True'
373
384
  end
374
385
 
375
386
  if @guest_snapshot_includememory =~ /true/i
@@ -382,6 +393,7 @@ module VagrantPlugins
382
393
  else
383
394
  @guest_snapshot_quiesced = ''
384
395
  end
396
+
385
397
  end
386
398
  end
387
399
  end
@@ -1,7 +1,7 @@
1
1
  # VERSION
2
2
  module VagrantPlugins
3
3
  module ESXi
4
- VERSION = '2.0.2'
4
+ VERSION = '2.0.5'
5
5
  $vagrant_vmware_esxi_version = VERSION
6
6
  end
7
7
  end
@@ -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-02-15'
6
+ s.date = '2018-02-28'
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']
@@ -20,9 +20,13 @@ Gem::Specification.new do |s|
20
20
  s.add_runtime_dependency 'log4r', '~> 1.1'
21
21
  s.add_runtime_dependency "iniparse", '> 1.0'
22
22
  s.add_runtime_dependency "nokogiri", '> 1.5'
23
- s.add_runtime_dependency "net-ssh", '> 3.0'
23
+ #s.add_runtime_dependency "net-ssh", '> 4.0'
24
+ s.add_runtime_dependency 'rbnacl', '>= 3.2', '< 4.0'
25
+ s.add_runtime_dependency 'rbnacl-libsodium'
26
+ s.add_runtime_dependency 'bcrypt_pbkdf', '>= 1.0'
24
27
 
25
- s.add_development_dependency "bundler"
26
- s.add_development_dependency "rspec-core"
28
+ #s.add_development_dependency "bundler"
29
+ #s.add_development_dependency "rspec-core"
27
30
 
28
31
  end
32
+
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.0.2
4
+ version: 2.0.5
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-02-15 00:00:00.000000000 Z
11
+ date: 2018-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -67,27 +67,33 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.5'
69
69
  - !ruby/object:Gem::Dependency
70
- name: net-ssh
70
+ name: rbnacl
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">"
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '3.2'
76
+ - - "<"
74
77
  - !ruby/object:Gem::Version
75
- version: '3.0'
78
+ version: '4.0'
76
79
  type: :runtime
77
80
  prerelease: false
78
81
  version_requirements: !ruby/object:Gem::Requirement
79
82
  requirements:
80
- - - ">"
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '3.2'
86
+ - - "<"
81
87
  - !ruby/object:Gem::Version
82
- version: '3.0'
88
+ version: '4.0'
83
89
  - !ruby/object:Gem::Dependency
84
- name: bundler
90
+ name: rbnacl-libsodium
85
91
  requirement: !ruby/object:Gem::Requirement
86
92
  requirements:
87
93
  - - ">="
88
94
  - !ruby/object:Gem::Version
89
95
  version: '0'
90
- type: :development
96
+ type: :runtime
91
97
  prerelease: false
92
98
  version_requirements: !ruby/object:Gem::Requirement
93
99
  requirements:
@@ -95,19 +101,19 @@ dependencies:
95
101
  - !ruby/object:Gem::Version
96
102
  version: '0'
97
103
  - !ruby/object:Gem::Dependency
98
- name: rspec-core
104
+ name: bcrypt_pbkdf
99
105
  requirement: !ruby/object:Gem::Requirement
100
106
  requirements:
101
107
  - - ">="
102
108
  - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
109
+ version: '1.0'
110
+ type: :runtime
105
111
  prerelease: false
106
112
  version_requirements: !ruby/object:Gem::Requirement
107
113
  requirements:
108
114
  - - ">="
109
115
  - !ruby/object:Gem::Version
110
- version: '0'
116
+ version: '1.0'
111
117
  description: A Vagrant plugin that adds a VMware ESXi provider support
112
118
  email: josenk@jintegrate.co
113
119
  executables: []