Apparmor prevents using storage pools and hostdev networks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt |
New
|
Unknown
|
|||
libvirt (Ubuntu) |
Triaged
|
Medium
|
Unassigned | ||
Xenial |
Won't Fix
|
Undecided
|
Unassigned | ||
Yakkety |
Won't Fix
|
Undecided
|
Unassigned | ||
Zesty |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Apparmor prevents qemu-kvm guests from using ZFS volumes.
[Impact]
* storage pools are not usable.
Examples with zfs and LVM pools
[Test Case 1]
# Prep ZFS
1) Create a zpool
$ for i in $(seq 1 3); do dd if=/dev/zero of=/tmp/fdisk${i} bs=1M count=1024; done
$ sudo zpool create internal /tmp/fdisk*
2) Create a ZFS storage pool and volume (named like your zpool, "internal" here)
$ virsh pool-define-as internal zfs
$ virsh pool-start internal
$ virsh vol-create-as internal foo 2G
# prep LVM
4) prepare a (fake) LVM
$ for i in $(seq 1 3); do dd if=/dev/zero of=/tmp/lvdisk${i} bs=1M count=1024; done
$ sync
$ DISKS=$(for i in $(seq 1 3); do sudo losetup -f --show /tmp/lvdisk${i}; done)
$ sudo pvcreate --verbose $DISKS
$ sudo vgcreate --verbose testvg $DISKS
5) Create LVM Pool and volume
$ virsh pool-define-as testvg logical
$ virsh pool-start testvg
$ virsh vol-create-as testvg guest1 2G
# Prep Guest and use Pools
6) Create a KVM guest e.g. via uvtool
$ uvt-simplestrea
$ ssh-keygen
$ uvt-kvm create --password=ubuntu testguest release=xenial arch=amd64 label=daily
7) Edit the guest's XML profile to use the ZFS and LVM volumes (zvol)
<disk type='volume' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source pool='internal' volume='foo'/>
<target dev='vda' bus='virtio'/>
</disk>
<disk type='volume' device='disk'>
<driver name='qemu' type='raw'/>
<source pool='testvg' volume='guest1'/>
<target dev='vda' bus='virtio'/>
</disk>
8) Start the guest
The guest refuses to start:
# virsh start nms
error: Failed to start domain foo
error: internal error: process exited while connecting to monitor: 2017-03-
dmesg reveals the culprit:
apparmor="DENIED" operation="open" profile=
apparmor="DENIED" operation="open" profile=
Checking /etc/apparmor.
[Additional info]
# lsb_release -rd
Description: Ubuntu 16.04.2 LTS
Release: 16.04
# apt-cache policy libvirt-bin apparmor linux-image-generic
libvirt-bin:
Installed: 1.3.1-1ubuntu10.8
Candidate: 1.3.1-1ubuntu10.8
Version table:
*** 1.3.1-1ubuntu10.8 500
500 http://
100 /var/lib/
1.
500 http://
apparmor:
Installed: 2.10.95-0ubuntu2.5
Candidate: 2.10.95-0ubuntu2.5
Version table:
*** 2.10.95-0ubuntu2.5 500
500 http://
100 /var/lib/
2.
500 http://
linux-image-
Installed: 4.4.0.70.76
Candidate: 4.4.0.70.76
Version table:
*** 4.4.0.70.76 500
500 http://
500 http://
100 /var/lib/
4.4.0.21.22 500
500 http://
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: libvirt-bin 1.3.1-1ubuntu10.8
ProcVersionSign
Uname: Linux 4.4.0-70-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.1-0ubuntu2.5
Architecture: amd64
Date: Wed Mar 29 17:48:06 2017
SourcePackage: libvirt
UpgradeStatus: No upgrade log present (probably fresh install)
modified.
modified.
modified.
mtime.conffile.
mtime.conffile.
mtime.conffile.
Changed in libvirt (Ubuntu Yakkety): | |
status: | New → Confirmed |
Changed in libvirt (Ubuntu Xenial): | |
status: | New → Confirmed |
tags: | added: virt-aa-helper |
tags: | removed: server-next |
Changed in libvirt (Ubuntu Yakkety): | |
status: | Confirmed → Won't Fix |
Changed in libvirt (Ubuntu): | |
status: | Confirmed → In Progress |
Changed in libvirt (Ubuntu Zesty): | |
assignee: | ChristianEhrhardt (paelzer) → nobody |
summary: |
- Apparmor prevents using ZFS storage pools + Apparmor prevents using storage pools |
Changed in libvirt (Ubuntu): | |
importance: | Undecided → Medium |
tags: | added: libvirt-apparmor-dev |
description: | updated |
Changed in libvirt: | |
status: | Unknown → New |
Changed in libvirt (Ubuntu): | |
assignee: | Christian Ehrhardt (paelzer) → nobody |
Hi Simon,
thanks for your report - so we did not get far enough with bug 1641618 which only solved things for direct zvols, but not for disks from a pool.
I'm afraid there might be no part generating that yet in the aa-helper, but I'll look into it and report back here once I know more details.