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
@@ -15,7 +15,6 @@ describe VagrantPlugins::ProviderLibvirt::Action::HandleBoxImage do
15
15
  include_context 'unit'
16
16
  include_context 'libvirt'
17
17
 
18
- let(:libvirt_client) { double('libvirt_client') }
19
18
  let(:volumes) { double('volumes') }
20
19
  let(:all) { double('all') }
21
20
  let(:box_volume) { double('box_volume') }
@@ -54,17 +53,13 @@ describe VagrantPlugins::ProviderLibvirt::Action::HandleBoxImage do
54
53
  byte_number_20G = ByteNumber.new(21474836480)
55
54
 
56
55
 
57
-
58
-
59
56
  describe '#call' do
60
57
  before do
61
- allow_any_instance_of(VagrantPlugins::ProviderLibvirt::Driver)
62
- .to receive(:connection).and_return(connection)
63
- allow(connection).to receive(:client).and_return(libvirt_client)
64
58
  allow(connection).to receive(:volumes).and_return(volumes)
65
59
  allow(volumes).to receive(:all).and_return(all)
66
60
  allow(env[:ui]).to receive(:clear_line)
67
61
 
62
+ env[:machine].provider_config.disk_device = 'vda'
68
63
  end
69
64
 
70
65
  context 'when one disk in metadata.json' do
@@ -92,7 +87,8 @@ describe VagrantPlugins::ProviderLibvirt::Action::HandleBoxImage do
92
87
  :path=>"/test/box.img",
93
88
  :name=>"test_vagrant_box_image_1.1.1_box.img",
94
89
  :virtual_size=>byte_number_5G,
95
- :format=>"qcow2"
90
+ :format=>"qcow2",
91
+ :device=>'vda',
96
92
  }
97
93
  ]
98
94
  )
@@ -108,7 +104,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::HandleBoxImage do
108
104
 
109
105
  it 'should use the box file timestamp' do
110
106
  expect(ui).to receive(:warn).with(
111
- "No verison detected for test, using timestamp to watch for modifications. Consider\n" +
107
+ "No version detected for test, using timestamp to watch for modifications. Consider\n" +
112
108
  "generating a local metadata for the box with a version to allow better handling.\n" +
113
109
  'See https://www.vagrantup.com/docs/boxes/format#box-metadata for further details.'
114
110
  )
@@ -121,16 +117,34 @@ describe VagrantPlugins::ProviderLibvirt::Action::HandleBoxImage do
121
117
  :path=>"/test/box.img",
122
118
  :name=>"test_vagrant_box_image_0_#{box_mtime.to_i}_box.img",
123
119
  :virtual_size=>byte_number_5G,
124
- :format=>"qcow2"
120
+ :format=>"qcow2",
121
+ :device=>'vda',
125
122
  }
126
123
  ]
127
124
  )
128
125
  end
129
126
  end
130
127
 
128
+ context 'when box version set to 0' do
129
+ let(:box_mtime) { Time.now }
130
+
131
+ before do
132
+ expect(env[:machine]).to receive_message_chain("box.version") { '0' }
133
+ expect(File).to receive(:mtime).and_return(box_mtime)
134
+ end
135
+
136
+ it 'should use the box file timestamp' do
137
+ expect(ui).to receive(:warn).with(/No version detected for test/)
138
+
139
+ expect(subject.call(env)).to be_nil
140
+ expect(env[:box_volume_number]).to eq(1)
141
+ expect(env[:box_volumes]).to match([hash_including({:name=>"test_vagrant_box_image_0_#{box_mtime.to_i}_box.img"})])
142
+ end
143
+ end
144
+
131
145
  context 'When config.machine_virtual_size is set and smaller than box_virtual_size' do
132
146
  before do
133
- allow(env[:machine]).to receive_message_chain("provider_config.machine_virtual_size").and_return(1)
147
+ env[:machine].provider_config.machine_virtual_size = 1
134
148
  end
135
149
  it 'should warning must be raise' do
136
150
  expect(ui).to receive(:warn).with("Ignoring requested virtual disk size of '1' as it is below\nthe minimum box image size of '5'.")
@@ -141,7 +155,8 @@ describe VagrantPlugins::ProviderLibvirt::Action::HandleBoxImage do
141
155
  :path=>"/test/box.img",
142
156
  :name=>"test_vagrant_box_image_1.1.1_box.img",
143
157
  :virtual_size=>byte_number_5G,
144
- :format=>"qcow2"
158
+ :format=>"qcow2",
159
+ :device=>'vda',
145
160
  }
146
161
  ]
147
162
  )
@@ -150,7 +165,7 @@ describe VagrantPlugins::ProviderLibvirt::Action::HandleBoxImage do
150
165
 
151
166
  context 'When config.machine_virtual_size is set and higher than box_virtual_size' do
152
167
  before do
153
- allow(env[:machine]).to receive_message_chain("provider_config.machine_virtual_size").and_return(20)
168
+ env[:machine].provider_config.machine_virtual_size = 20
154
169
  end
155
170
  it 'should be use' do
156
171
  expect(ui).to receive(:info).with("Created volume larger than box defaults, will require manual resizing of\nfilesystems to utilize.")
@@ -161,7 +176,8 @@ describe VagrantPlugins::ProviderLibvirt::Action::HandleBoxImage do
161
176
  :path=>"/test/box.img",
162
177
  :name=>"test_vagrant_box_image_1.1.1_box.img",
163
178
  :virtual_size=>byte_number_20G,
164
- :format=>"qcow2"
179
+ :format=>"qcow2",
180
+ :device=>'vda',
165
181
  }
166
182
  ]
167
183
  )
@@ -252,7 +268,8 @@ describe VagrantPlugins::ProviderLibvirt::Action::HandleBoxImage do
252
268
  :path=>"/test/box.img",
253
269
  :name=>"test_vagrant_box_image_1.1.1_send_box_name.img",
254
270
  :virtual_size=>byte_number_5G,
255
- :format=>"qcow2"
271
+ :format=>"qcow2",
272
+ :device=>'vda',
256
273
  },
257
274
  {
258
275
  :path=>"/test/disk.qcow2",
@@ -12,8 +12,6 @@ describe VagrantPlugins::ProviderLibvirt::Action::PackageDomain do
12
12
  include_context 'libvirt'
13
13
  include_context 'temporary_dir'
14
14
 
15
- let(:libvirt_client) { double('libvirt_client') }
16
- let(:libvirt_domain) { double('libvirt_domain') }
17
15
  let(:servers) { double('servers') }
18
16
  let(:volumes) { double('volumes') }
19
17
  let(:metadata_file) { double('file') }
@@ -21,9 +19,6 @@ describe VagrantPlugins::ProviderLibvirt::Action::PackageDomain do
21
19
 
22
20
  describe '#call' do
23
21
  before do
24
- allow_any_instance_of(VagrantPlugins::ProviderLibvirt::Driver)
25
- .to receive(:connection).and_return(connection)
26
- allow(connection).to receive(:client).and_return(libvirt_client)
27
22
  allow(libvirt_client).to receive(:lookup_domain_by_uuid).and_return(libvirt_domain)
28
23
 
29
24
  allow(connection).to receive(:servers).and_return(servers)
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+ require 'support/sharedcontext'
5
+
6
+ require 'vagrant-libvirt/action/remove_libvirt_image'
7
+
8
+ describe VagrantPlugins::ProviderLibvirt::Action::RemoveLibvirtImage do
9
+ subject { described_class.new(app, env) }
10
+
11
+ include_context 'unit'
12
+
13
+ let(:box) { instance_double(::Vagrant::Box) }
14
+
15
+ describe '#call' do
16
+ before do
17
+ env[:box_removed] = box
18
+ allow(ui).to receive(:info)
19
+ end
20
+
21
+ context 'when called with libvirt box removed' do
22
+ before do
23
+ expect(box).to receive(:provider).and_return(:libvirt)
24
+ end
25
+
26
+ it 'should notify the user about limited removal' do
27
+ expect(ui).to receive(:info).with(/Vagrant-libvirt plugin removed box/)
28
+ expect(subject.call(env)).to be_nil
29
+ end
30
+ end
31
+
32
+ context 'when called with any other provider box' do
33
+ before do
34
+ expect(box).to receive(:provider).and_return(:virtualbox)
35
+ end
36
+
37
+ it 'call the next middle ware immediately' do
38
+ expect(ui).to_not receive(:info).with(/Vagrant-libvirt plugin removed box/)
39
+ expect(subject.call(env)).to be_nil
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
2
+ <name>vagrant-test_default</name>
3
+ <title></title>
4
+ <description>Source: /rootpath/Vagrantfile</description>
5
+ <uuid></uuid>
6
+ <memory>524288</memory>
7
+ <vcpu>1</vcpu>
8
+ <cpu mode='host-model'>
9
+ <model fallback='allow'></model>
10
+ </cpu>
11
+ <os>
12
+ <type>hvm</type>
13
+ <kernel></kernel>
14
+ <initrd></initrd>
15
+ <cmdline></cmdline>
16
+ </os>
17
+ <features>
18
+ <acpi/>
19
+ <apic/>
20
+ <pae/>
21
+ </features>
22
+ <clock offset='utc'>
23
+ </clock>
24
+ <devices>
25
+ <disk type='file' device='disk'>
26
+ <alias name='ua-box-volume-0'/>
27
+ <driver name='qemu' type='qcow2' cache='default'/>
28
+ <source file='/var/lib/libvirt/images/vagrant-test_default.img'/>
29
+ <target dev='vda' bus='virtio'/>
30
+ </disk>
31
+ <serial type='pty'>
32
+ <target port='0'/>
33
+ </serial>
34
+ <console type='pty'>
35
+ <target port='0'/>
36
+ </console>
37
+ <input type='mouse' bus='ps2'/>
38
+ <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'/>
39
+ <video>
40
+ <model type='cirrus' vram='16384' heads='1'/>
41
+ </video>
42
+ </devices>
43
+ </domain>
@@ -0,0 +1,42 @@
1
+ <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
2
+ <name>vagrant-test_default</name>
3
+ <title></title>
4
+ <description>Source: /rootpath/Vagrantfile</description>
5
+ <uuid></uuid>
6
+ <memory>524288</memory>
7
+ <vcpu>1</vcpu>
8
+ <cpu mode='host-model'>
9
+ <model fallback='allow'></model>
10
+ </cpu>
11
+ <os>
12
+ <type>hvm</type>
13
+ <kernel></kernel>
14
+ <initrd></initrd>
15
+ <cmdline></cmdline>
16
+ </os>
17
+ <features>
18
+ <acpi/>
19
+ <apic/>
20
+ <pae/>
21
+ </features>
22
+ <clock offset='utc'>
23
+ </clock>
24
+ <devices>
25
+ <disk type='file' device='disk'>
26
+ <driver name='qemu' type='qcow2' cache='default'/>
27
+ <source file='/var/lib/libvirt/images/vagrant-test_default.img'/>
28
+ <target dev='vda' bus='virtio'/>
29
+ </disk>
30
+ <serial type='pty'>
31
+ <target port='0'/>
32
+ </serial>
33
+ <console type='pty'>
34
+ <target port='0'/>
35
+ </console>
36
+ <input type='mouse' bus='ps2'/>
37
+ <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'/>
38
+ <video>
39
+ <model type='cirrus' vram='16384' heads='1'/>
40
+ </video>
41
+ </devices>
42
+ </domain>
@@ -0,0 +1,55 @@
1
+ <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
2
+ <name>vagrant-test_default</name>
3
+ <title></title>
4
+ <description>Source: /rootpath/Vagrantfile</description>
5
+ <uuid></uuid>
6
+ <memory>524288</memory>
7
+ <vcpu>1</vcpu>
8
+ <cpu mode='host-model'>
9
+ <model fallback='allow'></model>
10
+ </cpu>
11
+ <os>
12
+ <type>hvm</type>
13
+ <kernel></kernel>
14
+ <initrd></initrd>
15
+ <cmdline></cmdline>
16
+ </os>
17
+ <features>
18
+ <acpi/>
19
+ <apic/>
20
+ <pae/>
21
+ </features>
22
+ <clock offset='utc'>
23
+ </clock>
24
+ <devices>
25
+ <disk type='file' device='disk'>
26
+ <alias name='ua-box-volume-0'/>
27
+ <driver name='qemu' type='qcow2' cache='default'/>
28
+ <source file='/var/lib/libvirt/images/vagrant-test_default.img'/>
29
+ <target dev='vda' bus='virtio'/>
30
+ </disk>
31
+ <disk type='file' device='disk'>
32
+ <alias name='ua-box-volume-1'/>
33
+ <driver name='qemu' type='qcow2' cache='default'/>
34
+ <source file='/var/lib/libvirt/images/vagrant-test_default_1.img'/>
35
+ <target dev='vdb' bus='virtio'/>
36
+ </disk>
37
+ <disk type='file' device='disk'>
38
+ <alias name='ua-box-volume-2'/>
39
+ <driver name='qemu' type='qcow2' cache='default'/>
40
+ <source file='/var/lib/libvirt/images/vagrant-test_default_2.img'/>
41
+ <target dev='vdc' bus='virtio'/>
42
+ </disk>
43
+ <serial type='pty'>
44
+ <target port='0'/>
45
+ </serial>
46
+ <console type='pty'>
47
+ <target port='0'/>
48
+ </console>
49
+ <input type='mouse' bus='ps2'/>
50
+ <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'/>
51
+ <video>
52
+ <model type='cirrus' vram='16384' heads='1'/>
53
+ </video>
54
+ </devices>
55
+ </domain>
@@ -0,0 +1,67 @@
1
+ <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
2
+ <name>vagrant-test_default</name>
3
+ <title></title>
4
+ <description>Source: /rootpath/Vagrantfile</description>
5
+ <uuid></uuid>
6
+ <memory>524288</memory>
7
+ <vcpu>1</vcpu>
8
+ <cpu mode='host-model'>
9
+ <model fallback='allow'></model>
10
+ </cpu>
11
+ <os>
12
+ <type>hvm</type>
13
+ <kernel></kernel>
14
+ <initrd></initrd>
15
+ <cmdline></cmdline>
16
+ </os>
17
+ <features>
18
+ <acpi/>
19
+ <apic/>
20
+ <pae/>
21
+ </features>
22
+ <clock offset='utc'>
23
+ </clock>
24
+ <devices>
25
+ <disk type='file' device='disk'>
26
+ <driver name='qemu' type='qcow2' cache='default'/>
27
+ <source file='/var/lib/libvirt/images/vagrant-test_default.img'/>
28
+ <target dev='vda' bus='virtio'/>
29
+ </disk>
30
+ <disk type='file' device='disk'>
31
+ <driver name='qemu' type='qcow2' cache='default'/>
32
+ <source file='/var/lib/libvirt/images/vagrant-test_default_1.img'/>
33
+ <target dev='vdb' bus='virtio'/>
34
+ </disk>
35
+ <disk type='file' device='disk'>
36
+ <driver name='qemu' type='qcow2' cache='default'/>
37
+ <source file='/var/lib/libvirt/images/vagrant-test_default_2.img'/>
38
+ <target dev='vdc' bus='virtio'/>
39
+ </disk>
40
+ <disk type='file' device='disk'>
41
+ <driver name='qemu' type='qcow2' cache='default'/>
42
+ <source file='/var/lib/libvirt/images/vagrant-test_default-vdd.qcow2'/>
43
+ <target dev='vdd' bus='virtio'/>
44
+ </disk>
45
+ <disk type='file' device='disk'>
46
+ <driver name='qemu' type='qcow2' cache='default'/>
47
+ <source file='/var/lib/libvirt/images/vagrant-test_default-vde.qcow2'/>
48
+ <target dev='vde' bus='virtio'/>
49
+ </disk>
50
+ <disk type='file' device='disk'>
51
+ <driver name='qemu' type='qcow2' cache='default'/>
52
+ <source file='/var/lib/libvirt/images/vagrant-test_default-vdf.qcow2'/>
53
+ <target dev='vdf' bus='virtio'/>
54
+ </disk>
55
+ <serial type='pty'>
56
+ <target port='0'/>
57
+ </serial>
58
+ <console type='pty'>
59
+ <target port='0'/>
60
+ </console>
61
+ <input type='mouse' bus='ps2'/>
62
+ <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'/>
63
+ <video>
64
+ <model type='cirrus' vram='16384' heads='1'/>
65
+ </video>
66
+ </devices>
67
+ </domain>
@@ -0,0 +1,67 @@
1
+ <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
2
+ <name>vagrant-test_default</name>
3
+ <title></title>
4
+ <description>Source: /rootpath/Vagrantfile</description>
5
+ <uuid></uuid>
6
+ <memory>524288</memory>
7
+ <vcpu>1</vcpu>
8
+ <cpu mode='host-model'>
9
+ <model fallback='allow'></model>
10
+ </cpu>
11
+ <os>
12
+ <type>hvm</type>
13
+ <kernel></kernel>
14
+ <initrd></initrd>
15
+ <cmdline></cmdline>
16
+ </os>
17
+ <features>
18
+ <acpi/>
19
+ <apic/>
20
+ <pae/>
21
+ </features>
22
+ <clock offset='utc'>
23
+ </clock>
24
+ <devices>
25
+ <disk type='file' device='disk'>
26
+ <alias name='ua-box-volume-0'/>
27
+ <driver name='qemu' type='qcow2' cache='default'/>
28
+ <source file='/var/lib/libvirt/images/vagrant-test_default.img'/>
29
+ <target dev='vda' bus='virtio'/>
30
+ </disk>
31
+ <disk type='file' device='disk'>
32
+ <alias name='ua-box-volume-1'/>
33
+ <driver name='qemu' type='qcow2' cache='default'/>
34
+ <source file='/var/lib/libvirt/images/vagrant-test_default_1.img'/>
35
+ <target dev='vdb' bus='virtio'/>
36
+ </disk>
37
+ <disk type='file' device='disk'>
38
+ <alias name='ua-box-volume-2'/>
39
+ <driver name='qemu' type='qcow2' cache='default'/>
40
+ <source file='/var/lib/libvirt/images/vagrant-test_default_2.img'/>
41
+ <target dev='vdc' bus='virtio'/>
42
+ </disk>
43
+ <disk type='file' device='disk'>
44
+ <alias name='ua-disk-volume-0'/>
45
+ <driver name='qemu' type='qcow2' cache='default'/>
46
+ <source file='/var/lib/libvirt/images/vagrant-test_default-vdd.qcow2'/>
47
+ <target dev='vdd' bus='virtio'/>
48
+ </disk>
49
+ <disk type='file' device='disk'>
50
+ <alias name='ua-disk-volume-1'/>
51
+ <driver name='qemu' type='qcow2' cache='default'/>
52
+ <source file='/var/lib/libvirt/images/vagrant-test_default-vde.qcow2'/>
53
+ <target dev='vde' bus='virtio'/>
54
+ </disk>
55
+ <serial type='pty'>
56
+ <target port='0'/>
57
+ </serial>
58
+ <console type='pty'>
59
+ <target port='0'/>
60
+ </console>
61
+ <input type='mouse' bus='ps2'/>
62
+ <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'/>
63
+ <video>
64
+ <model type='cirrus' vram='16384' heads='1'/>
65
+ </video>
66
+ </devices>
67
+ </domain>