fix(virtualization): add XML safety attributes and switch xen to virtio

This commit is contained in:
2026-02-20 20:18:49 +01:00
parent 524356cf8d
commit 9f9a4b38b8
4 changed files with 10 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
<domain type='kvm'>
<name>{{ hostname }}</name>
<memory>{{ system_cfg.memory | int * 1024 }}</memory>
{% if system_cfg.balloon is defined and system_cfg.balloon | int > 0 %}<currentMemory>{{ system_cfg.balloon | int * 1024 }}</currentMemory>{% endif %}
<memory unit='KiB'>{{ system_cfg.memory | int * 1024 }}</memory>
{% if system_cfg.balloon is defined and system_cfg.balloon | int > 0 %}<currentMemory unit='KiB'>{{ system_cfg.balloon | int * 1024 }}</currentMemory>{% endif %}
<vcpu placement='static'>{{ system_cfg.cpus }}</vcpu>
<os>
<type arch='x86_64' machine="{{ virtualization_libvirt_machine_type }}">hvm</type>
@@ -33,17 +33,20 @@
<driver name="qemu" type="raw"/>
<source file="{{ boot_iso }}"/>
<target dev="sda" bus="sata"/>
<readonly/>
</disk>
<disk type="file" device="cdrom">
<driver name="qemu" type="raw"/>
<source file="{{ virtualization_libvirt_cloudinit_path }}"/>
<target dev="sdb" bus="sata"/>
<readonly/>
</disk>
{% if rhel_iso is defined and rhel_iso | length > 0 %}
<disk type="file" device="cdrom">
<driver name="qemu" type="raw"/>
<source file="{{ rhel_iso }}"/>
<target dev="sdc" bus="sata"/>
<readonly/>
</disk>
{% endif %}
{% for iface in system_cfg.network.interfaces %}