2021-05-16 13:52:46 +00:00
|
|
|
<domain type="kvm" xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
|
2021-05-16 03:46:55 +00:00
|
|
|
<name>{{.Name}}</name>
|
|
|
|
<uuid>{{.UUID}}</uuid>
|
|
|
|
<metadata>
|
|
|
|
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
|
|
|
|
<libosinfo:os id="http://nixos.org/nixos/unstable"/>
|
|
|
|
</libosinfo:libosinfo>
|
|
|
|
</metadata>
|
|
|
|
<memory>{{.Memory}}</memory>
|
|
|
|
<currentMemory>{{.Memory}}</currentMemory>
|
|
|
|
<vcpu>2</vcpu>
|
|
|
|
<os>
|
|
|
|
<type arch="x86_64" machine="q35">hvm</type>
|
|
|
|
<boot dev="hd"/>
|
|
|
|
</os>
|
|
|
|
<features>
|
|
|
|
<acpi/>
|
|
|
|
<apic/>
|
|
|
|
<vmport state="off"/>
|
|
|
|
</features>
|
|
|
|
<cpu mode="host-model"/>
|
|
|
|
<clock offset="utc">
|
|
|
|
<timer name="rtc" tickpolicy="catchup"/>
|
|
|
|
<timer name="pit" tickpolicy="delay"/>
|
|
|
|
<timer name="hpet" present="no"/>
|
|
|
|
</clock>
|
2021-05-16 13:56:45 +00:00
|
|
|
<on_poweroff>destroy</on_poweroff>
|
|
|
|
<on_reboot>restart</on_reboot>
|
|
|
|
<on_crash>destroy</on_crash>
|
2021-05-16 03:46:55 +00:00
|
|
|
<pm>
|
|
|
|
<suspend-to-mem enabled="no"/>
|
|
|
|
<suspend-to-disk enabled="no"/>
|
|
|
|
</pm>
|
|
|
|
<devices>
|
|
|
|
<emulator>/run/libvirt/nix-emulators/qemu-system-x86_64</emulator>
|
|
|
|
<disk type="block" device="disk">
|
|
|
|
<driver name="qemu" type="raw" cache="none" io="native"/>
|
|
|
|
<source dev="/dev/zvol/{{.ZVol}}"/>
|
2021-05-16 15:50:10 +00:00
|
|
|
{{if .SATA}}
|
|
|
|
<target dev="sda" bus="sata"/>
|
|
|
|
{{else}}
|
2021-05-16 03:46:55 +00:00
|
|
|
<target dev="vda" bus="virtio"/>
|
2021-05-16 15:50:10 +00:00
|
|
|
{{end}}
|
2021-05-16 03:46:55 +00:00
|
|
|
</disk>
|
|
|
|
<disk type="file" device="cdrom">
|
|
|
|
<driver name="qemu" type="raw"/>
|
|
|
|
<source file="{{.Seed}}"/>
|
2021-05-16 15:50:10 +00:00
|
|
|
<target dev="sdb" bus="sata"/>
|
2021-05-16 03:46:55 +00:00
|
|
|
<readonly/>
|
|
|
|
</disk>
|
|
|
|
<controller type="usb" model="qemu-xhci" ports="15"/>
|
|
|
|
<interface type="network">
|
|
|
|
<source network="default"/>
|
|
|
|
<mac address="{{.MACAddress}}"/>
|
2021-05-16 15:50:10 +00:00
|
|
|
{{if .SATA}}
|
|
|
|
<model type="e1000e"/>
|
|
|
|
<address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
|
|
|
|
{{else}}
|
2021-05-16 03:46:55 +00:00
|
|
|
<model type="virtio"/>
|
2021-05-16 15:50:10 +00:00
|
|
|
{{end}}
|
2021-05-16 03:46:55 +00:00
|
|
|
</interface>
|
|
|
|
<console type="pty"/>
|
|
|
|
<channel type="unix">
|
|
|
|
<source mode="bind"/>
|
|
|
|
<target type="virtio" name="org.qemu.guest_agent.0"/>
|
|
|
|
</channel>
|
|
|
|
<channel type="spicevmc">
|
|
|
|
<target type="virtio" name="com.redhat.spice.0"/>
|
|
|
|
</channel>
|
|
|
|
<input type="tablet" bus="usb"/>
|
|
|
|
<graphics type="spice" port="-1" tlsPort="-1" autoport="yes"/>
|
|
|
|
<sound model="ich9"/>
|
|
|
|
<video>
|
|
|
|
<model type="qxl"/>
|
|
|
|
</video>
|
|
|
|
<redirdev bus="usb" type="spicevmc"/>
|
|
|
|
<redirdev bus="usb" type="spicevmc"/>
|
|
|
|
<memballoon model="virtio"/>
|
|
|
|
<rng model="virtio">
|
|
|
|
<backend model="random">/dev/urandom</backend>
|
|
|
|
</rng>
|
|
|
|
</devices>
|
2021-05-16 13:52:46 +00:00
|
|
|
<qemu:commandline>
|
|
|
|
<qemu:arg value="-smbios" />
|
|
|
|
<qemu:arg value="type=1,serial=ds=nocloud;h={{.Name}}" />
|
|
|
|
</qemu:commandline>
|
2021-05-16 03:46:55 +00:00
|
|
|
</domain>
|