简体   繁体   English

创建 libvirt KVM 域时出错:参数无效:无法为 /usr/libexec/qemu-kvm 获取首选机器 type=kvm

[英]Error creating libvirt KVM domain: 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):我正在尝试在嵌套虚拟化中运行 oVirt Node 的主机上创建以下域(暂时不会永远嵌套):

<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?这个错误是什么意思,我该如何解决?

Figured it out.弄清楚了。 This error happened because of a combination of two problems:发生此错误是由于两个问题的组合:

  1. The machine type was not specified in <type>hvm</type> , and an error happened when trying to discover the "preferred" default value. <type>hvm</type>中未指定机器类型,尝试发现“首选”默认值时发生错误。 Setting the arch and machine fields revealed the real problem:设置archmachine场揭示了真正的问题:
  2. kvm is not available in my setup because the host is running in nested virtualization. kvm在我的设置中不可用,因为主机在嵌套虚拟化中运行。 Changing <domain type="kvm"> to <domain type="qemu"> made it work.<domain type="kvm">更改为<domain type="qemu">使其工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM