Public bug reported:

[Impact]

Some times libvirt fails to start a vm with the following error : 
libvirt:  error : unable to set AppArmor profile 
'libvirt-b05b297f-952f-42d6-b04e-f9a13767db54' for '/usr/bin/kvm-spice': No 
such file or directory

This happens because for some reason file
/etc/apparmor.d/libvirt/libvirt-<vm-uuid> has 0 size.

Although, we do not now why the above file gets truncated and therefore we do 
not know the root cause, I open this bug to come up with a way to mitigate the 
issue.
E.g. when  libvirt sees that this file is 0-size to delete it and create it 
again.

[Test case]

To reproduce this behaviour, create a vm and stop it, note the uuid.
Then :

## touch /etc/apparmor.d/libvirt/libvirt-<vm-uuid>
# touch /etc/apparmor.d/libvirt/libvirt-b05b297f-952f-42d6-b04e-f9a13767db54
# ls -la libvirt-b05b297f-952f-42d6-b04e-f9a13767db54
-rw-r--r-- 1 root root 0 May  6 18:46 
libvirt-b05b297f-952f-42d6-b04e-f9a13767db54

Try to start the vm, it will fail with :
libvirt:  error : unable to set AppArmor profile 
'libvirt-b05b297f-952f-42d6-b04e-f9a13767db54' for '/usr/bin/kvm-spice': No 
such file or directory 

To be able to start the vm again just delete the libvirt-<vm-uuid> file.

[Regression Potential]

TBD

[Other]

Similar reported bug : https://bugs.debian.org/cgi-
bin/bugreport.cgi?bug=890084

** Affects: libvirt (Ubuntu)
     Importance: Medium
         Status: Confirmed

** Changed in: libvirt (Ubuntu)
   Importance: Undecided => Medium

** Changed in: libvirt (Ubuntu)
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1927519

Title:
  Mitigate libvirt: error : unable to set AppArmor profile 'libvirt-<vm-
  uuid>' for '/usr/bin/kvm-spice': No such file or directory

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1927519/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to