libvirt error when trying to 'hot' attach-disk on guest with “Channel qemu-ga”

Asked by Maxim

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.

What is difference, how to solve that?

I use Virtual Machine Manager 1.3.0 with qemu-kvm 2.3.

CentOS and Debian - clean installation.

=================================

UPDATE:

I have a comment!

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>
</channel>

Then I removed "channel qemu-ga", restarted VM and checked "hot add" feature. It's worked!!

I tested it on other VMs (CentOS, Fedora, Debian) and saw the same.

As a result:

    If enable qemu-agent i cannot use hot plug.
    If use "hot plug" i must forget about agent.

Is it my mistake in configuration or these features can't work together?

Host-OS: Ubuntu 15.10

QEMU emulator: now 2.4.92 (tested 2.3 and 2.4.1)

VMM: 1.3.0

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu libvirt Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

I suggest you post on a CentOS forum.

Revision history for this message
Maxim (fatherice) said :
#2

Forgot to specify:
My host OS is Ubuntu.

Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

But the issue is in the CentOS guest. Other guests work (as you said) so the issue is in the guest

Can you help with this problem?

Provide an answer of your own, or ask Maxim for more information if necessary.

To post a message you must log in.