vagrant-libvirt 0.6.2 → 0.8.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 +65 -13
- data/lib/vagrant-libvirt/action/cleanup_on_failure.rb +76 -0
- data/lib/vagrant-libvirt/action/create_domain.rb +56 -10
- data/lib/vagrant-libvirt/action/create_network_interfaces.rb +5 -1
- data/lib/vagrant-libvirt/action/create_networks.rb +24 -0
- data/lib/vagrant-libvirt/action/destroy_domain.rb +106 -21
- data/lib/vagrant-libvirt/action/destroy_networks.rb +1 -1
- data/lib/vagrant-libvirt/action/forward_ports.rb +12 -11
- data/lib/vagrant-libvirt/action/handle_box_image.rb +19 -10
- data/lib/vagrant-libvirt/action/prepare_nfs_settings.rb +1 -1
- data/lib/vagrant-libvirt/action/start_domain.rb +36 -0
- data/lib/vagrant-libvirt/action/wait_till_up.rb +6 -32
- data/lib/vagrant-libvirt/action.rb +67 -80
- data/lib/vagrant-libvirt/config.rb +85 -30
- data/lib/vagrant-libvirt/driver.rb +11 -9
- data/lib/vagrant-libvirt/errors.rb +12 -0
- data/lib/vagrant-libvirt/templates/domain.xml.erb +228 -218
- data/lib/vagrant-libvirt/templates/private_network.xml.erb +4 -1
- data/lib/vagrant-libvirt/util/network_util.rb +15 -3
- data/lib/vagrant-libvirt/util/nfs.rb +2 -0
- data/lib/vagrant-libvirt/util/resolvers.rb +80 -0
- data/lib/vagrant-libvirt/version +1 -1
- data/locales/en.yml +21 -0
- data/spec/spec_helper.rb +36 -23
- data/spec/support/libvirt_context.rb +7 -4
- data/spec/support/sharedcontext.rb +1 -1
- data/spec/unit/action/cleanup_on_failure_spec.rb +131 -0
- data/spec/unit/action/create_domain_spec/additional_disks_domain.xml +6 -18
- data/spec/unit/action/create_domain_spec/custom_disk_settings.xml +43 -0
- data/spec/unit/action/create_domain_spec/default_domain.xml +6 -18
- data/spec/unit/action/create_domain_spec/two_disk_settings.xml +49 -0
- data/spec/unit/action/create_domain_spec.rb +51 -7
- data/spec/unit/action/create_domain_volume_spec.rb +5 -3
- data/spec/unit/action/destroy_domain_spec/additional_disks_domain.xml +47 -0
- data/spec/unit/action/destroy_domain_spec/box_multiple_disks.xml +55 -0
- data/spec/unit/action/destroy_domain_spec/box_multiple_disks_and_additional_and_custom_disks.xml +72 -0
- data/spec/unit/action/destroy_domain_spec/box_multiple_disks_and_additional_and_custom_disks_no_aliases.xml +67 -0
- data/spec/unit/action/destroy_domain_spec/box_multiple_disks_and_additional_disks.xml +67 -0
- data/spec/unit/action/destroy_domain_spec/cdrom_domain.xml +48 -0
- data/spec/unit/action/destroy_domain_spec.rb +134 -30
- data/spec/unit/action/forward_ports_spec.rb +10 -2
- data/spec/unit/action/handle_box_image_spec.rb +30 -0
- data/spec/unit/action/prepare_nfs_settings_spec.rb +59 -0
- data/spec/unit/action/shutdown_domain_spec.rb +1 -1
- data/spec/unit/action/start_domain_spec/clock_timer_rtc.xml +6 -18
- data/spec/unit/action/start_domain_spec/default.xml +6 -18
- data/spec/unit/action/start_domain_spec/default_added_tpm_path.xml +6 -18
- data/spec/unit/action/start_domain_spec/default_added_tpm_version.xml +6 -18
- data/spec/unit/action/start_domain_spec/existing.xml +1 -1
- data/spec/unit/action/wait_till_up_spec.rb +4 -43
- data/spec/unit/action_spec.rb +2 -0
- data/spec/unit/config_spec.rb +133 -26
- data/spec/unit/driver_spec.rb +154 -10
- data/spec/unit/provider_spec.rb +11 -0
- data/spec/unit/templates/domain_all_settings.xml +56 -77
- data/spec/unit/templates/domain_cpu_mode_passthrough.xml +39 -0
- data/spec/unit/templates/domain_custom_cpu_model.xml +6 -18
- data/spec/unit/templates/domain_defaults.xml +6 -18
- data/spec/unit/templates/domain_spec.rb +39 -13
- data/spec/unit/templates/tpm/version_1.2.xml +6 -18
- data/spec/unit/templates/tpm/version_2.0.xml +6 -18
- data/spec/unit/util/resolvers_spec.rb +116 -0
- metadata +65 -64
@@ -47,7 +47,7 @@ module VagrantPlugins
|
|
47
47
|
)
|
48
48
|
rescue Libvirt::RetrieveError => e
|
49
49
|
# this network is already destroyed, so move on
|
50
|
-
if e.
|
50
|
+
if e.libvirt_code == ProviderLibvirt::Util::ErrorCodes::VIR_ERR_NO_NETWORK
|
51
51
|
@logger.info 'It is already undefined'
|
52
52
|
next
|
53
53
|
# some other error occured, so raise it again
|
@@ -87,12 +87,13 @@ module VagrantPlugins
|
|
87
87
|
gateway_ports)
|
88
88
|
ssh_info = machine.ssh_info
|
89
89
|
params = %W(
|
90
|
+
-n
|
90
91
|
-L
|
91
92
|
#{host_ip}:#{host_port}:#{guest_ip}:#{guest_port}
|
92
93
|
-N
|
93
94
|
#{ssh_info[:host]}
|
94
|
-
)
|
95
|
-
params += '
|
95
|
+
)
|
96
|
+
params += '-g' if gateway_ports
|
96
97
|
|
97
98
|
options = (%W(
|
98
99
|
User=#{ssh_info[:username]}
|
@@ -105,32 +106,32 @@ module VagrantPlugins
|
|
105
106
|
ForwardX11=#{ssh_info[:forward_x11] ? 'yes' : 'no'}
|
106
107
|
IdentitiesOnly=#{ssh_info[:keys_only] ? 'yes' : 'no'}
|
107
108
|
) + ssh_info[:private_key_path].map do |pk|
|
108
|
-
"IdentityFile
|
109
|
-
end
|
109
|
+
"IdentityFile=\"#{pk}\""
|
110
|
+
end
|
111
|
+
).map { |s| ['-o', s] }.flatten
|
110
112
|
|
111
|
-
options +=
|
113
|
+
options += ['-o', "ProxyCommand=\"#{ssh_info[:proxy_command]}\""] if machine.provider_config.proxy_command
|
114
|
+
|
115
|
+
ssh_cmd = ['ssh'] + options + params
|
112
116
|
|
113
117
|
# TODO: instead of this, try and lock and get the stdin from spawn...
|
114
|
-
ssh_cmd = ''
|
115
118
|
if host_port <= 1024
|
116
119
|
@@lock.synchronize do
|
117
120
|
# TODO: add i18n
|
118
121
|
env[:ui].info 'Requesting sudo for host port(s) <= 1024'
|
119
122
|
r = system('sudo -v')
|
120
123
|
if r
|
121
|
-
ssh_cmd
|
124
|
+
ssh_cmd.unshift('sudo') # add sudo prefix
|
122
125
|
end
|
123
126
|
end
|
124
127
|
end
|
125
128
|
|
126
|
-
|
127
|
-
|
128
|
-
@logger.debug "Forwarding port with `#{ssh_cmd}`"
|
129
|
+
@logger.debug "Forwarding port with `#{ssh_cmd.join(' ')}`"
|
129
130
|
log_file = ssh_forward_log_file(
|
130
131
|
env[:machine], host_ip, host_port, guest_ip, guest_port,
|
131
132
|
)
|
132
133
|
@logger.info "Logging to #{log_file}"
|
133
|
-
spawn(ssh_cmd, [:out, :err] => [log_file, 'w'], :pgroup => true)
|
134
|
+
spawn(*ssh_cmd, [:out, :err] => [log_file, 'w'], :pgroup => true)
|
134
135
|
end
|
135
136
|
|
136
137
|
def ssh_forward_log_file(machine, host_ip, host_port, guest_ip, guest_port)
|
@@ -34,10 +34,11 @@ module VagrantPlugins
|
|
34
34
|
box_format = env[:machine].box.metadata['format']
|
35
35
|
HandleBoxImage.verify_box_format(box_format)
|
36
36
|
|
37
|
+
image_path = HandleBoxImage.get_box_image_path(env[:machine].box, 'box.img')
|
37
38
|
env[:box_volume_number] = 1
|
38
39
|
env[:box_volumes] = [{
|
39
|
-
:path =>
|
40
|
-
:name => HandleBoxImage.get_volume_name(env[:machine].box, 'box'),
|
40
|
+
:path => image_path,
|
41
|
+
:name => HandleBoxImage.get_volume_name(env[:machine].box, 'box', image_path, env[:ui]),
|
41
42
|
:virtual_size => HandleBoxImage.get_virtual_size(env),
|
42
43
|
:format => box_format,
|
43
44
|
}]
|
@@ -58,6 +59,8 @@ module VagrantPlugins
|
|
58
59
|
volume_name = HandleBoxImage.get_volume_name(
|
59
60
|
env[:machine].box,
|
60
61
|
disks[i].fetch('name', disks[i]['path'].sub(/#{File.extname(disks[i]['path'])}$/, '')),
|
62
|
+
image_path,
|
63
|
+
env[:ui],
|
61
64
|
)
|
62
65
|
|
63
66
|
# allowing name means needing to check that it doesn't cause a clash
|
@@ -122,15 +125,21 @@ module VagrantPlugins
|
|
122
125
|
|
123
126
|
protected
|
124
127
|
|
125
|
-
def self.get_volume_name(box, name)
|
128
|
+
def self.get_volume_name(box, name, path, ui)
|
129
|
+
version = begin
|
130
|
+
box.version.to_s
|
131
|
+
rescue
|
132
|
+
''
|
133
|
+
end
|
134
|
+
|
135
|
+
if version.empty?
|
136
|
+
ui.warn(I18n.t('vagrant_libvirt.box_version_missing', name: box.name.to_s))
|
137
|
+
|
138
|
+
version = "0_#{File.mtime(path).to_i}"
|
139
|
+
end
|
140
|
+
|
126
141
|
vol_name = box.name.to_s.dup.gsub('/', '-VAGRANTSLASH-')
|
127
|
-
vol_name << "_vagrant_box_image_#{
|
128
|
-
begin
|
129
|
-
box.version.to_s
|
130
|
-
rescue
|
131
|
-
''
|
132
|
-
end
|
133
|
-
}_#{name.dup.gsub('/', '-SLASH-')}.img"
|
142
|
+
vol_name << "_vagrant_box_image_#{version}_#{name.dup.gsub('/', '-SLASH-')}.img"
|
134
143
|
end
|
135
144
|
|
136
145
|
def self.get_virtual_size(env)
|
@@ -59,7 +59,7 @@ module VagrantPlugins
|
|
59
59
|
command = "ip=$(which ip); ${ip:-/sbin/ip} addr show | grep -i 'inet ' | grep -v '127.0.0.1' | tr -s ' ' | cut -d' ' -f3 | cut -d'/' -f 1"
|
60
60
|
result = ''
|
61
61
|
machine.communicate.execute(command) do |type, data|
|
62
|
-
result
|
62
|
+
result += data if type == :stdout
|
63
63
|
end
|
64
64
|
|
65
65
|
ips = result.chomp.split("\n").uniq
|
@@ -222,6 +222,24 @@ module VagrantPlugins
|
|
222
222
|
graphics.attributes['passwd'] = config.graphics_passwd
|
223
223
|
end
|
224
224
|
end
|
225
|
+
graphics_gl = REXML::XPath.first(xml_descr, '/domain/devices/graphics/gl')
|
226
|
+
if graphics_gl.nil?
|
227
|
+
if config.graphics_gl
|
228
|
+
graphics_gl = REXML::Element.new('gl', REXML::XPath.first(xml_descr, '/domain/devices/graphics'))
|
229
|
+
graphics_gl.attributes['enable'] = 'yes'
|
230
|
+
descr_changed = true
|
231
|
+
end
|
232
|
+
else
|
233
|
+
if config.graphics_gl
|
234
|
+
if graphics_gl.attributes['enable'] != 'yes'
|
235
|
+
graphics_gl.attributes['enable'] = 'yes'
|
236
|
+
descr_changed = true
|
237
|
+
end
|
238
|
+
else
|
239
|
+
graphics_gl.parent.delete_element(graphics_gl)
|
240
|
+
descr_changed = true
|
241
|
+
end
|
242
|
+
end
|
225
243
|
else
|
226
244
|
# graphics_type = none, remove entire element
|
227
245
|
graphics.parent.delete_element(graphics) unless graphics.nil?
|
@@ -280,6 +298,24 @@ module VagrantPlugins
|
|
280
298
|
video_model.attributes['vram'] = config.video_vram
|
281
299
|
end
|
282
300
|
end
|
301
|
+
video_accel = REXML::XPath.first(xml_descr, '/domain/devices/video/model/acceleration')
|
302
|
+
if video_accel.nil?
|
303
|
+
if config.video_accel3d
|
304
|
+
video_accel = REXML::Element.new('acceleration', REXML::XPath.first(xml_descr, '/domain/devices/video/model'))
|
305
|
+
video_accel.attributes['accel3d'] = 'yes'
|
306
|
+
descr_changed = true
|
307
|
+
end
|
308
|
+
else
|
309
|
+
if config.video_accel3d
|
310
|
+
if video_accel.attributes['accel3d'] != 'yes'
|
311
|
+
video_accel.attributes['accel3d'] = 'yes'
|
312
|
+
descr_changed = true
|
313
|
+
end
|
314
|
+
else
|
315
|
+
video_accel.parent.delete_element(video_accel)
|
316
|
+
descr_changed = true
|
317
|
+
end
|
318
|
+
end
|
283
319
|
end
|
284
320
|
|
285
321
|
# Sound device
|
@@ -22,60 +22,34 @@ module VagrantPlugins
|
|
22
22
|
# Initialize metrics if they haven't been
|
23
23
|
env[:metrics] ||= {}
|
24
24
|
|
25
|
-
|
26
|
-
domain =
|
25
|
+
driver = env[:machine].provider.driver
|
26
|
+
domain = driver.get_domain(env[:machine])
|
27
|
+
|
27
28
|
if domain.nil?
|
28
29
|
raise Errors::NoDomainError,
|
29
30
|
error_message: "Domain #{env[:machine].id} not found"
|
30
31
|
end
|
31
32
|
|
32
|
-
# Wait for domain to obtain an ip address. Ip address is searched
|
33
|
-
# from arp table, either locally or remotely via ssh, if Libvirt
|
34
|
-
# connection was done via ssh.
|
35
33
|
env[:ip_address] = nil
|
36
34
|
@logger.debug("Searching for IP for MAC address: #{domain.mac}")
|
37
35
|
env[:ui].info(I18n.t('vagrant_libvirt.waiting_for_ip'))
|
38
36
|
|
37
|
+
# Wait for domain to obtain an ip address. Ip address is searched
|
38
|
+
# from dhcp leases table via libvirt, or via qemu agent if enabled.
|
39
39
|
env[:metrics]['instance_ip_time'] = Util::Timer.time do
|
40
40
|
retryable(on: Fog::Errors::TimeoutError, tries: 300) do
|
41
41
|
# just return if interrupted and let the warden call recover
|
42
42
|
return if env[:interrupted]
|
43
43
|
|
44
44
|
# Wait for domain to obtain an ip address
|
45
|
-
env[:ip_address] =
|
45
|
+
env[:ip_address] = driver.get_domain_ipaddress(env[:machine], domain)
|
46
46
|
end
|
47
47
|
end
|
48
|
-
|
49
48
|
@logger.info("Got IP address #{env[:ip_address]}")
|
50
49
|
@logger.info("Time for getting IP: #{env[:metrics]['instance_ip_time']}")
|
51
50
|
|
52
51
|
@app.call(env)
|
53
52
|
end
|
54
|
-
|
55
|
-
def recover(env)
|
56
|
-
# Undo the import
|
57
|
-
terminate(env)
|
58
|
-
end
|
59
|
-
|
60
|
-
def terminate(env)
|
61
|
-
if env[:machine].state.id != :not_created
|
62
|
-
# If we're not supposed to destroy on error then just return
|
63
|
-
return unless env[:destroy_on_error]
|
64
|
-
|
65
|
-
if env[:halt_on_error]
|
66
|
-
halt_env = env.dup
|
67
|
-
halt_env.delete(:interrupted)
|
68
|
-
halt_env[:config_validate] = false
|
69
|
-
env[:action_runner].run(Action.action_halt, halt_env)
|
70
|
-
else
|
71
|
-
destroy_env = env.dup
|
72
|
-
destroy_env.delete(:interrupted)
|
73
|
-
destroy_env[:config_validate] = false
|
74
|
-
destroy_env[:force_confirm_destroy] = true
|
75
|
-
env[:action_runner].run(Action.action_destroy, destroy_env)
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
53
|
end
|
80
54
|
end
|
81
55
|
end
|
@@ -6,6 +6,58 @@ require 'log4r'
|
|
6
6
|
module VagrantPlugins
|
7
7
|
module ProviderLibvirt
|
8
8
|
module Action
|
9
|
+
action_root = Pathname.new(File.expand_path('../action', __FILE__))
|
10
|
+
autoload :CleanupOnFailure, action_root.join('cleanup_on_failure')
|
11
|
+
autoload :ClearForwardedPorts, action_root.join('forward_ports')
|
12
|
+
autoload :CreateDomain, action_root.join('create_domain')
|
13
|
+
autoload :CreateDomainVolume, action_root.join('create_domain_volume')
|
14
|
+
autoload :CreateNetworkInterfaces, action_root.join('create_network_interfaces')
|
15
|
+
autoload :CreateNetworks, action_root.join('create_networks')
|
16
|
+
autoload :CleanMachineFolder, action_root.join('clean_machine_folder')
|
17
|
+
autoload :DestroyDomain, action_root.join('destroy_domain')
|
18
|
+
autoload :DestroyNetworks, action_root.join('destroy_networks')
|
19
|
+
autoload :ForwardPorts, action_root.join('forward_ports')
|
20
|
+
autoload :HaltDomain, action_root.join('halt_domain')
|
21
|
+
autoload :HandleBoxImage, action_root.join('handle_box_image')
|
22
|
+
autoload :HandleStoragePool, action_root.join('handle_storage_pool')
|
23
|
+
autoload :IsCreated, action_root.join('is_created')
|
24
|
+
autoload :IsRunning, action_root.join('is_running')
|
25
|
+
autoload :IsSuspended, action_root.join('is_suspended')
|
26
|
+
autoload :MessageAlreadyCreated, action_root.join('message_already_created')
|
27
|
+
autoload :MessageNotCreated, action_root.join('message_not_created')
|
28
|
+
autoload :MessageNotRunning, action_root.join('message_not_running')
|
29
|
+
autoload :MessageNotSuspended, action_root.join('message_not_suspended')
|
30
|
+
autoload :MessageWillNotDestroy, action_root.join('message_will_not_destroy')
|
31
|
+
autoload :PackageDomain, action_root.join('package_domain')
|
32
|
+
autoload :PrepareNFSSettings, action_root.join('prepare_nfs_settings')
|
33
|
+
autoload :PrepareNFSValidIds, action_root.join('prepare_nfs_valid_ids')
|
34
|
+
autoload :PruneNFSExports, action_root.join('prune_nfs_exports')
|
35
|
+
autoload :ReadMacAddresses, action_root.join('read_mac_addresses')
|
36
|
+
autoload :RemoveLibvirtImage, action_root.join('remove_libvirt_image')
|
37
|
+
autoload :RemoveStaleVolume, action_root.join('remove_stale_volume')
|
38
|
+
autoload :ResumeDomain, action_root.join('resume_domain')
|
39
|
+
autoload :SetNameOfDomain, action_root.join('set_name_of_domain')
|
40
|
+
autoload :SetBootOrder, action_root.join('set_boot_order')
|
41
|
+
autoload :SetupComplete, action_root.join('cleanup_on_failure')
|
42
|
+
# I don't think we need it anymore
|
43
|
+
autoload :ShareFolders, action_root.join('share_folders')
|
44
|
+
autoload :ShutdownDomain, action_root.join('shutdown_domain')
|
45
|
+
autoload :StartDomain, action_root.join('start_domain')
|
46
|
+
autoload :StartShutdownTimer, action_root.join('shutdown_domain')
|
47
|
+
autoload :SuspendDomain, action_root.join('suspend_domain')
|
48
|
+
autoload :TimedProvision, action_root.join('timed_provision')
|
49
|
+
autoload :WaitTillUp, action_root.join('wait_till_up')
|
50
|
+
|
51
|
+
autoload :HandleBox, 'vagrant/action/builtin/handle_box'
|
52
|
+
autoload :Package, 'vagrant/action/general/package'
|
53
|
+
autoload :PackageSetupFiles, 'vagrant/action/general/package_setup_files'
|
54
|
+
autoload :PackageSetupFolders, 'vagrant/action/general/package_setup_folders'
|
55
|
+
autoload :ProvisionerCleanup, 'vagrant/action/builtin/provisioner_cleanup'
|
56
|
+
autoload :SSHRun, 'vagrant/action/builtin/ssh_run'
|
57
|
+
autoload :SyncedFolderCleanup, 'vagrant/action/builtin/synced_folder_cleanup'
|
58
|
+
autoload :SyncedFolders, 'vagrant/action/builtin/synced_folders'
|
59
|
+
autoload :WaitForCommunicator, 'vagrant/action/builtin/wait_for_communicator'
|
60
|
+
|
9
61
|
# Include the built-in & general modules so we can use them as top-level things.
|
10
62
|
include Vagrant::Action::Builtin
|
11
63
|
include Vagrant::Action::General
|
@@ -24,6 +76,8 @@ module VagrantPlugins
|
|
24
76
|
b.use ConfigValidate
|
25
77
|
b.use BoxCheckOutdated
|
26
78
|
b.use Call, IsCreated do |env, b2|
|
79
|
+
b2.use CleanupOnFailure
|
80
|
+
|
27
81
|
# Create VM if not yet created.
|
28
82
|
if !env[:result]
|
29
83
|
b2.use SetNameOfDomain
|
@@ -31,37 +85,31 @@ module VagrantPlugins
|
|
31
85
|
b2.use CreateDomain
|
32
86
|
b2.use CreateNetworks
|
33
87
|
b2.use CreateNetworkInterfaces
|
34
|
-
|
35
|
-
b2.use
|
88
|
+
|
89
|
+
b2.use action_start
|
90
|
+
|
91
|
+
b2.use SetupComplete
|
36
92
|
else
|
37
93
|
b2.use HandleStoragePool
|
38
94
|
b2.use HandleBox
|
39
95
|
b2.use HandleBoxImage
|
40
96
|
b2.use CreateDomainVolume
|
41
97
|
b2.use CreateDomain
|
42
|
-
|
43
|
-
b2.use Provision
|
44
|
-
b2.use PrepareNFSValidIds
|
45
|
-
b2.use SyncedFolderCleanup
|
46
|
-
b2.use SyncedFolders
|
47
|
-
b2.use PrepareNFSSettings
|
48
|
-
b2.use ShareFolders
|
49
98
|
b2.use CreateNetworks
|
50
99
|
b2.use CreateNetworkInterfaces
|
51
|
-
b2.use SetBootOrder
|
52
100
|
|
53
|
-
b2.use
|
54
|
-
b2.use WaitTillUp
|
55
|
-
b2.use WaitForCommunicator, [:running]
|
101
|
+
b2.use action_start
|
56
102
|
|
57
|
-
b2.use ForwardPorts
|
58
103
|
b2.use SetHostname
|
59
|
-
# b2.use SyncFolders
|
60
104
|
end
|
61
105
|
else
|
62
106
|
env[:halt_on_error] = true
|
107
|
+
b2.use CreateNetworks
|
63
108
|
b2.use action_start
|
64
109
|
end
|
110
|
+
|
111
|
+
# corresponding action to CleanupOnFailure
|
112
|
+
b2.use SetupComplete
|
65
113
|
end
|
66
114
|
end
|
67
115
|
end
|
@@ -82,28 +130,25 @@ module VagrantPlugins
|
|
82
130
|
b2.use Call, IsSuspended do |env2, b3|
|
83
131
|
# if vm is suspended resume it then exit
|
84
132
|
if env2[:result]
|
85
|
-
b3.use CreateNetworks
|
86
133
|
b3.use ResumeDomain
|
87
134
|
next
|
88
135
|
end
|
89
136
|
|
90
137
|
if !env[:machine].config.vm.box
|
91
138
|
# With no box, we just care about network creation and starting it
|
92
|
-
b3.use CreateNetworks
|
93
139
|
b3.use SetBootOrder
|
94
140
|
b3.use StartDomain
|
95
141
|
else
|
96
142
|
# VM is not running or suspended.
|
97
|
-
|
98
143
|
b3.use Provision
|
99
144
|
|
100
|
-
# Ensure networks are created and active
|
101
|
-
b3.use CreateNetworks
|
102
|
-
b3.use SetBootOrder
|
103
|
-
|
104
145
|
b3.use PrepareNFSValidIds
|
105
146
|
b3.use SyncedFolderCleanup
|
106
147
|
b3.use SyncedFolders
|
148
|
+
b3.use PrepareNFSSettings
|
149
|
+
b3.use ShareFolders
|
150
|
+
|
151
|
+
b3.use SetBootOrder
|
107
152
|
|
108
153
|
# Start it..
|
109
154
|
b3.use StartDomain
|
@@ -114,8 +159,6 @@ module VagrantPlugins
|
|
114
159
|
b3.use WaitForCommunicator, [:running]
|
115
160
|
|
116
161
|
b3.use ForwardPorts
|
117
|
-
b3.use PrepareNFSSettings
|
118
|
-
b3.use ShareFolders
|
119
162
|
end
|
120
163
|
end
|
121
164
|
end
|
@@ -264,7 +307,6 @@ module VagrantPlugins
|
|
264
307
|
end
|
265
308
|
|
266
309
|
b3.use Provision
|
267
|
-
# b3.use SyncFolders
|
268
310
|
end
|
269
311
|
end
|
270
312
|
end
|
@@ -342,61 +384,6 @@ module VagrantPlugins
|
|
342
384
|
end
|
343
385
|
end
|
344
386
|
|
345
|
-
action_root = Pathname.new(File.expand_path('../action', __FILE__))
|
346
|
-
autoload :PackageDomain, action_root.join('package_domain')
|
347
|
-
autoload :CreateDomain, action_root.join('create_domain')
|
348
|
-
autoload :CreateDomainVolume, action_root.join('create_domain_volume')
|
349
|
-
autoload :CreateNetworkInterfaces, action_root.join('create_network_interfaces')
|
350
|
-
autoload :CreateNetworks, action_root.join('create_networks')
|
351
|
-
autoload :CleanMachineFolder, action_root.join('clean_machine_folder')
|
352
|
-
autoload :DestroyDomain, action_root.join('destroy_domain')
|
353
|
-
autoload :DestroyNetworks, action_root.join('destroy_networks')
|
354
|
-
autoload :ForwardPorts, action_root.join('forward_ports')
|
355
|
-
autoload :ClearForwardedPorts, action_root.join('forward_ports')
|
356
|
-
autoload :HaltDomain, action_root.join('halt_domain')
|
357
|
-
autoload :StartShutdownTimer, action_root.join('shutdown_domain')
|
358
|
-
autoload :ShutdownDomain, action_root.join('shutdown_domain')
|
359
|
-
autoload :HandleBoxImage, action_root.join('handle_box_image')
|
360
|
-
autoload :HandleStoragePool, action_root.join('handle_storage_pool')
|
361
|
-
autoload :RemoveLibvirtImage, action_root.join('remove_libvirt_image')
|
362
|
-
autoload :IsCreated, action_root.join('is_created')
|
363
|
-
autoload :IsRunning, action_root.join('is_running')
|
364
|
-
autoload :IsSuspended, action_root.join('is_suspended')
|
365
|
-
autoload :MessageAlreadyCreated, action_root.join('message_already_created')
|
366
|
-
autoload :MessageNotCreated, action_root.join('message_not_created')
|
367
|
-
autoload :MessageNotRunning, action_root.join('message_not_running')
|
368
|
-
autoload :MessageNotSuspended, action_root.join('message_not_suspended')
|
369
|
-
autoload :MessageWillNotDestroy, action_root.join('message_will_not_destroy')
|
370
|
-
|
371
|
-
autoload :RemoveStaleVolume, action_root.join('remove_stale_volume')
|
372
|
-
|
373
|
-
autoload :PrepareNFSSettings, action_root.join('prepare_nfs_settings')
|
374
|
-
autoload :PrepareNFSValidIds, action_root.join('prepare_nfs_valid_ids')
|
375
|
-
autoload :PruneNFSExports, action_root.join('prune_nfs_exports')
|
376
|
-
|
377
|
-
autoload :ReadMacAddresses, action_root.join('read_mac_addresses')
|
378
|
-
autoload :ResumeDomain, action_root.join('resume_domain')
|
379
|
-
autoload :SetNameOfDomain, action_root.join('set_name_of_domain')
|
380
|
-
autoload :SetBootOrder, action_root.join('set_boot_order')
|
381
|
-
|
382
|
-
# I don't think we need it anymore
|
383
|
-
autoload :ShareFolders, action_root.join('share_folders')
|
384
|
-
autoload :StartDomain, action_root.join('start_domain')
|
385
|
-
autoload :SuspendDomain, action_root.join('suspend_domain')
|
386
|
-
autoload :TimedProvision, action_root.join('timed_provision')
|
387
|
-
|
388
|
-
autoload :WaitTillUp, action_root.join('wait_till_up')
|
389
|
-
autoload :PrepareNFSValidIds, action_root.join('prepare_nfs_valid_ids')
|
390
|
-
|
391
|
-
autoload :Package, 'vagrant/action/general/package'
|
392
|
-
autoload :PackageSetupFiles, 'vagrant/action/general/package_setup_files'
|
393
|
-
autoload :PackageSetupFolders, 'vagrant/action/general/package_setup_folders'
|
394
|
-
autoload :SSHRun, 'vagrant/action/builtin/ssh_run'
|
395
|
-
autoload :HandleBox, 'vagrant/action/builtin/handle_box'
|
396
|
-
autoload :SyncedFolders, 'vagrant/action/builtin/synced_folders'
|
397
|
-
autoload :SyncedFolderCleanup, 'vagrant/action/builtin/synced_folder_cleanup'
|
398
|
-
autoload :ProvisionerCleanup, 'vagrant/action/builtin/provisioner_cleanup'
|
399
|
-
autoload :WaitForCommunicator, 'vagrant/action/builtin/wait_for_communicator'
|
400
387
|
end
|
401
388
|
end
|
402
389
|
end
|