vagrant-libvirt 0.0.45 → 0.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 +542 -167
- data/lib/vagrant-libvirt/action.rb +2 -2
- data/lib/vagrant-libvirt/action/create_domain.rb +112 -42
- data/lib/vagrant-libvirt/action/create_domain_volume.rb +14 -10
- data/lib/vagrant-libvirt/action/create_network_interfaces.rb +8 -5
- data/lib/vagrant-libvirt/action/create_networks.rb +2 -2
- data/lib/vagrant-libvirt/action/destroy_domain.rb +1 -1
- data/lib/vagrant-libvirt/action/forward_ports.rb +10 -8
- data/lib/vagrant-libvirt/action/halt_domain.rb +1 -1
- data/lib/vagrant-libvirt/action/handle_box_image.rb +28 -60
- data/lib/vagrant-libvirt/action/handle_storage_pool.rb +4 -4
- data/lib/vagrant-libvirt/action/package_domain.rb +64 -12
- data/lib/vagrant-libvirt/action/prepare_nfs_settings.rb +3 -9
- data/lib/vagrant-libvirt/action/prune_nfs_exports.rb +19 -9
- data/lib/vagrant-libvirt/action/remove_libvirt_image.rb +2 -2
- data/lib/vagrant-libvirt/action/remove_stale_volume.rb +17 -11
- data/lib/vagrant-libvirt/action/set_boot_order.rb +2 -2
- data/lib/vagrant-libvirt/action/set_name_of_domain.rb +6 -9
- data/lib/vagrant-libvirt/action/start_domain.rb +87 -30
- data/lib/vagrant-libvirt/action/wait_till_up.rb +10 -32
- data/lib/vagrant-libvirt/cap/public_address.rb +16 -0
- data/lib/vagrant-libvirt/cap/synced_folder.rb +3 -3
- data/lib/vagrant-libvirt/config.rb +294 -42
- data/lib/vagrant-libvirt/driver.rb +49 -34
- data/lib/vagrant-libvirt/errors.rb +5 -5
- data/lib/vagrant-libvirt/plugin.rb +7 -2
- data/lib/vagrant-libvirt/provider.rb +2 -9
- data/lib/vagrant-libvirt/templates/domain.xml.erb +52 -10
- data/lib/vagrant-libvirt/templates/public_interface.xml.erb +5 -1
- data/lib/vagrant-libvirt/util.rb +1 -0
- data/lib/vagrant-libvirt/util/erb_template.rb +6 -7
- data/lib/vagrant-libvirt/util/network_util.rb +6 -1
- data/lib/vagrant-libvirt/util/nfs.rb +17 -0
- data/lib/vagrant-libvirt/util/ui.rb +23 -0
- data/lib/vagrant-libvirt/version +1 -0
- data/lib/vagrant-libvirt/version.rb +72 -1
- data/locales/en.yml +6 -6
- data/spec/spec_helper.rb +28 -2
- data/spec/support/libvirt_context.rb +3 -1
- data/spec/support/sharedcontext.rb +7 -3
- data/spec/unit/action/create_domain_spec.rb +160 -0
- data/spec/unit/action/create_domain_spec/default_system_storage_pool.xml +17 -0
- data/spec/unit/action/create_domain_spec/default_user_storage_pool.xml +17 -0
- data/spec/unit/action/destroy_domain_spec.rb +2 -2
- data/spec/unit/action/set_name_of_domain_spec.rb +3 -3
- data/spec/unit/action/start_domain_spec.rb +231 -0
- data/spec/unit/action/start_domain_spec/clock_timer_rtc.xml +50 -0
- data/spec/unit/action/start_domain_spec/default.xml +48 -0
- data/spec/unit/action/start_domain_spec/default_added_tpm_path.xml +48 -0
- data/spec/unit/action/start_domain_spec/default_added_tpm_version.xml +48 -0
- data/spec/unit/action/wait_till_up_spec.rb +14 -9
- data/spec/unit/config_spec.rb +438 -0
- data/spec/unit/provider_spec.rb +11 -0
- data/spec/unit/templates/domain_all_settings.xml +20 -5
- data/spec/unit/templates/domain_custom_cpu_model.xml +4 -1
- data/spec/unit/templates/domain_defaults.xml +4 -1
- data/spec/unit/templates/domain_spec.rb +92 -4
- data/spec/unit/templates/tpm/version_1.2.xml +54 -0
- data/spec/unit/templates/tpm/version_2.0.xml +53 -0
- metadata +91 -36
- data/.coveralls.yml +0 -1
- data/.github/issue_template.md +0 -37
- data/.gitignore +0 -21
- data/.travis.yml +0 -24
- data/Gemfile +0 -26
- data/Rakefile +0 -8
- data/example_box/README.md +0 -29
- data/example_box/Vagrantfile +0 -60
- data/example_box/metadata.json +0 -5
- data/lib/vagrant-libvirt/templates/default_storage_volume.xml.erb +0 -14
- data/tools/create_box.sh +0 -130
- data/tools/prepare_redhat_for_box.sh +0 -119
- data/vagrant-libvirt.gemspec +0 -51
@@ -19,11 +19,11 @@ module VagrantPlugins
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def connection
|
22
|
-
# If already connected to
|
22
|
+
# If already connected to Libvirt, just use it and don't connect
|
23
23
|
# again.
|
24
24
|
return @@connection if @@connection
|
25
25
|
|
26
|
-
# Get config options for
|
26
|
+
# Get config options for Libvirt provider.
|
27
27
|
config = @machine.provider_config
|
28
28
|
uri = config.uri
|
29
29
|
|
@@ -50,7 +50,7 @@ module VagrantPlugins
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def system_connection
|
53
|
-
# If already connected to
|
53
|
+
# If already connected to Libvirt, just use it and don't connect
|
54
54
|
# again.
|
55
55
|
return @@system_connection if @@system_connection
|
56
56
|
|
@@ -60,12 +60,12 @@ module VagrantPlugins
|
|
60
60
|
@@system_connection
|
61
61
|
end
|
62
62
|
|
63
|
-
def get_domain(
|
63
|
+
def get_domain(machine)
|
64
64
|
begin
|
65
|
-
domain = connection.servers.get(
|
65
|
+
domain = connection.servers.get(machine.id)
|
66
66
|
rescue Libvirt::RetrieveError => e
|
67
67
|
if e.libvirt_code == ProviderLibvirt::Util::ErrorCodes::VIR_ERR_NO_DOMAIN
|
68
|
-
@logger.debug("machine #{
|
68
|
+
@logger.debug("machine #{machine.name} domain not found #{e}.")
|
69
69
|
return nil
|
70
70
|
else
|
71
71
|
raise e
|
@@ -75,34 +75,31 @@ module VagrantPlugins
|
|
75
75
|
domain
|
76
76
|
end
|
77
77
|
|
78
|
-
def created?(
|
79
|
-
domain = get_domain(
|
78
|
+
def created?(machine)
|
79
|
+
domain = get_domain(machine)
|
80
80
|
!domain.nil?
|
81
81
|
end
|
82
82
|
|
83
83
|
def get_ipaddress(machine)
|
84
84
|
# Find the machine
|
85
|
-
domain = get_domain(machine
|
86
|
-
if @machine.provider_config.qemu_use_session
|
87
|
-
return get_ipaddress_system domain.mac
|
88
|
-
end
|
85
|
+
domain = get_domain(machine)
|
89
86
|
|
90
87
|
if domain.nil?
|
91
88
|
# The machine can't be found
|
92
89
|
return nil
|
93
90
|
end
|
94
91
|
|
92
|
+
get_domain_ipaddress(machine, domain)
|
93
|
+
end
|
94
|
+
|
95
|
+
def get_domain_ipaddress(machine, domain)
|
96
|
+
if @machine.provider_config.qemu_use_session
|
97
|
+
return get_ipaddress_from_system domain.mac
|
98
|
+
end
|
99
|
+
|
95
100
|
# Get IP address from arp table
|
96
|
-
ip_address = nil
|
97
101
|
begin
|
98
|
-
domain
|
99
|
-
addresses.each_pair do |_type, ip|
|
100
|
-
# Multiple leases are separated with a newline, return only
|
101
|
-
# the most recent address
|
102
|
-
ip_address = ip[0].split("\n").first unless ip[0].nil?
|
103
|
-
end
|
104
|
-
!ip_address.nil?
|
105
|
-
end
|
102
|
+
ip_address = get_ipaddress_from_domain(domain)
|
106
103
|
rescue Fog::Errors::TimeoutError
|
107
104
|
@logger.info('Timeout at waiting for an ip address for machine %s' % machine.name)
|
108
105
|
end
|
@@ -115,7 +112,24 @@ module VagrantPlugins
|
|
115
112
|
ip_address
|
116
113
|
end
|
117
114
|
|
118
|
-
def
|
115
|
+
def state(machine)
|
116
|
+
# may be other error states with initial retreival we can't handle
|
117
|
+
begin
|
118
|
+
domain = get_domain(machine)
|
119
|
+
rescue Libvirt::RetrieveError => e
|
120
|
+
@logger.debug("Machine #{machine.id} not found #{e}.")
|
121
|
+
return :not_created
|
122
|
+
end
|
123
|
+
|
124
|
+
# TODO: terminated no longer appears to be a valid fog state, remove?
|
125
|
+
return :not_created if domain.nil? || domain.state.to_sym == :terminated
|
126
|
+
|
127
|
+
domain.state.tr('-', '_').to_sym
|
128
|
+
end
|
129
|
+
|
130
|
+
private
|
131
|
+
|
132
|
+
def get_ipaddress_from_system(mac)
|
119
133
|
ip_address = nil
|
120
134
|
|
121
135
|
system_connection.list_all_networks.each do |net|
|
@@ -125,23 +139,24 @@ module VagrantPlugins
|
|
125
139
|
break if ip_address
|
126
140
|
end
|
127
141
|
|
128
|
-
|
142
|
+
ip_address
|
129
143
|
end
|
130
144
|
|
131
|
-
def
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
145
|
+
def get_ipaddress_from_domain(domain)
|
146
|
+
ip_address = nil
|
147
|
+
domain.wait_for(2) do
|
148
|
+
addresses.each_pair do |type, ip|
|
149
|
+
# Multiple leases are separated with a newline, return only
|
150
|
+
# the most recent address
|
151
|
+
ip_address = ip[0].split("\n").first if ip[0] != nil
|
152
|
+
end
|
139
153
|
|
140
|
-
|
141
|
-
|
154
|
+
ip_address != nil
|
155
|
+
end
|
142
156
|
|
143
|
-
|
157
|
+
ip_address
|
144
158
|
end
|
159
|
+
|
145
160
|
end
|
146
161
|
end
|
147
162
|
end
|
@@ -29,14 +29,14 @@ module VagrantPlugins
|
|
29
29
|
error_key(:creating_storage_pool_error)
|
30
30
|
end
|
31
31
|
|
32
|
-
class CreatingVolumeError < VagrantLibvirtError
|
33
|
-
error_key(:creating_volume_error)
|
34
|
-
end
|
35
|
-
|
36
32
|
class ImageUploadError < VagrantLibvirtError
|
37
33
|
error_key(:image_upload_error)
|
38
34
|
end
|
39
35
|
|
36
|
+
class ImageDownloadError < VagrantLibvirtError
|
37
|
+
error_key(:image_download_error)
|
38
|
+
end
|
39
|
+
|
40
40
|
# Box exceptions
|
41
41
|
class NoBoxVolume < VagrantLibvirtError
|
42
42
|
error_key(:no_box_volume)
|
@@ -54,7 +54,7 @@ module VagrantPlugins
|
|
54
54
|
error_key(:wrong_box_format)
|
55
55
|
end
|
56
56
|
|
57
|
-
# Fog
|
57
|
+
# Fog Libvirt exceptions
|
58
58
|
class FogError < VagrantLibvirtError
|
59
59
|
error_key(:fog_error)
|
60
60
|
end
|
@@ -4,7 +4,7 @@ rescue LoadError
|
|
4
4
|
raise 'The Vagrant Libvirt plugin must be run within Vagrant.'
|
5
5
|
end
|
6
6
|
|
7
|
-
# compatibility fix to define constant not available
|
7
|
+
# compatibility fix to define constant not available Vagrant <1.6
|
8
8
|
::Vagrant::MachineState::NOT_CREATED_ID ||= :not_created
|
9
9
|
|
10
10
|
module VagrantPlugins
|
@@ -12,7 +12,7 @@ module VagrantPlugins
|
|
12
12
|
class Plugin < Vagrant.plugin('2')
|
13
13
|
name 'libvirt'
|
14
14
|
description <<-DESC
|
15
|
-
Vagrant plugin to manage VMs in
|
15
|
+
Vagrant plugin to manage VMs in Libvirt.
|
16
16
|
DESC
|
17
17
|
|
18
18
|
config('libvirt', :provider) do
|
@@ -39,6 +39,11 @@ module VagrantPlugins
|
|
39
39
|
Cap::NicMacAddresses
|
40
40
|
end
|
41
41
|
|
42
|
+
provider_capability(:libvirt, :public_address) do
|
43
|
+
require_relative 'cap/public_address'
|
44
|
+
Cap::PublicAddress
|
45
|
+
end
|
46
|
+
|
42
47
|
# lower priority than nfs or rsync
|
43
48
|
# https://github.com/vagrant-libvirt/vagrant-libvirt/pull/170
|
44
49
|
synced_folder('9p', 4) do
|
@@ -68,14 +68,7 @@ module VagrantPlugins
|
|
68
68
|
forward_x11: @machine.config.ssh.forward_x11
|
69
69
|
}
|
70
70
|
|
71
|
-
if @machine.provider_config.
|
72
|
-
ssh_info[:proxy_command] =
|
73
|
-
"ssh '#{@machine.provider_config.host}' " \
|
74
|
-
"-l '#{@machine.provider_config.username}' " \
|
75
|
-
"-i '#{@machine.provider_config.id_ssh_key_file}' " \
|
76
|
-
'nc %h %p'
|
77
|
-
|
78
|
-
end
|
71
|
+
ssh_info[:proxy_command] = @machine.provider_config.proxy_command if @machine.provider_config.proxy_command
|
79
72
|
|
80
73
|
ssh_info
|
81
74
|
end
|
@@ -98,7 +91,7 @@ module VagrantPlugins
|
|
98
91
|
state_id = nil
|
99
92
|
state_id = :not_created unless @machine.id
|
100
93
|
state_id = :not_created if
|
101
|
-
!state_id && (!@machine.id || !driver.created?(@machine
|
94
|
+
!state_id && (!@machine.id || !driver.created?(@machine))
|
102
95
|
# Query the driver for the current state of the machine
|
103
96
|
state_id = driver.state(@machine) if @machine.id && !state_id
|
104
97
|
state_id = :unknown unless state_id
|
@@ -1,8 +1,10 @@
|
|
1
1
|
<domain type='<%= @domain_type %>' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
|
2
2
|
<name><%= @name %></name>
|
3
|
+
<title><%= @title %></title>
|
4
|
+
<description><%= @description %></description>
|
3
5
|
<uuid><%= @uuid %></uuid>
|
4
6
|
<memory><%= @memory_size %></memory>
|
5
|
-
<vcpu
|
7
|
+
<vcpu<% if @cpuset %> cpuset='<%= @cpuset %>'<% end %>><%= @cpus %></vcpu>
|
6
8
|
|
7
9
|
|
8
10
|
<cpu mode='<%= @cpu_mode %>'>
|
@@ -33,6 +35,11 @@
|
|
33
35
|
<% end %>
|
34
36
|
</cpu>
|
35
37
|
|
38
|
+
<%- if @nodeset -%>
|
39
|
+
<numatune>
|
40
|
+
<memory nodeset='<%= @nodeset %>'/>
|
41
|
+
</numatune>
|
42
|
+
<%- end -%>
|
36
43
|
<% unless @memory_backing.empty? %>
|
37
44
|
<memoryBacking>
|
38
45
|
<% @memory_backing.each do |backing| %>
|
@@ -40,6 +47,11 @@
|
|
40
47
|
<% end %>
|
41
48
|
</memoryBacking>
|
42
49
|
<% end%>
|
50
|
+
<% if @shares %>
|
51
|
+
<cputune>
|
52
|
+
<shares><%= @shares %></shares>
|
53
|
+
</cputune>
|
54
|
+
<% end %>
|
43
55
|
|
44
56
|
<os>
|
45
57
|
<% if @machine_type %>
|
@@ -92,14 +104,22 @@
|
|
92
104
|
</hyperv>
|
93
105
|
<% end %>
|
94
106
|
</features>
|
95
|
-
<clock offset='
|
107
|
+
<clock offset='<%= @clock_offset %>'>
|
108
|
+
<% @clock_timers.each do |clock_timer| %>
|
109
|
+
<timer<% clock_timer.each do |attr, value| %> <%= attr %>='<%= value %>'<% end %>/>
|
110
|
+
<% end %>
|
111
|
+
</clock>
|
96
112
|
<devices>
|
97
113
|
<% if @emulator_path %>
|
98
114
|
<emulator><%= @emulator_path %></emulator>
|
99
115
|
<% end %>
|
100
116
|
<% if @domain_volume_path %>
|
101
117
|
<disk type='file' device='disk'>
|
102
|
-
<driver name='qemu' type='qcow2'
|
118
|
+
<driver name='qemu' type='qcow2' <%=
|
119
|
+
@disk_driver_opts.empty? ? "cache='#{@domain_volume_cache}'" :
|
120
|
+
@disk_driver_opts.reject { |k,v| v.nil? }
|
121
|
+
.map { |k,v| "#{k}='#{v}'"}
|
122
|
+
.join(' ') -%>/>
|
103
123
|
<source file='<%= @domain_volume_path %>'/>
|
104
124
|
<%# we need to ensure a unique target dev -%>
|
105
125
|
<target dev='<%= @disk_device %>' bus='<%= @disk_bus %>'/>
|
@@ -108,7 +128,12 @@
|
|
108
128
|
<%# additional disks -%>
|
109
129
|
<% @disks.each do |d| -%>
|
110
130
|
<disk type='file' device='disk'>
|
111
|
-
<driver name='qemu' type='<%= d[:type] %>'
|
131
|
+
<driver name='qemu' type='<%= d[:type] %>' <%=
|
132
|
+
d.select { |k,_| [:cache, :io, :copy_on_read, :discard, :detect_zeroes].include? k }
|
133
|
+
.reject { |k,v| v.nil? }
|
134
|
+
.map { |k,v| "#{k}='#{v}'"}
|
135
|
+
.join(' ')
|
136
|
+
-%>/>
|
112
137
|
<source file='<%= d[:absolute_path] %>'/>
|
113
138
|
<target dev='<%= d[:device] %>' bus='<%= d[:bus] %>'/>
|
114
139
|
<% if d[:shareable] %>
|
@@ -117,7 +142,10 @@
|
|
117
142
|
<% if d[:serial] %>
|
118
143
|
<serial><%= d[:serial] %></serial>
|
119
144
|
<% end %>
|
120
|
-
|
145
|
+
<% if d[:wwn] %>
|
146
|
+
<wwn><%= d[:wwn] %></wwn>
|
147
|
+
<% end %>
|
148
|
+
<%# this will get auto generated by Libvirt
|
121
149
|
<address type='pci' domain='0x0000' bus='0x00' slot='???' function='0x0'/>
|
122
150
|
-%>
|
123
151
|
</disk>
|
@@ -190,7 +218,7 @@
|
|
190
218
|
<% @pcis.each do |pci| %>
|
191
219
|
<hostdev mode='subsystem' type='pci' managed='yes'>
|
192
220
|
<source>
|
193
|
-
<address domain='
|
221
|
+
<address domain='<%= pci[:domain] %>'
|
194
222
|
bus='<%= pci[:bus] %>'
|
195
223
|
slot='<%= pci[:slot] %>'
|
196
224
|
function='<%= pci[:function] %>'/>
|
@@ -242,11 +270,13 @@
|
|
242
270
|
<% end %>
|
243
271
|
<% end -%>
|
244
272
|
|
245
|
-
<% if @tpm_path -%>
|
273
|
+
<% if @tpm_path || @tpm_version -%>
|
246
274
|
<%# TPM Device -%>
|
247
275
|
<tpm model='<%= @tpm_model %>'>
|
248
|
-
<backend type='<%= @tpm_type %>'
|
276
|
+
<backend type='<%= @tpm_type %>'<% if @tpm_version %> version='<%= @tpm_version %>'<% end %>>
|
277
|
+
<% if @tpm_path -%>
|
249
278
|
<device path='<%= @tpm_path %>'/>
|
279
|
+
<% end -%>
|
250
280
|
</backend>
|
251
281
|
</tpm>
|
252
282
|
<% end -%>
|
@@ -254,13 +284,25 @@
|
|
254
284
|
<%# USB Controller -%>
|
255
285
|
<controller type='usb' model='<%= @usbctl_dev[:model] %>' <%= "ports=\"#{@usbctl_dev[:ports]}\" " if @usbctl_dev[:ports] %>/>
|
256
286
|
<% end %>
|
287
|
+
<% unless @memballoon_enabled.nil? %>
|
288
|
+
<% if @memballoon_enabled %>
|
289
|
+
<memballoon model='<%= @memballoon_model %>'>
|
290
|
+
<address type='pci' domain='0x0000' bus='<%= @memballoon_pci_bus %>' slot='<%= @memballoon_pci_slot %>' function='0x0'/>
|
291
|
+
</memballoon>
|
292
|
+
<% else %>
|
293
|
+
<memballoon model='none'/>
|
294
|
+
<% end %>
|
295
|
+
<% end %>
|
257
296
|
</devices>
|
258
297
|
|
259
|
-
<%
|
298
|
+
<% if not @qemu_args.empty? or not @qemu_env.empty? %>
|
260
299
|
<qemu:commandline>
|
261
|
-
<% @
|
300
|
+
<% @qemu_args.each do |arg| %>
|
262
301
|
<qemu:arg value='<%= arg[:value] %>'/>
|
263
302
|
<% end %>
|
303
|
+
<% @qemu_env.each do |env_var, env_value| %>
|
304
|
+
<qemu:env name='<%= env_var.to_s %>' value='<%= env_value %>'/>
|
305
|
+
<% end %>
|
264
306
|
</qemu:commandline>
|
265
307
|
<% end %>
|
266
308
|
</domain>
|
@@ -18,7 +18,11 @@
|
|
18
18
|
<driver name='<%=@driver_name%>'/>
|
19
19
|
<% end %>
|
20
20
|
<% if @ovs %>
|
21
|
-
<virtualport type='openvswitch'
|
21
|
+
<virtualport type='openvswitch'>
|
22
|
+
<% if @ovs_interfaceid %>
|
23
|
+
<parameters interfaceid='<%=@ovs_interfaceid%>'/>
|
24
|
+
<% end %>
|
25
|
+
</virtualport>
|
22
26
|
<% end %>
|
23
27
|
<% if @pci_bus and @pci_slot %>
|
24
28
|
<address type='pci' bus='<%=@pci_bus%>' slot='<%=@pci_slot%>' />
|
data/lib/vagrant-libvirt/util.rb
CHANGED
@@ -1,20 +1,19 @@
|
|
1
|
-
require 'erubis'
|
2
|
-
|
3
1
|
module VagrantPlugins
|
4
2
|
module ProviderLibvirt
|
5
3
|
module Util
|
6
4
|
module ErbTemplate
|
7
5
|
# TODO: remove and use nokogiri builder
|
8
|
-
# TODO: might be a chance to use vagrant template system according to https://github.com/mitchellh/vagrant/issues/3231
|
9
6
|
def to_xml(template_name = nil, data = binding)
|
10
7
|
erb = template_name || self.class.to_s.split('::').last.downcase
|
11
|
-
path = File.join(File.dirname(__FILE__), '..', 'templates'
|
12
|
-
|
13
|
-
template = File.read(path)
|
8
|
+
path = File.join(File.dirname(__FILE__), '..', 'templates')
|
9
|
+
template = "#{erb}.xml"
|
14
10
|
|
15
11
|
# TODO: according to erubis documentation, we should rather use evaluate and forget about
|
16
12
|
# binding since the template may then change variables values
|
17
|
-
|
13
|
+
Vagrant::Util::TemplateRenderer.render_with(:render, template, template_root: path) do |renderer|
|
14
|
+
iv = data.eval ("instance_variables.collect {|i| [i, instance_variable_get(i.to_sym)]}")
|
15
|
+
iv.each {|k, v| renderer.instance_variable_set(k, v)}
|
16
|
+
end
|
18
17
|
end
|
19
18
|
end
|
20
19
|
end
|
@@ -18,6 +18,7 @@ module VagrantPlugins
|
|
18
18
|
management_network_autostart = env[:machine].provider_config.management_network_autostart
|
19
19
|
management_network_pci_bus = env[:machine].provider_config.management_network_pci_bus
|
20
20
|
management_network_pci_slot = env[:machine].provider_config.management_network_pci_slot
|
21
|
+
management_network_domain = env[:machine].provider_config.management_network_domain
|
21
22
|
logger.info "Using #{management_network_name} at #{management_network_address} as the management network #{management_network_mode} is the mode"
|
22
23
|
|
23
24
|
begin
|
@@ -65,6 +66,10 @@ module VagrantPlugins
|
|
65
66
|
management_network_options[:mac] = management_network_mac
|
66
67
|
end
|
67
68
|
|
69
|
+
unless management_network_domain.nil?
|
70
|
+
management_network_options[:domain_name] = management_network_domain
|
71
|
+
end
|
72
|
+
|
68
73
|
unless management_network_pci_bus.nil? and management_network_pci_slot.nil?
|
69
74
|
management_network_options[:bus] = management_network_pci_bus
|
70
75
|
management_network_options[:slot] = management_network_pci_slot
|
@@ -109,7 +114,7 @@ module VagrantPlugins
|
|
109
114
|
networks
|
110
115
|
end
|
111
116
|
|
112
|
-
# Return a list of all (active and inactive)
|
117
|
+
# Return a list of all (active and inactive) Libvirt networks as a list
|
113
118
|
# of hashes with their name, network address and status (active or not)
|
114
119
|
def libvirt_networks(libvirt_client)
|
115
120
|
libvirt_networks = []
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module ProviderLibvirt
|
3
|
+
module Util
|
4
|
+
module Nfs
|
5
|
+
include Vagrant::Action::Builtin::MixinSyncedFolders
|
6
|
+
|
7
|
+
# We're using NFS if we have any synced folder with NFS configured. If
|
8
|
+
# we are not using NFS we don't need to do the extra work to
|
9
|
+
# populate these fields in the environment.
|
10
|
+
def using_nfs?
|
11
|
+
!!synced_folders(@machine)[:nfs]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|