错误创建libvirt kvm域:无效参数:无法获得/usr/libexec/qemu-kvm type = kvm的首选机器
我正在尝试在嵌套虚拟化中运行ovirt节点的主机上创建以下域(它不会永远嵌套,而只是现在):
<domain type="kvm">
<name>clara</name>
<memory unit="MiB">4096</memory>
<vcpu>2</vcpu>
<os>
<type>hvm</type>
<boot dev="hd"></boot>
</os>
<features>
<pae></pae>
<acpi></acpi>
<apic></apic>
</features>
<cpu></cpu>
<devices>
<disk type="volume" device="disk">
<driver name="qemu" type="qcow2"></driver>
<source pool="default" volume="clara-rootfs"></source>
<target dev="vda" bus="scsi"></target>
<wwn>05abcd62857fe8f1</wwn>
</disk>
<disk type="file" device="cdrom">
<driver name="qemu" type="raw"></driver>
<source file="/var/lib/libvirt/images/cloudinit.clara.iso"></source>
<target dev="hdd" bus="ide"></target>
</disk>
<controller type="scsi" model="virtio-scsi"></controller>
<interface type="bridge">
<mac address="E2:F5:2A:A9:4A:42"></mac>
<source bridge="bridge0"></source>
<model type="virtio"></model>
</interface>
<channel type="unix">
<target type="virtio" name="org.qemu.guest_agent.0"></target>
</channel>
<graphics type="spice" autoport="yes"></graphics>
<rng model="virtio">
<backend model="random">/dev/urandom</backend>
</rng>
</devices>
</domain>
当我这样做时,我会遇到此错误:
# virsh define clara.xml
error: Failed to define domain from clara.xml
error: invalid argument: could not get preferred machine for /usr/libexec/qemu-kvm type=kvm
此错误是什么意思,以及如何我修理了吗?
I'm trying to create the following domain on a host running oVirt Node in nested virtualization (it won't be nested forever, just for now):
<domain type="kvm">
<name>clara</name>
<memory unit="MiB">4096</memory>
<vcpu>2</vcpu>
<os>
<type>hvm</type>
<boot dev="hd"></boot>
</os>
<features>
<pae></pae>
<acpi></acpi>
<apic></apic>
</features>
<cpu></cpu>
<devices>
<disk type="volume" device="disk">
<driver name="qemu" type="qcow2"></driver>
<source pool="default" volume="clara-rootfs"></source>
<target dev="vda" bus="scsi"></target>
<wwn>05abcd62857fe8f1</wwn>
</disk>
<disk type="file" device="cdrom">
<driver name="qemu" type="raw"></driver>
<source file="/var/lib/libvirt/images/cloudinit.clara.iso"></source>
<target dev="hdd" bus="ide"></target>
</disk>
<controller type="scsi" model="virtio-scsi"></controller>
<interface type="bridge">
<mac address="E2:F5:2A:A9:4A:42"></mac>
<source bridge="bridge0"></source>
<model type="virtio"></model>
</interface>
<channel type="unix">
<target type="virtio" name="org.qemu.guest_agent.0"></target>
</channel>
<graphics type="spice" autoport="yes"></graphics>
<rng model="virtio">
<backend model="random">/dev/urandom</backend>
</rng>
</devices>
</domain>
When I do, I get this error:
# virsh define clara.xml
error: Failed to define domain from clara.xml
error: invalid argument: could not get preferred machine for /usr/libexec/qemu-kvm type=kvm
What does this error mean, and how do I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
弄清楚了。由于两个问题的组合而发生了此错误:
&lt; type&gt; hvm&lt;/type&gt;
中未指定机器类型,并且在尝试发现“首选”默认值时发生了错误。设置Arch
和机器
字段显示 real 问题:kvm
在我的设置中不可用,因为主机是在嵌套虚拟化中运行。更改&lt; domain type =“ kvm”&gt;
to&lt; domain type =“ qemu”&gt;
使其正常工作。如果您在Terraform中进行此操作,则可以通过添加此配置来修改生成的XML文件:
Figured it out. This error happened because of a combination of two problems:
<type>hvm</type>
, and an error happened when trying to discover the "preferred" default value. Setting thearch
andmachine
fields revealed the real problem:kvm
is not available in my setup because the host is running in nested virtualization. Changing<domain type="kvm">
to<domain type="qemu">
made it work.If you are doing this in Terraform, you can modify the generated XML file by adding this configuration: