vagrant-vmware-esxi 1.5.0 → 1.5.1
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/ESXi_guestos_types.md +68 -0
- data/README.md +83 -67
- data/example_box/Vagrantfile +53 -41
- data/example_box/Vagrantfile-multimachine +10 -13
- data/lib/vagrant-vmware-esxi/action/boot.rb +1 -1
- data/lib/vagrant-vmware-esxi/action/createvm.rb +83 -41
- data/lib/vagrant-vmware-esxi/action/destroy.rb +1 -1
- data/lib/vagrant-vmware-esxi/action/esxi_password.rb +29 -28
- data/lib/vagrant-vmware-esxi/action/halt.rb +3 -4
- data/lib/vagrant-vmware-esxi/action/read_ssh_info.rb +1 -1
- data/lib/vagrant-vmware-esxi/action/read_state.rb +1 -1
- data/lib/vagrant-vmware-esxi/action/resume.rb +1 -1
- data/lib/vagrant-vmware-esxi/action/set_network_ip.rb +8 -8
- data/lib/vagrant-vmware-esxi/action/snapshot_delete.rb +1 -1
- data/lib/vagrant-vmware-esxi/action/snapshot_info.rb +3 -3
- data/lib/vagrant-vmware-esxi/action/snapshot_list.rb +1 -1
- data/lib/vagrant-vmware-esxi/action/snapshot_restore.rb +3 -3
- data/lib/vagrant-vmware-esxi/action/snapshot_save.rb +4 -5
- data/lib/vagrant-vmware-esxi/action/suspend.rb +3 -3
- data/lib/vagrant-vmware-esxi/config.rb +6 -0
- data/lib/vagrant-vmware-esxi/version.rb +2 -1
- data/vagrant-vmware-esxi.gemspec +1 -1
- metadata +3 -2
@@ -36,7 +36,7 @@ module VagrantPlugins
|
|
36
36
|
" #{env[:machine_state]}")
|
37
37
|
|
38
38
|
# Figure out vm_ipaddress
|
39
|
-
Net::SSH.start(
|
39
|
+
Net::SSH.start(config.esxi_hostname, config.esxi_username,
|
40
40
|
password: $esxi_password,
|
41
41
|
port: config.esxi_hostport,
|
42
42
|
keys: config.esxi_private_keys,
|
@@ -41,7 +41,7 @@ module VagrantPlugins
|
|
41
41
|
@logger.info("vagrant-vmware-esxi, read_state: machine id: #{machine.id}")
|
42
42
|
@logger.info("vagrant-vmware-esxi, read_state: current state: #{env[:machine_state]}")
|
43
43
|
|
44
|
-
Net::SSH.start(
|
44
|
+
Net::SSH.start(config.esxi_hostname, config.esxi_username,
|
45
45
|
password: $esxi_password,
|
46
46
|
port: config.esxi_hostport,
|
47
47
|
keys: config.esxi_private_keys,
|
@@ -38,7 +38,7 @@ module VagrantPlugins
|
|
38
38
|
message: 'Attempting to resume')
|
39
39
|
|
40
40
|
#
|
41
|
-
Net::SSH.start(
|
41
|
+
Net::SSH.start(config.esxi_hostname, config.esxi_username,
|
42
42
|
password: $esxi_password,
|
43
43
|
port: config.esxi_hostport,
|
44
44
|
keys: config.esxi_private_keys,
|
@@ -44,7 +44,7 @@ module VagrantPlugins
|
|
44
44
|
#
|
45
45
|
vm_network = []
|
46
46
|
env[:machine].config.vm.networks.each do |type, options|
|
47
|
-
#
|
47
|
+
# I only handle private and public networks
|
48
48
|
next if type != :private_network && type != :public_network
|
49
49
|
next if vm_network.count >= number_of_adapters
|
50
50
|
vm_network << options
|
@@ -56,7 +56,7 @@ module VagrantPlugins
|
|
56
56
|
end
|
57
57
|
|
58
58
|
networks_to_configure = []
|
59
|
-
if (number_of_adapters > 1
|
59
|
+
if (number_of_adapters > 1) and (vm_network.count > 0)
|
60
60
|
1.upto(number_of_adapters - 1) do |index|
|
61
61
|
if !vm_network[index - 1].nil?
|
62
62
|
options = vm_network[index - 1]
|
@@ -64,11 +64,11 @@ module VagrantPlugins
|
|
64
64
|
if options[:ip]
|
65
65
|
ip_class = options[:ip].gsub(/\..*$/,'').to_i
|
66
66
|
if ip_class < 127
|
67
|
-
class_netmask =
|
67
|
+
class_netmask = '255.0.0.0'
|
68
68
|
elsif ip_class > 127 and ip_class < 192
|
69
|
-
class_netmask =
|
69
|
+
class_netmask = '255.255.0.0'
|
70
70
|
elsif ip_class >= 192 and ip_class <= 223
|
71
|
-
class_netmask =
|
71
|
+
class_netmask = '255.255.255.0'
|
72
72
|
end
|
73
73
|
|
74
74
|
# if netmask is not specified or is invalid, use, class defaults
|
@@ -79,7 +79,7 @@ module VagrantPlugins
|
|
79
79
|
end
|
80
80
|
unless netmask =~ /^(((128|192|224|240|248|252|254)\.0\.0\.0)|(255\.(0|128|192|224|240|248|252|254)\.0\.0)|(255\.255\.(0|128|192|224|240|248|252|254)\.0)|(255\.255\.255\.(0|128|192|224|240|248|252|254)))$/i
|
81
81
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
82
|
-
message: "WARNING:
|
82
|
+
message: "WARNING : Invalid netmask specified, using Class mask (#{class_netmask})")
|
83
83
|
netmask = class_netmask
|
84
84
|
end
|
85
85
|
network = {
|
@@ -91,7 +91,7 @@ module VagrantPlugins
|
|
91
91
|
netmask: netmask,
|
92
92
|
gateway: options[:gateway]
|
93
93
|
}
|
94
|
-
ip_msg = options[:ip]
|
94
|
+
ip_msg = options[:ip] + '/'
|
95
95
|
else
|
96
96
|
network = {
|
97
97
|
interface: index,
|
@@ -104,7 +104,7 @@ module VagrantPlugins
|
|
104
104
|
end
|
105
105
|
networks_to_configure << network
|
106
106
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
107
|
-
message: "Configuring: #{ip_msg}
|
107
|
+
message: "Configuring : #{ip_msg}#{netmask} on #{config.virtual_network[index]}")
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
@@ -34,7 +34,7 @@ module VagrantPlugins
|
|
34
34
|
message: 'Attempting to snapshot_delete')
|
35
35
|
|
36
36
|
#
|
37
|
-
Net::SSH.start(
|
37
|
+
Net::SSH.start(config.esxi_hostname, config.esxi_username,
|
38
38
|
password: $esxi_password,
|
39
39
|
port: config.esxi_hostport,
|
40
40
|
keys: config.esxi_private_keys,
|
@@ -27,11 +27,11 @@ module VagrantPlugins
|
|
27
27
|
@logger.info("vagrant-vmware-esxi, snapshot_info: current state: #{env[:machine_state]}")
|
28
28
|
|
29
29
|
if env[:machine_state].to_s == 'not_created'
|
30
|
-
|
31
|
-
|
30
|
+
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
31
|
+
message: 'Cannot snapshot_info in this state')
|
32
32
|
else
|
33
33
|
|
34
|
-
Net::SSH.start(
|
34
|
+
Net::SSH.start(config.esxi_hostname, config.esxi_username,
|
35
35
|
password: $esxi_password,
|
36
36
|
port: config.esxi_hostport,
|
37
37
|
keys: config.esxi_private_keys,
|
@@ -31,7 +31,7 @@ module VagrantPlugins
|
|
31
31
|
message: 'Cannot snapshot_list in this state')
|
32
32
|
else
|
33
33
|
|
34
|
-
Net::SSH.start(
|
34
|
+
Net::SSH.start(config.esxi_hostname, config.esxi_username,
|
35
35
|
password: $esxi_password,
|
36
36
|
port: config.esxi_hostport,
|
37
37
|
keys: config.esxi_private_keys,
|
@@ -27,14 +27,14 @@ module VagrantPlugins
|
|
27
27
|
@logger.info("vagrant-vmware-esxi, snapshot_restore: current state: #{env[:machine_state]}")
|
28
28
|
|
29
29
|
if env[:machine_state].to_s == 'not_created'
|
30
|
-
|
31
|
-
|
30
|
+
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
31
|
+
message: 'Cannot snapshot_restore in this state')
|
32
32
|
else
|
33
33
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
34
34
|
message: 'Attempting to snapshot_restore')
|
35
35
|
|
36
36
|
#
|
37
|
-
Net::SSH.start(
|
37
|
+
Net::SSH.start(config.esxi_hostname, config.esxi_username,
|
38
38
|
password: $esxi_password,
|
39
39
|
port: config.esxi_hostport,
|
40
40
|
keys: config.esxi_private_keys,
|
@@ -27,14 +27,14 @@ module VagrantPlugins
|
|
27
27
|
@logger.info("vagrant-vmware-esxi, snapshot_save: current state: #{env[:machine_state]}")
|
28
28
|
|
29
29
|
if env[:machine_state].to_s == 'not_created'
|
30
|
-
|
31
|
-
|
30
|
+
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
31
|
+
message: 'Cannot snapshot_save in this state')
|
32
32
|
else
|
33
33
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
34
34
|
message: 'Attempting to snapshot_save')
|
35
35
|
|
36
36
|
#
|
37
|
-
Net::SSH.start(
|
37
|
+
Net::SSH.start(config.esxi_hostname, config.esxi_username,
|
38
38
|
password: $esxi_password,
|
39
39
|
port: config.esxi_hostport,
|
40
40
|
keys: config.esxi_private_keys,
|
@@ -46,8 +46,7 @@ module VagrantPlugins
|
|
46
46
|
) do |ssh|
|
47
47
|
|
48
48
|
puts "machine id: #{machine.id} snapshot name: #{env[:snapshot_name]}"
|
49
|
-
r = ssh.exec!(
|
50
|
-
"vim-cmd vmsvc/snapshot.create #{machine.id} \"#{env[:snapshot_name]}\"")
|
49
|
+
r = ssh.exec!("vim-cmd vmsvc/snapshot.create #{machine.id} \"#{env[:snapshot_name]}\"")
|
51
50
|
|
52
51
|
if r.exitstatus != 0
|
53
52
|
raise Errors::ESXiError,
|
@@ -30,14 +30,14 @@ module VagrantPlugins
|
|
30
30
|
env[:ui].info I18n.t('vagrant_vmware_esxi.already_suspended')
|
31
31
|
elsif (env[:machine_state].to_s == 'powered_off') ||
|
32
32
|
(env[:machine_state].to_s == 'not_created')
|
33
|
-
|
34
|
-
|
33
|
+
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
34
|
+
message: 'Cannot suspend in this state')
|
35
35
|
else
|
36
36
|
env[:ui].info I18n.t('vagrant_vmware_esxi.vagrant_vmware_esxi_message',
|
37
37
|
message: 'Attempting to suspend')
|
38
38
|
|
39
39
|
#
|
40
|
-
Net::SSH.start(
|
40
|
+
Net::SSH.start(config.esxi_hostname, config.esxi_username,
|
41
41
|
password: $esxi_password,
|
42
42
|
port: config.esxi_hostport,
|
43
43
|
keys: config.esxi_private_keys,
|
@@ -235,6 +235,12 @@ module VagrantPlugins
|
|
235
235
|
def finalize!
|
236
236
|
@private_key_path = nil if @private_key_path == UNSET_VALUE
|
237
237
|
@ssh_username = nil if @ssh_username == UNSET_VALUE
|
238
|
+
if @virtual_network.is_a? String
|
239
|
+
@virtual_network = [@virtual_network]
|
240
|
+
end
|
241
|
+
if @virtual_network.nil?
|
242
|
+
@virtual_network = ['--NotSet--']
|
243
|
+
end
|
238
244
|
@esxi_private_keys = @system_private_keys_path if @esxi_private_keys == UNSET_VALUE
|
239
245
|
if @lax =~ /true/i
|
240
246
|
@lax = 'True'
|
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-01-
|
6
|
+
s.date = '2018-01-30'
|
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: 1.5.
|
4
|
+
version: 1.5.1
|
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-01-
|
11
|
+
date: 2018-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -114,6 +114,7 @@ executables: []
|
|
114
114
|
extensions: []
|
115
115
|
extra_rdoc_files: []
|
116
116
|
files:
|
117
|
+
- ESXi_guestos_types.md
|
117
118
|
- Gemfile
|
118
119
|
- LICENSE
|
119
120
|
- README.md
|