[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2025-02-04 Thread Christian Ehrhardt
Ref for internal backlog tracking: SD-1070 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1677398 Title: Apparmor prevents using storage pools and hostdev networks To manage notifications about this

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2025-02-04 Thread Christian Ehrhardt
Hi Martin, first of all sorry and I totally understand that this can be annoying if you face it and wonder why it fails. I think you bring a nice thought to the case that wasn't very present so far. > I don't understand why after 8 years this still fails in a way ... The short and honest answer

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2025-02-01 Thread Martin Wilck
I just pulled my hair over this issue, trying to use a pool volume on Debian 12. I gather from the gitlab issue that there's still no solution on the horizon. I also gather that a general solution is hard to find. I don't understand that exactly but I can see that there are lots of different type

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2022-05-20 Thread Bug Watch Updater
** Changed in: libvirt Status: Unknown => New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1677398 Title: Apparmor prevents using storage pools and hostdev networks To manage notifications

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2021-03-08 Thread Christian Ehrhardt 
Also check bug 1573192 if it might be resolved by this as well. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1677398 Title: Apparmor prevents using storage pools and hostdev networks To manage not

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2021-02-23 Thread Christian Ehrhardt 
This now has a related upstream issue https://gitlab.com/libvirt/libvirt/-/issues/135 ** Bug watch added: gitlab.com/libvirt/libvirt/-/issues #135 https://gitlab.com/libvirt/libvirt/-/issues/135 ** Also affects: libvirt via https://gitlab.com/libvirt/libvirt/-/issues/135 Importance: Unkn

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-11-23 Thread Christian Ehrhardt 
Hi Yury, until implemented for real adding apparmor rules for the uncommon paths are the way to go. The difference I'd suggest to your solution is to use local overrides since they will neither prompt you nor be overwritten on updates. This can be done in: # allow virt-aa-helper to generate per-

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-11-21 Thread Yury Bushmelev
I hit this issue today when trying `terraform-provider-libvirt`. So I spent some time debugging it. Below are my findings. 1. Dir-based pools are affected. I didn't tried with default one as I created custom storage pool in terraform (`/srv/libvirt/images`). Then I was able to catch `/etc/apparmor

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-11-16 Thread Thiago Martins
I found the quick "fix"... "Double check that `security_driver = "none"` is uncommented in `/etc/libvirt/qemu.conf` and issue `sudo systemctl restart libvirt-bin` to restart the daemon." https://github.com/dmacvicar/terraform-provider-libvirt/commit/22f096d9 Doesn't sound good. But it worked! l

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-11-16 Thread Thiago Martins
Hey guys, I'm trying to play with Terraform and it's failing too! Ubuntu 20.04.1. Guide: https://fabianlee.org/2020/02/22/kvm-terraform-and-cloud-init-to-create- local-kvm-resources/ NOTE: I'm using the latest "terraform-provider-libvirt-0.6.3" binary for Ubuntu 20.04. The "terraform apply" fa

Re: [Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-09-07 Thread Christian Ehrhardt 
> There is a comment in this bug that says that dir based pools aren't > affected, but it seems they are. Should probably be more like: Dir based with full path work, Dir based with just filename needs path from the pool and fails. > Here's the disk definition in XML using > a "default" named poo

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-09-07 Thread giannoug
There is a comment in this bug that says that dir based pools aren't affected, but it seems they are. Here's the disk definition in XML using a "default" named pool that resides in /var/lib/libvirt/images. Starting the VM with virsh start, yield the following error in dmesg: [10757

Re: [Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-09-06 Thread Christian Ehrhardt 
> I stumbled upon the same issue but with dir based pools. I have all > relevant information posted on a SO question, do you want me to paste > them here too? Thanks George, yeah this is another case where it would need to "talk back to the storage subsystem" of libvirt to get info from the pools

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-09-06 Thread George Giannou
I stumbled upon the same issue but with dir based pools. I have all relevant information posted on a SO question, do you want me to paste them here too? The question is here: https://stackoverflow.com/questions/63767647/virt-aa-helper-doesnt-add- path-for-storage-pool-in-apparmor-generated-rules -

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-07-29 Thread Garry Lawrence
I finally had time to revisit this. It appears that not only did my patch not connect to the remote libvirtd storage driver (as Christian pointed out), but that the storage driver does not establish remote connections at all. As such, I agree with Christian that my patch is a dead-end and would als

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-05-26 Thread Christian Ehrhardt 
Hi Garry, thanks for your reply. Q: what do you mean by "setting up a new storage context" in your last comment? A: the code was not only trying to connect to libvirtd, by tracking in gdb I found that it was also trying to itself do some actions that would make virt-aa-helper behave like the bac

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-05-26 Thread Garry Lawrence
Thanks for subscribing me; I'm a launchpad newbie and didn't realize that wasn't automatic when I posted here. I'll try to answer your questions to the best of my recollection. #1 I can't remember exactly why I needed to drop the storage driver load; I think the local storage driver it started di

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-05-26 Thread Christian Ehrhardt 
FYI after some debugging I was chatting with libvirt upstream and setting up a new storage context inside virt-aa-helper really won't work architecturally. But I've found as part of the same discussion that there is a chance we can move the profile load a bit back until after qemuProcessPrepareDom

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-05-26 Thread Christian Ehrhardt 
Iterating over the usual disks into the pools. (gdb) p *disk->src->srcpool $9 = {pool = 0x565040c0a590 "internal", volume = 0x565040c09ad0 "foo", voltype = 0, pooltype = 0, actualtype = 0, mode = 0} (gdb) p *disk->src->srcpool $11 = {pool = 0x565040c093d0 "testvg", volume = 0x565040c09650 "guest1"

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-05-26 Thread Christian Ehrhardt 
I was giving this a try PPA: https://launchpad.net/~paelzer/+archive/ubuntu/lp-1677398-pool-experiment-groovy Changes: - Add a silly sleep to catch it in flight more easily - add the core elment of the patch around virDomainDiskTranslateSourcePool - build without optimization - install related de

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-05-26 Thread Christian Ehrhardt 
Indeed the read to /etc/libvirt/libvirt.conf is from the call to virDomainDiskTranslateSourcePool as I have assumed above. [ 628.266012] audit: type=1400 audit(1590487555.258:74): apparmor="DENIED" operation="open" profile="virt-aa-helper" name="/etc/libvirt/libvirt.conf" pid=3683 comm="virt-aa-h

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-05-26 Thread Christian Ehrhardt 
** Description changed: Apparmor prevents qemu-kvm guests from using ZFS volumes. [Impact] * storage pools are not usable. - Examples with zfs and LVM pools +   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/ze

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-05-26 Thread Christian Ehrhardt 
FYI - dir based pools already work if they are in a common and expected path like seen in /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper @{HOME}/ r, @{HOME}/** r, /var/lib/libvirt/images/ r, /var/lib/libvirt/images/** r, # nova base images (LP: #907269) /var/lib/nova/images/** r, /v

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-05-26 Thread Christian Ehrhardt 
Hi Garry, why thanks for the patch - I was missing that update earlier in the year and beg your pardon. #1 Why did you drop the "load the storage driver so that backing store can be accessed" section - that will continue to be needed at least for other storage types so I wonder why this was dro

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-05-26 Thread Christian Ehrhardt 
I have subscribed Garry to increase the chance he is seeing and replying to my questions? -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1677398 Title: Apparmor prevents using storage pools and hostd

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-02-03 Thread Ubuntu Foundations Team Bug Bot
The attachment "virt-aa-helper-support-pools.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team. [This is an automated message performed by a Launchpad user owne

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2020-02-03 Thread Garry Lawrence
I've written a quick patch that seems to fix the storage pool side of this issue, at least for dir/fs like pool types. It does connect to the libvirtd socket; I saw that there was some concern with that approach earlier, but this solution didn't require any changes to virt-aa- helper's calling conv

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2019-03-25 Thread Christian Ehrhardt 
Hi Nicolas, yeah that isn't easy to fix and at least I didn't find the time to develop something completely new to cover this yet. I challenge the statement "Even the default storage pool /var/lib/libvirt/images is not working", it does and it does well. And for things that are under the control

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2019-03-24 Thread Nicolas Wild
The linked/original bug is quite old. Looks not like there is a quick solutions. Looks like many people have that issue now with the terraform libvirt provider. Even the default storage pool /var/lib/libvirt/images is not working. audit: type=1400 audit(1553443109.481:44): apparmor="DENIED" opera

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2019-01-10 Thread Kristjan Kullerkann
Up, causing issues with terraform libvirt provider :/ -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1677398 Title: Apparmor prevents using storage pools and hostdev networks To manage notifications

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2018-03-19 Thread Seth Arnold
Hi Ultrabit, can you please include the DENIED lines from your dmesg or auditd logs? Thanks -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1677398 Title: Apparmor prevents using storage pools and ho

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2018-03-17 Thread ultrabit
I have the same problem using raw lvm logical volumes as disk on Ubuntu 18.04. When i try to start a vm with virt-manager qemu says Permission denied on device. The lvm uses device mapper to map the logical volumes so i need to handle devices like brw-rw 1 libvirt-qemu kvm 253, 4 mar 17 1

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2018-01-26 Thread ChristianEhrhardt
** Tags added: libvirt-apparmor-dev -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1677398 Title: Apparmor prevents using storage pools and hostdev networks To manage notifications about this bug go

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2018-01-10 Thread ChristianEhrhardt
TODO: retest these with the domain label callbacks implemented, maybe some of the devices/images might trigger that -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1677398 Title: Apparmor prevents usi

[Bug 1677398] Re: Apparmor prevents using storage pools and hostdev networks

2018-01-10 Thread ChristianEhrhardt
In the same scope of required "out of context information" fall cases of vfio devices for hostdevs. Those work fine if defined in the guest or added to the guest. But if only referred by an interface like: And the definition being external like: pf-et0p0

[Bug 1677398] Re: Apparmor prevents using storage pools

2017-09-19 Thread ChristianEhrhardt
I found that bug 1343245 is about the same general issue. The descriptions in there were great, but since I started to document the debug and potential coding and more here I dupp'ed it onto here. The thoughts there also already were around "how to get the translation done". I changed title and d

[Bug 1677398] Re: Apparmor prevents using storage pools

2017-09-19 Thread ChristianEhrhardt
** Changed in: libvirt (Ubuntu) Importance: Undecided => Medium -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1677398 Title: Apparmor prevents using storage pools To manage notifications about t

[Bug 1677398] Re: Apparmor prevents using storage pools

2017-09-19 Thread ChristianEhrhardt
** Summary changed: - Apparmor prevents using ZFS storage pools + Apparmor prevents using storage pools -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1677398 Title: Apparmor prevents using storage