[PPA] VT is not used with libvirt 0.7.5

Bug #503376 reported by Id2ndR
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Invalid
Undecided
Daniel Baumann

Bug Description

When starting a VM with the virtual manager, VT is not used and the VM is slow.

System : Ubuntu 9.10
Hardware : CPU Intel with VT
Software : libvirt from dnjl's Virtualization PPA

I can see it because it's possible to remove kvm_intel module while the VM is running.
The trouble appears with last update (1 mounth before it was running normally).

The command line runned by libvirt seams correct :
/usr/bin/kvm -S -M pc-0.11 -enable-kvm -m 384 -smp 2 -name obm23-lenny -uuid f25941b5-8a0b-086a-888e-fe8570f0487d -monitor unix:/var/lib/libvirt/qemu/obm23-lenny.monitor,server,nowait -boot c -drive if=ide,media=cdrom,index=2 -drive file=/home/fabiena/kvm/libvirt-image/obm23-lenny.qcow2,if=virtio,index=0,boot=on,format=qcow2 -net nic,macaddr=52:54:00:4a:73:fb,vlan=0,model=e1000,name=e1000.0 -net tap,fd=48,vlan=0,name=tap.0 -serial pty -parallel none -usb -vnc 127.0.0.1:0 -k fr -vga cirrus -soundhw es1370

The VM run with this command use VT :
sudo /usr/bin/kvm -M pc-0.11 -enable-kvm -m 384 -smp 2 -name obm23-lenny -uuid f25941b5-8a0b-086a-888e-fe8570f0487d -boot c -drive file=/home/fabiena/kvm/libvirt-image/obm23-lenny.qcow2,if=virtio,index=0,boot=on,format=qcow2 -net nic,macaddr=52:54:00:4a:73:fb,vlan=0,model=e1000,name=e1000.0 -net tap,fd=48,vlan=0,name=tap.0

With this last case the network is not operational but the aim is to test the use of VT.
I think this can be related with the "-S" option that is used by libvirt.

Id2ndR (id2ndr)
Changed in libvirt (Ubuntu):
assignee: nobody → Daniel Baumann (dnjl) (dnjl)
Revision history for this message
Daniel Baumann (dnjl) wrote :

This -S switch is not the problem - libvirt will manage the running qemu/kvm instances, and this is used for this.

What kernel are you running? The newer libvirt requires a kernel with some more enabled cgroups parameters.
Ubuntu's kernel has enabled this since 2.6.32-5.6. So please try this with a current Lucid kernel (https://launchpad.net/ubuntu/lucid/+source/linux).
Also, you will find such kernels in my kernel ppa (https://launchpad.net/~dnjl/+archive/kernel) - the lxc-flavours are the right ones.

Revision history for this message
Id2ndR (id2ndr) wrote :

I just installed the lucid's kernel.

I've got the following traceback when trying to launch a VM :

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/engine.py", line 588, in run_domain
    vm.startup()
  File "/usr/share/virt-manager/virtManager/domain.py", line 150, in startup
    self._backend.create()
  File "/usr/lib/python2.6/dist-packages/libvirt.py", line 300, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: internal error unable to start guest: open /dev/kvm: Permission denied
Could not initialize KVM, will disable KVM support
qemu: could not open disk image /home/fabiena/kvm/libvirt-image/obm23-lenny.qcow2

Then I changed permissions of /dev/kvm from
crw-rw----+ 1 root kvm 10
to
crw-rw----+ 1 root libvirtd 10

and I got the following error :
Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/engine.py", line 588, in run_domain
    vm.startup()
  File "/usr/share/virt-manager/virtManager/domain.py", line 150, in startup
    self._backend.create()
  File "/usr/lib/python2.6/dist-packages/libvirt.py", line 300, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: internal error unable to start guest: qemu: could not open disk image /home/fabiena/kvm/libvirt-image/obm23-lenny.qcow2

$ ls -l /home/fabiena/kvm/libvirt-image/obm23-lenny.qcow2-rw-r--r-- 1 root root 1009516544 2010-01-05 18:01 /home/fabiena/kvm/libvirt-image/obm23-lenny.qcow2

The owner and group of this file have been changed (by libvirt ?) when I tried to run the VM.

Then I tried this :
$ sudo /etc/init.d/libvirt-bin restart

And now I can run the VM and it uses VT !

Thanks for your information !

----

So it seems that there are 2 troubles :
- the group of /dev/kvm : I have to check how this group is set (maybe it's one of my script)
- the restart of libvirt-bin daemon : does everyone have to do this or is it a trouble of my environment ?

Revision history for this message
Daniel Baumann (dnjl) wrote :

libvirt 0.7.5 wil run qemu/kvm hypervisor as user libvirt-qemu group libvirtd.
so add user libvirt-qemu to group kvm to make qemu use of kvm. The same vor kqemu.
In next release libvirt >=0.7.5-2ubuntu0~dnjl1) this is automatically done in postinst.

Thanks!

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

Not a bug in Ubuntu's libvirt package

Changed in libvirt (Ubuntu):
status: New → Invalid
Revision history for this message
Id2ndR (id2ndr) wrote :

I changed the group bug it still doesn't use kvm.

$ groups libvirt-qemu
libvirt-qemu : libvirtd kvm

As strange as it can be, when I run the kvm same command as user libvirt-qemu it appears that kvm is used (I can't remove the module), but not when using virt-manager.
I checked euid et ruid of the process without founding any solution, and I have no idea for an explanation.

Revision history for this message
Id2ndR (id2ndr) wrote :

I just update the packages that added libvirt-qemu to kqemu too but doesn't solve the trouble. I still have to change the permissions of /dev/kvm. Am I the only one that encountered this trouble ?

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.