打开 Stack,尝试启动实例:libvirtError:不支持的配置:虚拟机管理程序不支持 CPU 规格

打开 Stack,尝试启动实例:libvirtError:不支持的配置:虚拟机管理程序不支持 CPU 规格

我目前正在 AWS EC2 服务器上运行 Openstack 以进行测试/学习,特别是配备高频 Intel Xeon E5-2670(Sandy Bridge)处理器的 m3 版本。

每当我启动实例时,我都会在 /var/log/nova/nova-compute.log 中收到此错误

libvirtError: unsupported configuration: CPU specification not supported by hypervisor

该错误很容易解释,我发现这些链接指向一个可能的解决方案:

https://wiki.openstack.org/wiki/LibvirtXMLCPUModel

https://www.berrange.com/posts/2010/02/15/guest-cpu-model-configuration-in-libvirt-with-qemukvm/

我一直在通过(有根据的)反复试验来解决这个问题,但迄今为止还没有成功,恐怕我只是错过了一些显而易见的东西。

我走的路对吗?有没有在 AWS 上运行过 Openstack 的人能分享一些见解?

编辑

在我的日志文件中发现这个,

2014-04-30 01:56:05.986 1145 ERROR nova.virt.libvirt.driver [req-be5f0c96-cdd7-4ac3-a526-24c77b76a121 4e1ab5ced4394c309396f4487f58c187 b51412721c1045bd93d6dd5e513a4bca] An error occurred while trying to launch a defined domain with xml: <domain type='qemu'>
  <name>instance-00000001</name>
  <uuid>4b5edb76-7e09-425f-a71f-5c7b48fe2ac7</uuid>
  <memory unit='KiB'>524288</memory>
  <currentMemory unit='KiB'>524288</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <sysinfo type='smbios'>
    <system>
      <entry name='manufacturer'>OpenStack Foundation</entry>
      <entry name='product'>OpenStack Nova</entry>
      <entry name='version'>2013.2.2</entry>
      <entry name='serial'>4aeceff8-3582-48be-8712-ac2febc819c3</entry>
      <entry name='uuid'>4b5edb76-7e09-425f-a71f-5c7b48fe2ac7</entry>
    </system>
  </sysinfo>
  <os>
    <type arch='x86_64' machine='pc-i440fx-1.5'>hvm</type>
    <boot dev='hd'/>
    <smbios mode='sysinfo'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-model'>
    <model fallback='allow'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/nova/instances/4b5edb76-7e09-425f-a71f-5c7b48fe2ac7/disk'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <interface type='bridge'>
      <mac address='fa:16:3e:0b:9b:b8'/>
      <source bridge='br100'/>
      <model type='virtio'/>
      <driver name='qemu'/>
      <filterref filter='nova-instance-instance-00000001-fa163e0b9bb8'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='file'>
      <source path='/var/lib/nova/instances/4b5edb76-7e09-425f-a71f-5c7b48fe2ac7/console.log'/>
      <target port='0'/>
    </serial>
    <serial type='pty'>
      <target port='1'/>
    </serial>
    <console type='file'>
      <source path='/var/lib/nova/instances/4b5edb76-7e09-425f-a71f-5c7b48fe2ac7/console.log'/>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='localhost' keymap='en-us'>
      <listen type='address' address='localhost'/>
    </graphics>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>

2014-04-30 01:56:05.987 1145 ERROR nova.compute.manager [req-be5f0c96-cdd7-4ac3-a526-24c77b76a121 4e1ab5ced4394c309396f4487f58c187 b51412721c1045bd93d6dd5e513a4bca] [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7] Instance failed to spawn
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7] Traceback (most recent call last):
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1423, in _spawn
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]     block_device_info)
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 2091, in spawn
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]     block_device_info, context=context)
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 3249, in _create_domain_and_network
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]     domain = self._create_domain(xml, instance=instance, power_on=power_on)
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 3192, in _create_domain
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]     domain.XMLDesc(0))
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 3187, in _create_domain
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]     domain.createWithFlags(launch_flags)
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]   File "/usr/lib/python2.7/dist-packages/eventlet/tpool.py", line 179, in doit
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]     result = proxy_call(self._autowrap, f, *args, **kwargs)
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]   File "/usr/lib/python2.7/dist-packages/eventlet/tpool.py", line 139, in proxy_call
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]     rv = execute(f,*args,**kwargs)
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]   File "/usr/lib/python2.7/dist-packages/eventlet/tpool.py", line 77, in tworker
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]     rv = meth(*args,**kwargs)
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]   File "/usr/lib/python2.7/dist-packages/libvirt.py", line 728, in createWithFlags
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7]     if ret == -1: raise libvirtError ('virDomainCreateWithFlags() failed', dom=self)
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7] libvirtError: unsupported configuration: CPU specification not supported by hypervisor
2014-04-30 01:56:05.987 1145 TRACE nova.compute.manager [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7] 
2014-04-30 01:56:06.950 1145 ERROR nova.compute.manager [req-be5f0c96-cdd7-4ac3-a526-24c77b76a121 4e1ab5ced4394c309396f4487f58c187 b51412721c1045bd93d6dd5e513a4bca] [instance: 4b5edb76-7e09-425f-a71f-5c7b48fe2ac7] Error: unsupported configuration: CPU specification not supported by hypervisor

答案1

看来我误读了资源关于已知问题,第一次就发布了声明。声明如下:

libvirt_cpu_mode 选项的默认值为“host-model”,但如果您在虚拟机内运行 Nova,这显然会导致“不支持的配置:虚拟机管理程序不支持 CPU 规格”之类的错误;对于此类部署,应使用 libvirt_cpu_mode="none" http://wiki.openstack.org/LibvirtXMLCPUModel

因此,如果你遇到此问题,请务必指定

libvirt_cpu_mode="none"

在/etc/nova/nova.conf中

答案2

正如 Jack 所建议的,我认为您正在尝试托管 KVM 盒而不是 qemu。AWS 不支持 KVM,因此您需要切换到 qemu。请查看第 7 点http://docs.openstack.org/trunk/install-guide/install/apt/content/nova-compute.html

摘自指南:如果您出于测试目的在虚拟机上安装 Compute,则必须使用以下命令确定虚拟机管理程序和/或 CPU 是否支持嵌套硬件加速:

egrep -c '(vmx|svm)' /proc/cpuinfo

如果此命令返回一或更大的值,则您的虚拟机管理程序和/或 CPU 支持嵌套硬件加速,无需额外配置。

如果此命令返回零值,则表示您的虚拟机管理程序和/或 CPU 不支持嵌套硬件加速,并且 libvirt 必须使用 QEMU 而不是 KVM。编辑 /etc/nova/nova-compute.conf 文件中的 [libvirt] 部分以修改此键:

[libvirt]
...
virt_type = qemu

相关内容