vagrant-libvirt 0.8.1 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +51 -2076
  3. data/lib/vagrant-libvirt/action/create_domain.rb +57 -94
  4. data/lib/vagrant-libvirt/action/create_network_interfaces.rb +1 -1
  5. data/lib/vagrant-libvirt/action/create_networks.rb +3 -3
  6. data/lib/vagrant-libvirt/action/destroy_domain.rb +21 -5
  7. data/lib/vagrant-libvirt/action/destroy_networks.rb +2 -2
  8. data/lib/vagrant-libvirt/action/handle_box_image.rb +3 -1
  9. data/lib/vagrant-libvirt/action/package_domain.rb +1 -5
  10. data/lib/vagrant-libvirt/action/remove_libvirt_image.rb +3 -1
  11. data/lib/vagrant-libvirt/action/resolve_disk_settings.rb +181 -0
  12. data/lib/vagrant-libvirt/action/snapshot_delete.rb +26 -0
  13. data/lib/vagrant-libvirt/action/snapshot_restore.rb +22 -0
  14. data/lib/vagrant-libvirt/action/snapshot_save.rb +27 -0
  15. data/lib/vagrant-libvirt/action/start_domain.rb +80 -11
  16. data/lib/vagrant-libvirt/action.rb +58 -4
  17. data/lib/vagrant-libvirt/cap/snapshots.rb +12 -0
  18. data/lib/vagrant-libvirt/cap/synced_folder_9p.rb +4 -4
  19. data/lib/vagrant-libvirt/cap/synced_folder_virtiofs.rb +4 -4
  20. data/lib/vagrant-libvirt/config.rb +113 -10
  21. data/lib/vagrant-libvirt/driver.rb +108 -46
  22. data/lib/vagrant-libvirt/errors.rb +23 -3
  23. data/lib/vagrant-libvirt/plugin.rb +7 -3
  24. data/lib/vagrant-libvirt/provider.rb +1 -1
  25. data/lib/vagrant-libvirt/templates/domain.xml.erb +43 -12
  26. data/lib/vagrant-libvirt/util/byte_number.rb +0 -1
  27. data/lib/vagrant-libvirt/util/compat.rb +23 -0
  28. data/lib/vagrant-libvirt/util/domain_flags.rb +15 -0
  29. data/lib/vagrant-libvirt/util/unindent.rb +7 -0
  30. data/lib/vagrant-libvirt/util.rb +1 -0
  31. data/lib/vagrant-libvirt/version +1 -1
  32. data/locales/en.yml +28 -4
  33. data/spec/acceptance/additional_storage_spec.rb +32 -0
  34. data/spec/acceptance/package_domain_spec.rb +90 -0
  35. data/spec/acceptance/provider_settings_spec.rb +54 -0
  36. data/spec/acceptance/simple_vm_provision_via_shell_spec.rb +31 -0
  37. data/spec/acceptance/snapshots_spec.rb +41 -0
  38. data/spec/acceptance/support-skeletons/package_complex/Vagrantfile.testbox +14 -0
  39. data/spec/acceptance/support-skeletons/package_complex/scripts/sysprep.sh +32 -0
  40. data/spec/acceptance/support-skeletons/package_simple/Vagrantfile.testbox +10 -0
  41. data/spec/acceptance/two_disks_spec.rb +29 -0
  42. data/spec/acceptance/use_qemu_agent_for_connectivity_spec.rb +35 -0
  43. data/spec/spec_helper.rb +3 -0
  44. data/spec/support/acceptance/configuration.rb +21 -0
  45. data/spec/support/acceptance/context.rb +70 -0
  46. data/spec/support/acceptance/isolated_environment.rb +41 -0
  47. data/spec/support/libvirt_acceptance_context.rb +64 -0
  48. data/spec/support/libvirt_context.rb +4 -0
  49. data/spec/support/sharedcontext.rb +1 -0
  50. data/spec/unit/action/cleanup_on_failure_spec.rb +0 -2
  51. data/spec/unit/action/create_domain_spec/sysinfo.xml +66 -0
  52. data/spec/unit/action/create_domain_spec/sysinfo_only_required.xml +49 -0
  53. data/spec/unit/action/create_domain_spec.rb +188 -140
  54. data/spec/unit/action/create_domain_volume_spec.rb +0 -3
  55. data/spec/unit/action/destroy_domain_spec.rb +43 -10
  56. data/spec/unit/action/forward_ports_spec.rb +0 -1
  57. data/spec/unit/action/handle_box_image_spec.rb +31 -14
  58. data/spec/unit/action/package_domain_spec.rb +0 -5
  59. data/spec/unit/action/remove_libvirt_image_spec.rb +43 -0
  60. data/spec/unit/action/resolve_disk_settings_spec/default_domain.xml +43 -0
  61. data/spec/unit/action/resolve_disk_settings_spec/default_no_aliases.xml +42 -0
  62. data/spec/unit/action/{create_domain_spec → resolve_disk_settings_spec}/default_system_storage_pool.xml +0 -0
  63. data/spec/unit/action/resolve_disk_settings_spec/multi_volume_box.xml +55 -0
  64. data/spec/unit/action/resolve_disk_settings_spec/multi_volume_box_additional_and_custom_no_aliases.xml +67 -0
  65. data/spec/unit/action/resolve_disk_settings_spec/multi_volume_box_additional_storage.xml +67 -0
  66. data/spec/unit/action/resolve_disk_settings_spec.rb +385 -0
  67. data/spec/unit/action/start_domain_spec/clock_timer_removed.xml +38 -0
  68. data/spec/unit/action/start_domain_spec/clock_timer_rtc_tsc.xml +39 -0
  69. data/spec/unit/action/start_domain_spec/existing_added_nvram.xml +62 -0
  70. data/spec/unit/action/start_domain_spec/nvram_domain.xml +64 -0
  71. data/spec/unit/action/start_domain_spec/nvram_domain_other_setting.xml +64 -0
  72. data/spec/unit/action/start_domain_spec/nvram_domain_removed.xml +64 -0
  73. data/spec/unit/action/start_domain_spec.rb +122 -22
  74. data/spec/unit/action/wait_till_up_spec.rb +0 -2
  75. data/spec/unit/action_spec.rb +88 -3
  76. data/spec/unit/cap/synced_folder_9p_spec.rb +120 -0
  77. data/spec/unit/cap/synced_folder_virtiofs_spec.rb +120 -0
  78. data/spec/unit/config_spec.rb +151 -6
  79. data/spec/unit/driver_spec.rb +3 -1
  80. data/spec/unit/plugin_spec.rb +42 -0
  81. data/spec/unit/templates/domain_all_settings.xml +21 -6
  82. data/spec/unit/templates/domain_scsi_bus_storage.xml +44 -0
  83. data/spec/unit/templates/domain_scsi_device_storage.xml +44 -0
  84. data/spec/unit/templates/domain_scsi_multiple_controllers_storage.xml +130 -0
  85. data/spec/unit/templates/domain_spec.rb +106 -21
  86. data/spec/unit/util/byte_number_spec.rb +1 -1
  87. metadata +169 -79
  88. data/spec/unit/provider_spec.rb +0 -11
@@ -0,0 +1,385 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ require 'fog/libvirt/models/compute/volume'
6
+
7
+ require 'vagrant-libvirt/action/resolve_disk_settings'
8
+
9
+ describe VagrantPlugins::ProviderLibvirt::Action::ResolveDiskSettings do
10
+ subject { described_class.new(app, env) }
11
+
12
+ include_context 'unit'
13
+ include_context 'libvirt'
14
+
15
+ let(:servers) { double('servers') }
16
+ let(:volumes) { double('volumes') }
17
+ let(:domain_volume) { instance_double(::Fog::Libvirt::Compute::Volume) }
18
+ let(:libvirt_storage_pool) { double('storage_pool') }
19
+
20
+ let(:domain_xml) { File.read(File.join(File.dirname(__FILE__), File.basename(__FILE__, '.rb'), domain_xml_file)) }
21
+ let(:storage_pool_xml) do
22
+ File.read(File.join(File.dirname(__FILE__), File.basename(__FILE__, '.rb'), storage_pool_xml_file))
23
+ end
24
+
25
+ before do
26
+ allow(logger).to receive(:info)
27
+ allow(logger).to receive(:debug)
28
+ end
29
+
30
+ describe '#call' do
31
+ before do
32
+ allow(connection).to receive(:volumes).and_return(volumes)
33
+ allow(volumes).to receive(:all).and_return([domain_volume])
34
+ allow(domain_volume).to receive(:pool_name).and_return('default')
35
+ allow(domain_volume).to receive(:path).and_return('/var/lib/libvirt/images/vagrant-test_default.img')
36
+ end
37
+
38
+ context 'when vm box is in use' do
39
+ context 'when box metadata is available' do
40
+ let(:box_volumes) do
41
+ [
42
+ {
43
+ path: '/test/box.img',
44
+ name: 'test_vagrant_box_image_1.1.1_box.img',
45
+ },
46
+ ]
47
+ end
48
+
49
+ before do
50
+ env[:domain_name] = 'vagrant-test_default'
51
+ env[:box_volumes] = box_volumes
52
+ end
53
+
54
+ it 'should populate domain volume' do
55
+ expect(subject.call(env)).to be_nil
56
+ expect(env[:domain_volumes]).to match(
57
+ [
58
+ hash_including(
59
+ device: 'vda',
60
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default.img'
61
+ ),
62
+ ]
63
+ )
64
+ end
65
+
66
+ context 'when additional storage specified' do
67
+ let(:vagrantfile_providerconfig) do
68
+ <<-EOF
69
+ libvirt.storage :file, :size => '20G'
70
+ EOF
71
+ end
72
+
73
+ it 'should use the next device for storage' do
74
+ expect(subject.call(env)).to be_nil
75
+ expect(env[:disks]).to match(
76
+ [
77
+ hash_including(
78
+ device: 'vdb',
79
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default-vdb.qcow2'
80
+ ),
81
+ ]
82
+ )
83
+ end
84
+ end
85
+
86
+ context 'when custom disk device setting' do
87
+ before do
88
+ machine.provider_config.disk_device = 'sda'
89
+ end
90
+
91
+ it 'should set the domain device' do
92
+ expect(subject.call(env)).to be_nil
93
+ expect(env[:domain_volumes]).to match(
94
+ [
95
+ hash_including(
96
+ device: 'sda',
97
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default.img'
98
+ ),
99
+ ]
100
+ )
101
+ end
102
+
103
+ context 'when additional storage specified' do
104
+ let(:vagrantfile_providerconfig) do
105
+ <<-EOF
106
+ libvirt.storage :file, :size => '20G'
107
+ EOF
108
+ end
109
+
110
+ it 'should use the next custom disk device for storage' do
111
+ expect(subject.call(env)).to be_nil
112
+ expect(env[:disks]).to match(
113
+ [
114
+ hash_including(
115
+ device: 'sdb',
116
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default-sdb.qcow2'
117
+ ),
118
+ ]
119
+ )
120
+ end
121
+ end
122
+ end
123
+
124
+ context 'when multiple box volumes' do
125
+ let(:box_volumes) do
126
+ [
127
+ {
128
+ path: '/test/box.img',
129
+ name: 'test_vagrant_box_image_1.1.1_box.img',
130
+ },
131
+ {
132
+ path: '/test/box_2.img',
133
+ name: 'test_vagrant_box_image_1.1.1_box_2.img',
134
+ },
135
+ ]
136
+ end
137
+ it 'should populate all domain volumes' do
138
+ expect(subject.call(env)).to be_nil
139
+ expect(env[:domain_volumes]).to match(
140
+ [
141
+ hash_including(
142
+ device: 'vda',
143
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default.img'
144
+ ),
145
+ hash_including(
146
+ device: 'vdb',
147
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default.img'
148
+ ),
149
+ ]
150
+ )
151
+ end
152
+
153
+ context 'when additional storage specified' do
154
+ let(:vagrantfile_providerconfig) do
155
+ <<-EOF
156
+ libvirt.storage :file, :size => '20G'
157
+ EOF
158
+ end
159
+
160
+ it 'should use the next device for storage' do
161
+ expect(subject.call(env)).to be_nil
162
+ expect(env[:disks]).to match(
163
+ [
164
+ hash_including(
165
+ device: 'vdc',
166
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default-vdc.qcow2'
167
+ ),
168
+ ]
169
+ )
170
+ end
171
+ end
172
+ end
173
+ end
174
+
175
+ context 'when box metadata is not available' do
176
+ let(:domain_xml_file) { 'default_domain.xml' }
177
+
178
+ before do
179
+ expect(libvirt_client).to receive(:lookup_domain_by_uuid).and_return(libvirt_domain)
180
+ expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml)
181
+ end
182
+
183
+ it 'should query the domain xml' do
184
+ expect(subject.call(env)).to be_nil
185
+ expect(env[:domain_volumes]).to match(
186
+ [
187
+ hash_including(
188
+ device: 'vda',
189
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default.img'
190
+ ),
191
+ ]
192
+ )
193
+ end
194
+
195
+ context 'when multiple volumes in domain config' do
196
+ let(:domain_xml_file) { 'multi_volume_box.xml' }
197
+
198
+ it 'should populate domain volumes with devices' do
199
+ expect(subject.call(env)).to be_nil
200
+ expect(env[:domain_volumes]).to match(
201
+ [
202
+ hash_including(
203
+ device: 'vda',
204
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default.img'
205
+ ),
206
+ hash_including(
207
+ device: 'vdb',
208
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default_1.img'
209
+ ),
210
+ hash_including(
211
+ device: 'vdc',
212
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default_2.img'
213
+ ),
214
+ ]
215
+ )
216
+ end
217
+
218
+ context 'when additional storage in domain config' do
219
+ let(:domain_xml_file) { 'multi_volume_box_additional_storage.xml' }
220
+ let(:vagrantfile_providerconfig) do
221
+ <<-EOF
222
+ libvirt.storage :file, :size => '20G'
223
+ libvirt.storage :file, :size => '20G'
224
+ EOF
225
+ end
226
+
227
+ it 'should populate disks with devices' do
228
+ expect(subject.call(env)).to be_nil
229
+ expect(env[:disks]).to match(
230
+ [
231
+ hash_including(
232
+ device: 'vdd',
233
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default-vdd.qcow2'
234
+ ),
235
+ hash_including(
236
+ device: 'vde',
237
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default-vde.qcow2'
238
+ ),
239
+ ]
240
+ )
241
+ end
242
+ end
243
+ end
244
+
245
+ context 'when no aliases available' do
246
+ let(:domain_xml_file) { 'default_no_aliases.xml' }
247
+
248
+ it 'should assume a single box volume' do
249
+ expect(subject.call(env)).to be_nil
250
+ expect(env[:domain_volumes]).to match(
251
+ [
252
+ hash_including(
253
+ device: 'vda',
254
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default.img'
255
+ ),
256
+ ]
257
+ )
258
+ end
259
+
260
+ context 'when additional storage and a custom disk device attached' do
261
+ let(:domain_xml_file) { 'multi_volume_box_additional_and_custom_no_aliases.xml' }
262
+ let(:vagrantfile_providerconfig) do
263
+ <<-EOF
264
+ libvirt.storage :file, :size => '20G'
265
+ libvirt.storage :file, :size => '20G'
266
+ EOF
267
+ end
268
+
269
+ it 'should detect the domain volumes and disks while ignoring the last one' do
270
+ expect(subject.call(env)).to be_nil
271
+ expect(env[:domain_volumes]).to match(
272
+ [
273
+ hash_including(
274
+ device: 'vda',
275
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default.img'
276
+ ),
277
+ hash_including(
278
+ device: 'vdb',
279
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default_1.img'
280
+ ),
281
+ hash_including(
282
+ device: 'vdc',
283
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default_2.img'
284
+ ),
285
+ ]
286
+ )
287
+ expect(env[:disks]).to match(
288
+ [
289
+ hash_including(
290
+ device: 'vdd',
291
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default-vdd.qcow2'
292
+ ),
293
+ hash_including(
294
+ device: 'vde',
295
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default-vde.qcow2'
296
+ ),
297
+ ]
298
+ )
299
+ end
300
+ end
301
+ end
302
+ end
303
+
304
+ context 'no default pool' do
305
+ let(:domain_xml_file) { 'default_domain.xml' }
306
+ let(:vagrantfile) do
307
+ <<-EOF
308
+ Vagrant.configure('2') do |config|
309
+ config.vm.define :test
310
+ end
311
+ EOF
312
+ end
313
+
314
+ it 'should raise an exception' do
315
+ expect(libvirt_client).to receive(:lookup_domain_by_uuid).and_return(libvirt_domain)
316
+ expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml)
317
+ expect(libvirt_client).to receive(:lookup_storage_pool_by_name).and_return(nil)
318
+
319
+ expect { subject.call(env) }.to raise_error(VagrantPlugins::ProviderLibvirt::Errors::NoStoragePool)
320
+ end
321
+ end
322
+ end
323
+
324
+ context 'when no box defined' do
325
+ let(:domain_xml_file) { 'default_domain.xml' }
326
+ let(:storage_pool_xml_file) { 'default_system_storage_pool.xml' }
327
+ let(:vagrantfile) do
328
+ <<-EOF
329
+ Vagrant.configure('2') do |config|
330
+ config.vm.define :test
331
+ config.vm.provider :libvirt do |libvirt|
332
+ libvirt.storage :file, :size => '20G'
333
+ end
334
+ end
335
+ EOF
336
+ end
337
+
338
+ it 'should query for domain name and storage pool path' do
339
+ expect(libvirt_client).to receive(:lookup_domain_by_uuid).and_return(libvirt_domain)
340
+ expect(libvirt_domain).to receive(:xml_desc).and_return(domain_xml)
341
+ expect(libvirt_client).to receive(:lookup_storage_pool_by_name).and_return(libvirt_storage_pool)
342
+ expect(libvirt_storage_pool).to receive(:xml_desc).and_return(storage_pool_xml)
343
+
344
+ expect(subject.call(env)).to be_nil
345
+ expect(env[:disks]).to match(
346
+ [
347
+ hash_including(
348
+ device: 'vda',
349
+ cache: 'default',
350
+ bus: 'virtio',
351
+ path: 'vagrant-test_default-vda.qcow2',
352
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default-vda.qcow2',
353
+ size: '20G',
354
+ pool: 'default'
355
+ ),
356
+ ]
357
+ )
358
+ end
359
+
360
+ context 'when creating using pxe' do
361
+ before do
362
+ env[:domain_name] = 'vagrant-test_default'
363
+ end
364
+
365
+ it 'should not query for domain xml' do
366
+ expect(libvirt_client).to_not receive(:lookup_domain_by_uuid)
367
+ expect(libvirt_client).to receive(:lookup_storage_pool_by_name).and_return(libvirt_storage_pool)
368
+ expect(libvirt_storage_pool).to receive(:xml_desc).and_return(storage_pool_xml)
369
+
370
+ expect(subject.call(env)).to be_nil
371
+ expect(env[:disks]).to match(
372
+ [
373
+ hash_including(
374
+ device: 'vda',
375
+ path: 'vagrant-test_default-vda.qcow2',
376
+ absolute_path: '/var/lib/libvirt/images/vagrant-test_default-vda.qcow2',
377
+ pool: 'default'
378
+ ),
379
+ ]
380
+ )
381
+ end
382
+ end
383
+ end
384
+ end
385
+ end
@@ -0,0 +1,38 @@
1
+ <domain xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0' type=''>
2
+ <name/>
3
+ <title/>
4
+ <description/>
5
+ <uuid/>
6
+ <memory/>
7
+ <vcpu>1</vcpu>
8
+ <cpu mode='host-model'>
9
+ <model fallback='allow'/>
10
+ </cpu>
11
+ <os>
12
+ <type>hvm</type>
13
+ <kernel/>
14
+ <initrd/>
15
+ <cmdline/>
16
+ </os>
17
+ <features>
18
+ <acpi/>
19
+ <apic/>
20
+ <pae/>
21
+ </features>
22
+ <clock offset='utc'>
23
+
24
+ </clock>
25
+ <devices>
26
+ <serial type='pty'>
27
+ <target port='0'/>
28
+ </serial>
29
+ <console type='pty'>
30
+ <target port='0'/>
31
+ </console>
32
+ <input bus='ps2' type='mouse'/>
33
+ <graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'/>
34
+ <video>
35
+ <model heads='1' type='cirrus' vram='16384'/>
36
+ </video>
37
+ </devices>
38
+ </domain>
@@ -0,0 +1,39 @@
1
+ <domain xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0' type=''>
2
+ <name/>
3
+ <title/>
4
+ <description/>
5
+ <uuid/>
6
+ <memory/>
7
+ <vcpu>1</vcpu>
8
+ <cpu mode='host-model'>
9
+ <model fallback='allow'/>
10
+ </cpu>
11
+ <os>
12
+ <type>hvm</type>
13
+ <kernel/>
14
+ <initrd/>
15
+ <cmdline/>
16
+ </os>
17
+ <features>
18
+ <acpi/>
19
+ <apic/>
20
+ <pae/>
21
+ </features>
22
+ <clock offset='utc'>
23
+ <timer name='rtc'/>
24
+ <timer name='tsc'/>
25
+ </clock>
26
+ <devices>
27
+ <serial type='pty'>
28
+ <target port='0'/>
29
+ </serial>
30
+ <console type='pty'>
31
+ <target port='0'/>
32
+ </console>
33
+ <input bus='ps2' type='mouse'/>
34
+ <graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'/>
35
+ <video>
36
+ <model heads='1' type='cirrus' vram='16384'/>
37
+ </video>
38
+ </devices>
39
+ </domain>
@@ -0,0 +1,62 @@
1
+ <domain type='qemu'>
2
+ <name>vagrant-libvirt_default</name>
3
+ <uuid>881a931b-0110-4d10-81aa-47a1a19f5726</uuid>
4
+ <description>Source: /home/test/vagrant-libvirt/Vagrantfile</description>
5
+ <memory unit='KiB'>2097152</memory>
6
+ <currentMemory unit='KiB'>2097152</currentMemory>
7
+ <vcpu placement='static'>2</vcpu>
8
+ <os>
9
+ <type arch='x86_64' machine='pc-i440fx-6.0'>hvm</type><loader type='pflash'>/path/to/loader/file</loader><nvram>/path/to/nvram/file</nvram>
10
+ <boot dev='hd'/>
11
+ </os>
12
+ <features>
13
+ <acpi/>
14
+ <apic/>
15
+ <pae/>
16
+ </features>
17
+ <cpu check='partial' mode='host-model'/>
18
+ <clock offset='utc'/>
19
+ <on_poweroff>destroy</on_poweroff>
20
+ <on_reboot>restart</on_reboot>
21
+ <on_crash>destroy</on_crash>
22
+ <devices>
23
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
24
+ <disk device='disk' type='file'>
25
+ <driver name='qemu' type='qcow2'/>
26
+ <source file='/var/lib/libvirt/images/vagrant-libvirt_default.img'/>
27
+ <target bus='virtio' dev='vda'/>
28
+ <address bus='0x00' domain='0x0000' function='0x0' slot='0x03' type='pci'/>
29
+ </disk>
30
+ <controller index='0' model='piix3-uhci' type='usb'>
31
+ <address bus='0x00' domain='0x0000' function='0x2' slot='0x01' type='pci'/>
32
+ </controller>
33
+ <controller index='0' model='pci-root' type='pci'/>
34
+ <interface type='network'>
35
+ <mac address='52:54:00:7d:14:0e'/>
36
+ <source network='vagrant-libvirt'/>
37
+ <model type='virtio'/>
38
+ <address bus='0x00' domain='0x0000' function='0x0' slot='0x05' type='pci'/>
39
+ </interface>
40
+ <serial type='pty'>
41
+ <target port='0' type='isa-serial'>
42
+ <model name='isa-serial'/>
43
+ </target>
44
+ </serial>
45
+ <console type='pty'>
46
+ <target port='0' type='serial'/>
47
+ </console>
48
+ <input bus='ps2' type='mouse'/>
49
+ <input bus='ps2' type='keyboard'/>
50
+ <graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'>
51
+ <listen address='127.0.0.1' type='address'/>
52
+ </graphics>
53
+ <audio id='1' type='none'/>
54
+ <video>
55
+ <model heads='1' primary='yes' type='cirrus' vram='16384'/>
56
+ <address bus='0x00' domain='0x0000' function='0x0' slot='0x02' type='pci'/>
57
+ </video>
58
+ <memballoon model='virtio'>
59
+ <address bus='0x00' domain='0x0000' function='0x0' slot='0x04' type='pci'/>
60
+ </memballoon>
61
+ </devices>
62
+ </domain>
@@ -0,0 +1,64 @@
1
+ <domain type='qemu'>
2
+ <name>vagrant-libvirt_default</name>
3
+ <uuid>881a931b-0110-4d10-81aa-47a1a19f5726</uuid>
4
+ <description>Source: /home/test/vagrant-libvirt/Vagrantfile</description>
5
+ <memory unit='KiB'>2097152</memory>
6
+ <currentMemory unit='KiB'>2097152</currentMemory>
7
+ <vcpu placement='static'>2</vcpu>
8
+ <os>
9
+ <type arch='x86_64' machine='pc-i440fx-6.0'>hvm</type>
10
+ <loader type='pflash'>/path/to/loader/file</loader>
11
+ <nvram>/path/to/nvram/file</nvram>
12
+ <boot dev='hd'/>
13
+ </os>
14
+ <features>
15
+ <acpi/>
16
+ <apic/>
17
+ <pae/>
18
+ </features>
19
+ <cpu mode='host-model' check='partial'/>
20
+ <clock offset='utc'/>
21
+ <on_poweroff>destroy</on_poweroff>
22
+ <on_reboot>restart</on_reboot>
23
+ <on_crash>destroy</on_crash>
24
+ <devices>
25
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
26
+ <disk type='file' device='disk'>
27
+ <driver name='qemu' type='qcow2'/>
28
+ <source file='/var/lib/libvirt/images/vagrant-libvirt_default.img'/>
29
+ <target dev='vda' bus='virtio'/>
30
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
31
+ </disk>
32
+ <controller type='usb' index='0' model='piix3-uhci'>
33
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
34
+ </controller>
35
+ <controller type='pci' index='0' model='pci-root'/>
36
+ <interface type='network'>
37
+ <mac address='52:54:00:7d:14:0e'/>
38
+ <source network='vagrant-libvirt'/>
39
+ <model type='virtio'/>
40
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
41
+ </interface>
42
+ <serial type='pty'>
43
+ <target type='isa-serial' port='0'>
44
+ <model name='isa-serial'/>
45
+ </target>
46
+ </serial>
47
+ <console type='pty'>
48
+ <target type='serial' port='0'/>
49
+ </console>
50
+ <input type='mouse' bus='ps2'/>
51
+ <input type='keyboard' bus='ps2'/>
52
+ <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'>
53
+ <listen type='address' address='127.0.0.1'/>
54
+ </graphics>
55
+ <audio id='1' type='none'/>
56
+ <video>
57
+ <model type='cirrus' vram='16384' heads='1' primary='yes'/>
58
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
59
+ </video>
60
+ <memballoon model='virtio'>
61
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
62
+ </memballoon>
63
+ </devices>
64
+ </domain>
@@ -0,0 +1,64 @@
1
+ <domain type='qemu'>
2
+ <name>vagrant-libvirt_default</name>
3
+ <uuid>881a931b-0110-4d10-81aa-47a1a19f5726</uuid>
4
+ <description>Source: /home/test/vagrant-libvirt/Vagrantfile</description>
5
+ <memory unit='KiB'>2097152</memory>
6
+ <currentMemory unit='KiB'>2097152</currentMemory>
7
+ <vcpu placement='static'>2</vcpu>
8
+ <os>
9
+ <type arch='x86_64' machine='pc-i440fx-6.0'>hvm</type>
10
+ <loader type='pflash'>/path/to/loader/file</loader>
11
+ <nvram>/path/to/nvram/file1</nvram>
12
+ <boot dev='hd'/>
13
+ </os>
14
+ <features>
15
+ <acpi/>
16
+ <apic/>
17
+ <pae/>
18
+ </features>
19
+ <cpu check='partial' mode='host-model'/>
20
+ <clock offset='utc'/>
21
+ <on_poweroff>destroy</on_poweroff>
22
+ <on_reboot>restart</on_reboot>
23
+ <on_crash>destroy</on_crash>
24
+ <devices>
25
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
26
+ <disk device='disk' type='file'>
27
+ <driver name='qemu' type='qcow2'/>
28
+ <source file='/var/lib/libvirt/images/vagrant-libvirt_default.img'/>
29
+ <target bus='virtio' dev='vda'/>
30
+ <address bus='0x00' domain='0x0000' function='0x0' slot='0x03' type='pci'/>
31
+ </disk>
32
+ <controller index='0' model='piix3-uhci' type='usb'>
33
+ <address bus='0x00' domain='0x0000' function='0x2' slot='0x01' type='pci'/>
34
+ </controller>
35
+ <controller index='0' model='pci-root' type='pci'/>
36
+ <interface type='network'>
37
+ <mac address='52:54:00:7d:14:0e'/>
38
+ <source network='vagrant-libvirt'/>
39
+ <model type='virtio'/>
40
+ <address bus='0x00' domain='0x0000' function='0x0' slot='0x05' type='pci'/>
41
+ </interface>
42
+ <serial type='pty'>
43
+ <target port='0' type='isa-serial'>
44
+ <model name='isa-serial'/>
45
+ </target>
46
+ </serial>
47
+ <console type='pty'>
48
+ <target port='0' type='serial'/>
49
+ </console>
50
+ <input bus='ps2' type='mouse'/>
51
+ <input bus='ps2' type='keyboard'/>
52
+ <graphics autoport='yes' keymap='en-us' listen='127.0.0.1' port='-1' type='vnc'>
53
+ <listen address='127.0.0.1' type='address'/>
54
+ </graphics>
55
+ <audio id='1' type='none'/>
56
+ <video>
57
+ <model heads='1' primary='yes' type='cirrus' vram='16384'/>
58
+ <address bus='0x00' domain='0x0000' function='0x0' slot='0x02' type='pci'/>
59
+ </video>
60
+ <memballoon model='virtio'>
61
+ <address bus='0x00' domain='0x0000' function='0x0' slot='0x04' type='pci'/>
62
+ </memballoon>
63
+ </devices>
64
+ </domain>