Red Hat Bugzilla – Bug 1288558
libvirt error when trying to 'hot' attach-disk on guest with “Channel qemu-ga”
Last modified: 2016-04-10 18:47:59 EDT
Description of problem:
I have KVM virtual machine running CentOS 7 as guest OS. I'm trying to attach an additional disk to it on the run (without shutting it down) using this command:
$ sudo virsh attach-disk centos --source /var/lib/libvirt/images/newdisk.img --target sdb --persistent
But receive an error:
error: Failed to attach disk
error: internal error: cannot update AppArmor profile 'libvirt-d2e7bbb8-c7b3-44ec-b0ea-27539e0df732'
If I do the same with Debian guest - everything is ok.
I compared two VM's xml and saw that CentOS have QEMU-agent in his configuration:
<source mode="bind" path="/var/lib/libvirt/qemu/channel/target/centos_auto.org.qemu.guest_agent.0"></source>
<target name="org.qemu.guest_agent.0" type="virtio"></target>
<address bus="0" controller="0" port="1" type="virtio-serial"></address>
Then I removed "channel qemu-ga", restarted VM and checked "hot add" feature. It worked.
I tested it on other VMs (CentOS, Fedora, Debian) and saw the same.
Version-Release number of selected component (if applicable):
Host-OS: Ubuntu 15.10
QEMU: 2.3 and 2.4.1
As a result:
1. If enable qemu-agent (Channel qemu-ga) i cannot use hot plug.
2. If use "hot plug" i must forget about agent.
Is it my mistake in configuration or these features can't work together?
Forgot to write: This problem occurs only on the host where AppArmor installed.
I think it was fixed by this:
Author: Serge Hallyn <firstname.lastname@example.org>
Date: Fri Apr 10 20:21:03 2015 +0000
virt-aa-helper: add unix channels (esp for qemu-guest-agent)