libvirt.libvirtError: internal error no supported architecture for os type 'hvm'

Bug #445253 reported by Arnaud
54
This bug affects 11 people
Affects Status Importance Assigned to Milestone
vm-builder (Ubuntu)
Fix Committed
Undecided
devendra

Bug Description

vm-builder 0.11.1-0ubuntu1

This is on kubuntu karmic intel x86_64 (fresh install using alpha6 alternate CD):
Description: Ubuntu karmic (development branch)
Release: 9.10

the problem is that creating a new VM image fails when registering new VM into libvirt.

Steps to reproduce: build a new VM using the following command:
sudo ubuntu-vm-builder kvm ${release} --tmpfs=- -d test-t1 --domain=test --hostname=t1 --user=toto --ssh-key=/home/toto/.ssh/id_dsa.pub --ssh-user-key=/home/toto/.ssh/id_dsa.pub --libvirt=qemu:///system

where release is set to one of intrepid, jaunty, karmic.

Here is the output (for release set to jaunty):
2009-10-07 09:56:33,257 INFO : Creating disk image: /tmp/vmbuilder3jZa_6/disk0.img
2009-10-07 09:56:33,278 INFO : Adding partition table to disk image: /tmp/vmbuilder3jZa_6/disk0.img
2009-10-07 09:56:33,340 INFO : Adding type 1 partition to disk image: /tmp/vmbuilder3jZa_6/disk0.img
2009-10-07 09:56:33,389 INFO : Adding type 3 partition to disk image: /tmp/vmbuilder3jZa_6/disk0.img
2009-10-07 09:56:33,403 INFO : [0] ../../libparted/filesys.c:147 (ped_file_system_type_get): File system alias linux-swap(new) is deprecated
2009-10-07 09:56:33,439 INFO : Creating loop devices corresponding to the created partitions
2009-10-07 09:56:33,469 INFO : Creating file systems
2009-10-07 09:56:33,489 INFO : mke2fs 1.41.9 (22-Aug-2009)
2009-10-07 09:56:33,839 INFO : mkswap: /dev/mapper/loop0p2: warning: don't erase bootbits sectors
2009-10-07 09:56:33,840 INFO : on whole disk. Use -f to force.
2009-10-07 09:56:33,853 INFO : Mounting target filesystems
2009-10-07 09:56:33,861 INFO : Installing guest operating system. This might take some time...
2009-10-07 10:00:37,529 INFO : Can not write log, openpty() failed (/dev/pts not mounted?)
2009-10-07 10:00:37,657 INFO : Moving old data out of the way
2009-10-07 10:00:38,268 INFO : Can not write log, openpty() failed (/dev/pts not mounted?)
2009-10-07 10:00:39,042 INFO : Searching for GRUB installation directory ... found: /boot/grub
2009-10-07 10:00:39,086 INFO : Searching for default file ... Generating /boot/grub/default file and setting the default boot entry to 0
2009-10-07 10:00:39,087 INFO : Searching for GRUB installation directory ... found: /boot/grub
2009-10-07 10:00:39,090 INFO : Testing for an existing GRUB menu.lst file ...
2009-10-07 10:00:39,091 INFO :
2009-10-07 10:00:39,091 INFO : Could not find /boot/grub/menu.lst file.
2009-10-07 10:00:39,091 INFO : Generating /boot/grub/menu.lst
2009-10-07 10:00:39,134 INFO : Searching for splash image ... none found, skipping ...
2009-10-07 10:00:39,246 INFO : grep: /boot/config*: No such file or directory
2009-10-07 10:00:39,293 INFO : Updating /boot/grub/menu.lst ... done
2009-10-07 10:00:39,304 INFO :
2009-10-07 10:00:39,480 INFO : Searching for GRUB installation directory ... found: /boot/grub
2009-10-07 10:00:39,520 INFO : Searching for default file ... found: /boot/grub/default
2009-10-07 10:00:39,521 INFO : Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
2009-10-07 10:00:39,604 INFO : Searching for splash image ... none found, skipping ...
2009-10-07 10:00:39,630 INFO : grep: /boot/config*: No such file or directory
2009-10-07 10:00:39,682 INFO : Updating /boot/grub/menu.lst ... done
2009-10-07 10:00:39,682 INFO :
2009-10-07 10:00:39,739 INFO : Searching for GRUB installation directory ... found: /boot/grub
2009-10-07 10:01:10,028 INFO :
2009-10-07 10:01:10,028 INFO : Current default timezone: 'Etc/UTC'
2009-10-07 10:01:10,030 INFO : Local time is now: Wed Oct 7 08:01:10 UTC 2009.
2009-10-07 10:01:10,031 INFO : Universal Time is now: Wed Oct 7 08:01:10 UTC 2009.
2009-10-07 10:01:10,031 INFO :
2009-10-07 10:01:12,588 INFO : update-initramfs: Generating /boot/initrd.img-2.6.28-15-server
2009-10-07 10:02:14,262 INFO : Copying to disk images
2009-10-07 10:02:20,461 INFO : Installing bootloader
2009-10-07 10:02:27,581 INFO : Unmounting target filesystem
2009-10-07 10:02:30,790 INFO : Converting /tmp/vmbuilder3jZa_6/disk0.img to qcow2, format test-t1/disk0.qcow2
libvir: Domain Config error : internal error no supported architecture for os type 'hvm'
2009-10-07 10:02:41,262 INFO : Cleaning up
Traceback (most recent call last):
  File "/usr/bin/ubuntu-vm-builder", line 28, in <module>
    VMBuilder.run()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/__init__.py", line 65, in run
    frontend.run()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/plugins/cli/__init__.py", line 68, in run
    vm.create()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/vm.py", line 490, in create
    self.deploy()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/vm.py", line 192, in deploy
    if getattr(plugin, 'deploy')():
  File "/usr/lib/python2.6/dist-packages/VMBuilder/plugins/libvirt/__init__.py", line 64, in deploy
    self.conn.defineXML(vmxml)
  File "/usr/lib/python2.6/dist-packages/libvirt.py", line 1107, in defineXML
    if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
libvirt.libvirtError: internal error no supported architecture for os type 'hvm'

stack trace is the same when trying to build intrepid or karmic VMs

ProblemType: Bug
Architecture: amd64
Date: Wed Oct 7 10:17:55 2009
DistroRelease: Ubuntu 9.10
Package: ubuntu-vm-builder 0.11.1-0ubuntu1
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-12.39-generic
SourcePackage: vm-builder
Uname: Linux 2.6.31-12-generic x86_64

Revision history for this message
Arnaud (arnaud-oss) wrote :
Revision history for this message
Arnaud (arnaud-oss) wrote :

virtualization was disabled in the BIOS (default settings):
kernel: [ 476.938973] kvm: disabled by bios

I think this is what caused the problem, closing...

Changed in vm-builder (Ubuntu):
status: New → Invalid
Revision history for this message
Thijs Thiessens (t-thiessens) wrote :

Hey all,

The problem still exists even with kvm enabled in the bios.

:~/vm1$ kvm-ok
INFO: Your CPU supports KVM extensions
INFO: /dev/kvm exists
KVM acceleration can be used

grep ' lm ' /proc/cpuinfo
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida tpr_shadow vnmi flexpriority
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida tpr_shadow vnmi flexpriority

~/vm1$ lsmod | grep kvm
kvm_intel 43848 0
kvm 162560 1 kvm_intel

command to create the KVM image:

sudo vmbuilder kvm ubuntu --suite=karmic --flavour=virtual -o --libvirt=qemu:///system --tmpfs=- --ip=192.168.0.101 --part=vmbuilder.partition --templates=templates --user=pink --name=Admin --pass=pink --addpkg=vim-nox --addpkg=unattended-upgrades --addpkg=acpid --firstboot=boot.sh --mem=256 --hostname=vm1 --bridge=br0 --verbose

part of the output:

2010-03-08 16:57:31,469 INFO : Copying to disk images
2010-03-08 16:57:43,248 INFO : Installing bootloader
2010-03-08 16:57:53,245 INFO : Unmounting target filesystem
2010-03-08 16:57:59,515 INFO : Converting /tmp/vmbuilderZIy1bs/disk0.img to qcow2, format ubuntu-kvm/disk0.qcow2
2010-03-08 16:58:30,334 INFO : Converting /tmp/vmbuilderZIy1bs/disk1.img to qcow2, format ubuntu-kvm/disk1.qcow2
libvir: Domain Config error : internal error no supported architecture for os type 'hvm'
2010-03-08 16:59:22,648 INFO : Cleaning up

Traceback (most recent call last):
  File "/usr/bin/vmbuilder", line 29, in <module>
    VMBuilder.run()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/__init__.py", line 65, in run
    frontend.run()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/plugins/cli/__init__.py", line 68, in run
    vm.create()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/vm.py", line 490, in create
    self.deploy()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/vm.py", line 192, in deploy
    if getattr(plugin, 'deploy')():
  File "/usr/lib/python2.6/dist-packages/VMBuilder/plugins/libvirt/__init__.py", line 64, in deploy
    self.conn.defineXML(vmxml)
  File "/usr/lib/python2.6/dist-packages/libvirt.py", line 1107, in defineXML
    if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
libvirt.libvirtError: internal error no supported architecture for os type 'hvm'

~/vm1$ uname -a
Linux thijs-laptop 2.6.31-19-generic-pae #56-Ubuntu SMP Thu Jan 28 02:29:51 UTC 2010 i686 GNU/Linux

Thanks, Thijs Thiessens

Revision history for this message
Andrew Bulmer (bulmer) wrote :

I'm getting the exact same error on Jaunty on an AMD x86_64

Changed in vm-builder (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Andrew Bulmer (bulmer) wrote :

Hmmmm I suspect that this may be due to the hardware virtualisation not being enabled in the BIOS. Unfortunately I don't have immediate physical access to that server to check. I only have ssh access to it right now. Anyone know a command I can run to check if hardwar virtualisation is enabled?

/proc/cpuinfo does have vmx listed, but according to the docs that doesn't mean its enabled.

Revision history for this message
Andrew Bulmer (bulmer) wrote :

I haven't been able to confirm that it is the BIOS setting thats the problem, but running virsh capabilities doesn't show anything for guest, and from I've found in other forums I think it should.

is it possible for vmbuilder to run "virsh capabilities" to make sure hvm is working (throwing up an error telling the user to check BIOS settings if its not) before building anything?

Revision history for this message
Andrew Bulmer (bulmer) wrote :

oh and it seems that this error only comes up if you use the --libvirt=qemu:///system option. So if someone uses that option the virsh capabilities needs to be checked.

Revision history for this message
Robert Light (light-alum) wrote :

I just added a node-controller which doesn't have a virt.accelerated processor in it and I'm getting "libvirt: internal error no supported architecture for os type 'hvm' (code=1)"

Can I use a node-controller which doesn't have virt.acceleration??

Revision history for this message
NeilGreenwood (neil-greenwood) wrote :

I had this same problem. kvm-ok was reporting success, but the VM creation was still failing. I had to power off the server after changing the BIOS in order for the 'hvm' type to be valid.

Revision history for this message
Itraju Devendra Babu (itraju-babu) wrote :

check the --libvirt-type if it is "kvm" then
change it to --libvirt-type=qemu in /etc/nova/nova-compute.conf
and reboot the machine
your bug will get resolved

Changed in vm-builder (Ubuntu):
assignee: nobody → Itraju Devendra Babu (itraju-babu)
Changed in vm-builder (Ubuntu):
assignee: Itraju Devendra Babu (itraju-babu) → nobody
devendra (devedevendra)
Changed in vm-builder (Ubuntu):
assignee: nobody → devendra (devedevendra)
status: Confirmed → Fix Committed
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.