首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >创建libvirt KVM域时报错:无效参数:无法获得/usr/libexec/qemu type=kvm的首选机器

创建libvirt KVM域时报错:无效参数:无法获得/usr/libexec/qemu type=kvm的首选机器
EN

Stack Overflow用户
提问于 2022-06-02 01:08:21
回答 1查看 1.1K关注 0票数 0

我试图在一个在嵌套虚拟化中运行oVirt Node的主机上创建以下域(它不会永远嵌套,只是暂时):

代码语言:javascript
运行
复制
<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>

当我这样做的时候,我会得到这样的错误:

代码语言:javascript
运行
复制
# 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

这个错误意味着什么,以及如何修复它?

EN

回答 1

Stack Overflow用户

发布于 2022-06-02 03:37:36

弄明白了。发生此错误的原因是两个问题的组合:

  1. 计算机类型没有在<type>hvm</type>中指定,并且在试图发现“首选”默认值时发生了错误。设置archmachine字段显示,在我的设置中没有真正的machine,因为主机在嵌套虚拟化中运行。将<domain type="kvm">更改为<domain type="qemu">使其工作。
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72469555

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档