Files
vagrant-libvirt/lib/vagrant-libvirt/templates/domain.xml.erb
Gabriel Briones Sayeg 3277506627 Include custom UEFI loader
Domain XML has loader tag to read specific OVMF.fd path

Signed-off-by: Gabriel Briones Sayeg <gbriones.gdl@gmail.com>
2015-08-06 11:00:15 -05:00

93 lines
2.7 KiB
Plaintext

<domain type='<%= @domain_type %>'>
<name><%= @name %></name>
<memory><%= @memory_size %></memory>
<vcpu><%= @cpus %></vcpu>
<% if @nested %>
<cpu mode='<%= @cpu_mode %>'>
<% if @cpu_mode != 'host-passthrough' %>
<model fallback='allow'>qemu64</model>
<feature policy='optional' name='vmx'/>
<feature policy='optional' name='svm'/>
<% end %>
</cpu>
<% end %>
<os>
<% if @machine_type %>
<% if @machine_arch %>
<type arch='<%= @machine_arch %>' machine='<%= @machine_type %>'>hvm</type>
<% else %>
<type machine='<%= @machine_type %>'>hvm</type>
<% end %>
<% else %>
<% if @machine_arch %>
<type arch='<%= @machine_arch %>'>hvm</type>
<% else %>
<type>hvm</type>
<% end %>
<% end %>
<% if @loader %>
<loader readonly='yes' type='rom'><%= @loader %></loader>
<% end %>
<% if @boot_order.count >= 1 %>
<bootmenu enable='yes'/>
<% end %>
<kernel><%= @kernel %></kernel>
<initrd><%= @initrd %></initrd>
<cmdline><%= @cmd_line %></cmdline>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<devices>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='<%= @domain_volume_cache %>'/>
<source file='<%= @domain_volume_path %>'/>
<%# we need to ensure a unique target dev -%>
<target dev='vda' bus='<%= @disk_bus %>'/>
<% if @boot_order[0] == 'hd' %>
<boot order='1'/>
<% elsif @boot_order.count >= 1 %>
<boot order='9'/>
<% end %>
</disk>
<%# additional disks -%>
<% @disks.each do |d| -%>
<disk type='file' device='disk'>
<driver name='qemu' type='<%= d[:type] %>' cache='<%= d[:cache] %>'/>
<source file='<%= d[:absolute_path] %>'/>
<target dev='<%= d[:device] %>' bus='<%= d[:bus] %>'/>
<%# this will get auto generated by libvirt
<address type='pci' domain='0x0000' bus='0x00' slot='???' function='0x0'/>
-%>
</disk>
<% end -%>
<% @cdroms.each do |c| %>
<disk type='file' device='cdrom'>
<source file='<%= c[:path] %>'/>
<target dev='<%= c[:dev] %>' bus='<%= c[:bus] %>'/>
<readonly/>
</disk>
<% end %>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<%# Video device -%>
<graphics type='<%= @graphics_type %>' port='<%= @graphics_port %>' autoport='<%= @graphics_autoport %>' listen='<%= @graphics_ip %>' keymap='<%= @keymap %>' <%= @graphics_passwd%> />
<video>
<model type='<%= @video_type %>' vram='<%= @video_vram %>' heads='1'/>
</video>
<%#End Video -%>
</devices>
</domain>