2011-08-03 06:48:44 -04:00
<domain type='<%= domain_type %>'>
<name><%= name %></name>
<memory><%= memory_size %></memory>
<vcpu><%= cpus %></vcpu>
<os>
2011-08-09 17:03:40 -04:00
<type arch='<%= arch %>'><%= os_type %></type>
2012-04-04 08:36:15 -04:00
<% boot_order.each do |dev| -%>
<boot dev='<%= dev %>'/>
2012-04-04 08:03:17 -04:00
<% end -%>
2011-08-09 17:03:40 -04:00
</os>
2011-08-03 06:48:44 -04:00
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<devices>
2012-04-04 08:03:17 -04:00
<% volumes.each do |vol| -%>
2011-08-03 06:48:44 -04:00
<disk type='file' device='disk'>
2012-04-04 08:03:17 -04:00
<driver name='qemu' type='<%= vol.format_type %>'/>
<source file='<%= vol.path %>'/>
2012-04-09 04:46:14 -04:00
<%# we need to ensure a unique target dev -%>
<target dev='vd<%= ('a'..'z').to_a[volumes.index(vol)] %>' bus='virtio'/>
2011-08-03 06:48:44 -04:00
</disk>
2012-04-04 08:03:17 -04:00
<% end -%>
<% if iso_file -%>
2011-08-03 06:48:44 -04:00
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='<%= "#{iso_dir}/#{iso_file}" %>'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' unit='0'/>
</disk>
2012-04-04 08:03:17 -04:00
<% end -%>
<% nics.each do |nic| -%>
<interface type='<%= nic.type %>'>
<source <%= nic.type == 'bridge' ? "bridge='#{nic.bridge}'" : "network='#{nic.network}'" %> />
<model type='<%= nic.model %>'/>
2011-08-03 06:48:44 -04:00
</interface>
2012-04-04 08:03:17 -04:00
<% end -%>
2011-08-03 06:48:44 -04:00
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target port='0'/>
</console>
2013-07-10 22:08:13 -04:00
<input type='tablet' bus='usb'/>
2011-08-03 06:48:44 -04:00
<input type='mouse' bus='ps2'/>
2012-08-03 15:37:39 -04:00
<graphics type='<%= display[:type] %>' port='<%= display[:port] %>' autoport='yes' <% if display[:listen] and !(display[:listen].empty?) %> listen='<%= display[:listen] %>'<% end %> <% if display[:password] and !(display[:password].empty?) %>passwd='<%=display[:password] %>'<% end %> />
2011-08-03 06:48:44 -04:00
<video>
<model type='cirrus' vram='9216' heads='1'/>
</video>
</devices>
2011-08-09 17:03:40 -04:00
</domain>