internal error no supported architecture for os type 'hvm'

Bug #1031063 reported by Jamie Strandboge
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned
libvirt (Ubuntu)
Expired
Medium
Unassigned
nova (Ubuntu)
Expired
Medium
Unassigned

Bug Description

On a new 12.10 install following https://wiki.ubuntu.com/SecurityTeam/TestingOpenStack, if I set 'libvirt_type=qemu', restart nova and then try to start an instance, I can see in /var/log/nova/nova-compute.log that it is defaulting to 'kvm' and not 'qemu'. I then end up with the following error:
2012-07-30 14:55:48 TRACE nova.openstack.common.rpc.amqp libvirtError: internal error no supported architecture for os type 'hvm'

This might be a problem in libvirt on the host. I noticed that nested=1 for kvm_intel on my host and 'vmx' shows up in 'virsh capabilities' in the openstack guest, but in the guest I am unable to load kvm_intel (bug #1031090). However, the option for overriding with 'libvirt_type=qemu' doesn't seem to work. Also, if I reload the kvm_intel module with nested=0, and start the guest, it correctly does not load the kvm module, but nova incorrectly tries to start guests with <domain type="kvm"> and nova-compute.log shows the same error ("libvirtError: internal error no supported architecture for os type 'hvm'").

description: updated
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

So Daviey tells me that 'libvirt_type=qemu' doesn't necessarily mean --disable-kvm. I think there is a bug in how even if I reload my host's kvm_intel with nested=0 that openstack does not fallback to qemu -disable-kvm, but that is probably not a priority. The bigger issue is that a precise host booting a quantal guest results in the quantal guest being unable to load the kvm_intel module. I'll file another bug for that.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

The kernel bug is bug #1031090.

summary: - libvirt_type=qemu is not honored
+ domain type is always 'kvm', even when kvm is not available
description: updated
description: updated
Revision history for this message
Jamie Strandboge (jdstrand) wrote : Re: domain type is always 'kvm', even when kvm is not available

This may actually be a libvirt bug. Looking at the nova-compute.log, I adjust the uuid and name and have the following xml in /tmp/foo.xml:
<domain type="kvm">
  <uuid>3474184f-57c1-49d1-be61-8fe4ccb34682</uuid>
  <name>foo</name>
  <memory>524288</memory>
  <vcpu>1</vcpu>
  <os>
    <type>hvm</type>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
  </features>
  <clock offset="utc">
    <timer name="pit" tickpolicy="delay"/>
    <timer name="rtc" tickpolicy="catchup"/>
  </clock>
  <devices>
    <disk type="file" device="disk">
      <driver type="qcow2" cache="none"/>
      <source file="/var/lib/nova/instances/instance-00000012/disk"/>
      <target bus="virtio" dev="vda"/>
    </disk>
    <interface type="bridge">
      <mac address="fa:16:3e:71:49:da"/>
      <model type="virtio"/>
      <source bridge="br100"/>
      <filterref filter="nova-instance-instance-00000012-fa163e7149da">
        <parameter name="IP" value="10.0.0.4"/>
        <parameter name="DHCPSERVER" value="10.0.0.3"/>
        <parameter name="PROJNET" value="10.0.0.0"/>
        <parameter name="PROJMASK" value="255.255.255.0"/>
      </filterref>
    </interface>
    <serial type="file">
      <source path="/var/lib/nova/instances/instance-00000012/console.log"/>
    </serial>
    <serial type="pty"/>
    <input type="tablet" bus="usb"/>
    <graphics type="vnc" autoport="yes" keymap="en-us" listen="127.0.0.1"/>
  </devices>
</domain>

Using 'virsh define /tmp/foo.xml' on 12.04 it works. On 12.10 it does not:
$ virsh define /tmp/foo.xml
error: Failed to define domain from /tmp/foo.xml
error: internal error no supported architecture for os type 'hvm'

If I change this:
<type>hvm</type>

to:
<type arch='x86_64'>hvm</type>

It works:
$ virsh define /tmp/foo.xml
Domain foo defined from /tmp/foo.xml

It seems libvirt wants the 'arch' defined when specifying 'hvm'.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Adding a libvirt task as I don't know if this is a regression there or if nova needs to be updated to accommodate the change.

summary: - domain type is always 'kvm', even when kvm is not available
+ internal error no supported architecture for os type 'hvm'
Revision history for this message
Daniel Berrange (berrange) wrote :

$ virsh define /tmp/foo.xml
error: Failed to define domain from /tmp/foo.xml
error: internal error no supported architecture for os type 'hvm'

This means that libvirt can't find any way to provide the requested domain configuration. Since your XML shows you requested KVM, most likely this means that you have not got a KVM binary installed, or /dev/kvm does not exist.

Checking 'virsh capabilities' will show what ostype/hvtype/arch combinations libvirt has detected. Once you make virsh capabilities show the hvm+kvm+arch combination needed by the XML, then OpenStack should work as expected

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Jamie,

does comment #5 resolve the issue?

Changed in libvirt (Ubuntu):
status: New → Incomplete
Changed in nova:
status: New → Incomplete
Changed in nova (Ubuntu):
status: New → Incomplete
James Page (james-page)
Changed in libvirt (Ubuntu):
importance: Undecided → Medium
Changed in nova (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Jonathan Vargas (jvargas-alkaid) wrote :

This is my first time installing OpenStack. I am exactly the same issue when I boot a image I downloaded for testing purposes.

I noticed /dev/kvm doesn't exists. Should it? I am running OpenStack from a VBox virtual machinne. The Host is powered with full virtualization capabilities. Here are my logs:

 * https://gist.github.com/3374691

I tried to follow steps in:

http://www.hastexo.com/resources/docs/installing-openstack-essex-4-ubuntu-1204-precise-pangolin/step-6-your-first-vm

Thanks in advance.

Revision history for this message
Thierry Carrez (ttx) wrote :

@Jonathan: Looks like a different issue, like KVM not installed or your CPU doesn't support virt extensions.
@Jamie: does comment #5 resolve your issue?

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for nova (Ubuntu) because there has been no activity for 60 days.]

Changed in nova (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for libvirt (Ubuntu) because there has been no activity for 60 days.]

Changed in libvirt (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Thierry Carrez (ttx) wrote :

We cannot solve the issue you reported without more information. Could you please provide the requested information ?

Revision history for this message
Valeriy Belavin (vvbelavin) wrote :

Hello!

It is quite simple to reproduce this error. I can give you the info, if you like. So far, I've made the following:

1. sudo nano /usr/share/pyshared/nova/virt/libvirt.xml.template, and changed the first line from

<domain type='${type}'>

into

<domain type='qemu'>

2. sudo service restart nova-compute

And now I am able to run Openstack with qemu under VirtualBox.

Changed in nova:
status: Incomplete → Confirmed
Revision history for this message
shedoh (shedoh) wrote :

Hi,

Any update / solution on this issue?

I got the same problem as I install OpenStack Grizzly on VM with OS Ubuntu 12.04 (The Host OS is Ubuntu 12.04 as well).
set libvirt_type=qemu in nova.conf does not work too.

When execute virsh capabilities I got...

   .... some information omited...
  <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
      <wordsize>64</wordsize>
      <emulator>/usr/bin/qemu-system-x86_64</emulator>
      <machine>pc-1.0</machine>
      <machine canonical='pc-1.0'>pc</machine>
      <machine>pc-0.14</machine>
      <machine>pc-0.13</machine>
      <machine>pc-0.12</machine>
      <machine>pc-0.11</machine>
      <machine>pc-0.10</machine>
      <machine>isapc</machine>
      <domain type='qemu'>
      </domain>
    </arch>
    <features>
      <cpuselection/>
      <deviceboot/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

The domain type is already qemu. I can create VM with virt-manager without any problem.

@To Valeriy,
   I cannot find libvirt.xml.template in my machine. The libvirt version I installed is 1.0.2 on Ubuntu 12.04. Any suggestion?

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@shedoh,

Please post the full xml for a failing vm.

Revision history for this message
shedoh (shedoh) wrote :
Download full text (5.0 KiB)

@ Serge

I write down the process I have tried to solve this issue...

First the nova-compute.log show an ERROR as follow...

2013-05-21 16:19:11.230 ERROR nova.compute.manager [req-0e30e53b-8d93-4a0b-b378-672a02d6eb417c0d5d8e458f4580972e14af22e8a6ca 8d6292b82686470bb5a46d3c1a565c03] [instance: 71c40047-8422-4623-aaf0-f06353dfcb75] Error: ['Traceback (most recent call last):\n', ' File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 834, in _run_instance\n set_access_ip=set_access_ip)\n', ' File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1093, in _spawn\n LOG.exception(_(\'Instance failed to spawn\'), instance=instance)\n', ' File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__\n self.gen.next()\n', ' File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 1089, in _spawn\n block_device_info)\n', ' File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 1520, in spawn\n block_device_info)\n', ' File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 2435, in _create_domain_and_network\n domain = self._create_domain(xml, instance=instance)\n', ' File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 2395, in _create_domain\n domain = self._conn.defineXML(xml)\n', ' File "/usr/lib/python2.7/dist-packages/eventlet/tpool.py", line 187, in doit\n result = proxy_call(self._autowrap, f, *args, **kwargs)\n', ' File "/usr/lib/python2.7/dist-packages/eventlet/tpool.py", line 147, in proxy_call\n rv = execute(f,*args,**kwargs)\n', ' File "/usr/lib/python2.7/dist-packages/eventlet/tpool.py", line 76, in tworker\n rv = meth(*args,**kwargs)\n', ' File "/usr/lib/python2.7/dist-packages/libvirt.py", line 2760, in defineXML\n if ret is None:raise libvirtError(\'virDomainDefineXML() failed\', conn=self)\n', "libvirtError: internal error no supported architecture for os type 'hvm'\n"]

Then I check the "/usr/lib/python2.7/dist-packages/libvirt.py" at line 2760, it is a function in class virConnect

    def defineXML(self, xml):
        ret = libvirtmod.virDomainDefineXML(self._o, xml)
        if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
        __tmp = virDomain(self,_obj=ret)
        return __tmp

To output the xml I add some code as follow and restart nova-compute service

    def defineXML(self, xml):
        # save xml files to a temporary location
        import __builtin__ as bu
        f = bu.open("/tmp/libvirt.xml", "w")
        f.write(xml) # Write a string to a file
        f.close()

        ret = libvirtmod.virDomainDefineXML(self._o, xml)
        if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
        __tmp = virDomain(self,_obj=ret)
        return __tmp

When re-create a vm use OpenStack Dashboard, I got the /tmp/libvirt.xml as follow

 <domain type="kvm">
  <uuid>563fab12-f8b3-4689-b9b6-b3ba89c98246</uuid>
  <name>instance-00000007</name>
  <memory>524288</memory>
  <vcpu>1</vcpu>
  <sysinfo type="smbios">
    <system>
      <entry name="manufacturer">OpenStack Foundation</entry>
      <entry name="product">OpenStack Nova</entry>
 ...

Read more...

Revision history for this message
Clint Byrum (clint-fewbar) wrote :
Download full text (4.2 KiB)

I just hit this on Ubuntu 12.10 running trunk nova to try and spin up nested kvm VMs:

# virsh capabilities
<capabilities>

  <host>
    <uuid>3d39c1b1-7f6a-5536-de6e-c450da2036c8</uuid>
    <cpu>
      <arch>i686</arch>
      <model>qemu32</model>
      <vendor>Intel</vendor>
      <topology sockets='1' cores='1' threads='1'/>
      <feature name='hypervisor'/>
      <feature name='popcnt'/>
    </cpu>
    <power_management>
      <suspend_mem/>
      <suspend_disk/>
      <suspend_hybrid/>
    </power_management>
    <migration_features>
      <live/>
      <uri_transports>
        <uri_transport>tcp</uri_transport>
      </uri_transports>
    </migration_features>
    <secmodel>
      <model>apparmor</model>
      <doi>0</doi>
    </secmodel>
  </host>

  <guest>
    <os_type>hvm</os_type>
    <arch name='i686'>
      <wordsize>32</wordsize>
      <emulator>/usr/bin/qemu-system-x86_64</emulator>
      <machine>pc-1.2</machine>
      <machine>none</machine>
      <machine canonical='pc-1.2'>pc</machine>
      <machine>pc-1.1</machine>
      <machine>pc-1.0</machine>
      <machine>pc-0.15</machine>
      <machine>pc-0.14</machine>
      <machine>pc-0.13</machine>
      <machine>pc-0.12</machine>
      <machine>pc-0.11</machine>
      <machine>pc-0.10</machine>
      <machine>isapc</machine>
      <domain type='qemu'>
      </domain>
    </arch>
    <features>
      <cpuselection/>
      <deviceboot/>
      <pae/>
      <nonpae/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

  <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
      <wordsize>64</wordsize>
      <emulator>/usr/bin/qemu-system-x86_64</emulator>
      <machine>pc-1.2</machine>
      <machine>none</machine>
      <machine canonical='pc-1.2'>pc</machine>
      <machine>pc-1.1</machine>
      <machine>pc-1.0</machine>
      <machine>pc-0.15</machine>
      <machine>pc-0.14</machine>
      <machine>pc-0.13</machine>
      <machine>pc-0.12</machine>
      <machine>pc-0.11</machine>
      <machine>pc-0.10</machine>
      <machine>isapc</machine>
      <domain type='qemu'>
      </domain>
    </arch>
    <features>
      <cpuselection/>
      <deviceboot/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

</capabilities>

2013-05-30 17:19:06,688.688 18123 ERROR nova.compute.manager [req-a6ee869a-1875-4dd1-a832-1311cf208239 8a4a185b7a9f4256
92145162eef5a8da c82b41ffcf5e4d63bce6d2520b26dbf1] [instance: fd55b74c-48b3-43ee-ad24-f20efaeb2b88] Error: ['Traceback
(most recent call last):\n', ' File "/opt/stack/venvs/nova/local/lib/python2.7/site-packages/nova/compute/manager.py",
 line 949, in _build_instance\n set_access_ip=set_access_ip)\n', ' File "/opt/stack/venvs/nova/local/lib/python2.7/
site-packages/nova/compute/manager.py", line 1154, in _spawn\n LOG.exception(_(\'Instance failed to spawn\'), instan
ce=instance)\n', ' File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__\n self.gen.next()\n', ' File "/op
t/stack/venvs/nova/local/lib/python2.7/site-packages/nova/compute/manager.py", line 1150, in _spawn\n block_device_i
nfo)\n', ' ...

Read more...

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

So, this happened because I had misconfigured my guest (not the nested guest) and no virtualization was available. Once I enabled vmx on it, things work fine. Removing myself as "affected".

Revision history for this message
kayn (pulecp) wrote :

I know that it's old thread but me helped change line to "libvirt_type=qemu" in /etc/nova/nova-compute.conf

Revision history for this message
Somnath Mani (somnath-mani) wrote :

Ran in to the same issue with Ubuntu-12.04. I am trying to set up nova compute in a VM. I wanted to use libvit_type=qemu but i kept getting the error "hvm not supported".
Just when I was about to give up and try to reboot my host with nested virtualization capability, I realized that I was adding
libvirt_type=qemu in /etc/nova/nova.conf while I should really be adding it in /etc/nov/nova-compute.conf

Doing that resolved my issue! I can now launch a nested VM using qemu.
Hope this helps someone :-)

Joe Gordon (jogo)
Changed in nova:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.