I am trying to create a snapshot for an existing domain using the following command.

virsh snapshot-create-as test-vm test-backup "test-backup-1" --disk-only --atomic --no-metadata

I get the following error when I run the above command.

error: internal error: cannot update AppArmor profile 'libvirt-<uuid>'

Investigating further, I can see the following errors in the /var/log/libvirt/libvirtd.log file.

2018-03-15 22:11:56.950+0000: 30655: error : virCommandWait:2399 : internal error: Child process (/usr/lib/libvirt/virt-aa-helper -p 0 -r -u libvirt- -f /var/lib/libvirt/images/test-vm) unexpected exit status 1: virt-aa-helper: error: could not parse XML virt-aa-helper: error: could not get VM definition

2018-03-15 22:11:56.951+0000: 30655: error : AppArmorSetSecurityImageLabel:717 : internal error: cannot update AppArmor profile 'libvirt-' 2018-03-15 22:11:56.959+0000: 30655: error : virCommandWait:2399 : internal error: Child process (/usr/lib/libvirt/virt-aa-helper -p 0 -r -u libvirt-) unexpected exit status 1: virt-aa-helper: error: could not parse XML virt-aa-helper: error: could not get VM definition

2018-03-15 22:11:56.959+0000: 30655: error : reload_profile:288 : internal error: cannot update AppArmor profile 'libvirt-' 2018-03-15 22:11:56.959+0000: 30655: warning : qemuDomainPrepareDiskChainElement:12020 : Unable to restore security label on /var/lib/libvirt/images/test-vm

I have a suspicion this is all related to apparmor, so I tried disabling apparmor on the profile.

sudo aa-complain /etc/apparmor.d/libvirt/libvirt-<uuid>

But that doesn't help, same errors as before.

Observations

I am able to dump out the live xml and see the seclabel that the virt-aa-helper is having issues parsing using the virsh dumpxml test-vm command but when I try to edit the config with virsh edit test-vm the seclabels don't show up.

I did notice that when I remove the --disk-only flag then the snapshot will work but isn't ideal because it is pausing the VM, which I don't want to do.

Libvirtd is libvirtd (libvirt) 1.2.2 on Ubuntu 14.04.4.

Is there anything else obvious that I'm missing here? How can I fix this?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.