Bug 1288558 - libvirt error when trying to 'hot' attach-disk on guest with “Channel qemu-ga”
libvirt error when trying to 'hot' attach-disk on guest with “Channel qemu-ga”
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
Depends On:
  Show dependency treegraph
Reported: 2015-12-04 10:04 EST by Maxim
Modified: 2016-04-10 18:47 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-04-10 18:47:59 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Maxim 2015-12-04 10:04:26 EST
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:

<channel type="unix">
<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
Libvirtd: 1.2.16
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?
Comment 1 Maxim 2015-12-11 03:34:08 EST

Forgot to write: This problem occurs only on the host where AppArmor installed.
Comment 2 Cole Robinson 2016-04-10 18:47:59 EDT
I think it was fixed by this:

commit 03d7462d87011c3db2ae82ae14d56d2979d92f0c
Author: Serge Hallyn <serge.hallyn@ubuntu.com>
Date:   Fri Apr 10 20:21:03 2015 +0000

    virt-aa-helper: add unix channels (esp for qemu-guest-agent)

Note You need to log in before you can comment on or make changes to this bug.