All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Harry G. Coin" <hgcoin@gmail.com>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: virtio-fs@redhat.com
Subject: Re: [Virtio-fs] virtiofs mounted filesystems & SELinux
Date: Fri, 4 Jun 2021 09:50:34 -0500	[thread overview]
Message-ID: <fd336c79-b715-5548-ce3c-f357c44f14ed@gmail.com> (raw)
In-Reply-To: <20210604141147.GD269481@redhat.com>

Hi Vivek,

I've cut the o.p.'s text as your questions and my answers are off-topic
to his interest.

On 6/4/21 9:11 AM, Vivek Goyal wrote:

> You are using virtiofs as rootfs and upgrade breaks? If virtiofs is
> being used only as volumes, then its outside the upgrade path. Will
> like to know what broke for you. Was it all SELinux related or something
> else.

Seems 100% selinux related -- even in permissive mode on the guest. 
Here's your short-and-sweet 100% reproducer:  
https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1930756  There's a
similar bug report on redhat.

Even with selinux set to permissive in the guest, no selinux installed
in the host, but with xattrs on, no and no xattr mapping, lsetfilecon
returns with a permission error.  The files on the host are entirely
dedicated to the guest -- no use of those files is made on the host. 
Underlying fs on the host is btrfs.
>> You'll have to learn a fair few quite obscure selinux
>> commands to get it to comprehend virtiofs is a filesystem and not flood
>> your logs, use the 'xml' features of virtual machine manager to get the
>> bits of virtiofs you want enabled properly (like 'numa',
> I am assumig libvirt takes care of specifying "numa" stuff? Is that
> not the case?

Not outside the lab.  There is no virt-manager GUI way to coordinate
memory allocation with hugepages/numa.  Hand-editing the xml is required
to manually match the numa set-aside with the memory allocation.  If
reliability is important, unless you use systctl.d to set aside the
hugepages the system can randomly not launch the guests owing to lack of
sufficient contiguous memory at guest launch time.

>> learn what
>> 'hugepages' are and do the math on each host to set enough of those
>> aside with in sysctl.d (e.g. vm.nr_hugepages = 11776) ,
> What's the virtiofs dependency on vm.nr_hugepages? I think I am not
> aware of this aspect.

Detailed here https://libvirt.org/kbase/virtiofs.html


>
>> and also accept
>> some versions of hosts and guests will develop incompatibilities so
>> severe you'll have to restore to backups and downgrades from time to
>> time.  And you won't be able to use virtiofs as a root filesystem
>> without patching dracut config directories (search this list) or
>> compiling your own custom kernel.  But you will learn a whole lot.
> Agreed that dracut does not seem to have support to mount virtiofs
> as rootfs. That's one TODO item. 

I've done it. It's been working for months, automatically maintained and
updated through both host and guest kernel upgrades.  I haven't posted
the bit that updates the kernel / initrd links for direct kernel launch
(using initrds) but I have posted what's needed for dracut to make
rootfs virtiofs work.

All that's required for stability -- for now -- is for the host to treat
the files shared on the guest as 'unusable' while the guest is running
-- or at least 'read only'.

> I am assuming you prefer using virtiofs as rootfs for your VMs and
> that's why running into these dracut related issues.

Let me restate -- I am NOT having a dracut issue.  I solved that long
ago and it works very well.   In fact the whole virtiofs thing was
working very well (without dax as main-distro kernels still lack the pci
bar in the host) -- until a regression in the last few weeks that broke
rpm / dnf / yum (noted above, even with permissive on the guest
lsetfilecon returns a permission error blocking all dnf operations). 
The only 'maintainable' way forward I can see is to reduce the number of
core packages involved.  The disk space required for a basic workstation
or server image is 'small' by today's storage standards.  I see no
reason multiply complexities by implementing one host-guest relationship
for 'booting' a guest and another for 'the files on the guest'.  Making
it possible to just snapshot one directory tree on the host and know
everything important to the guest is there -- that's a big win.

Harry





  reply	other threads:[~2021-06-04 14:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2234280.ElGaqSPkdT@subpop>
2021-06-02 20:55 ` [Virtio-fs] virtiofs mounted filesystems & SELinux Connor Kuehl
2021-06-02 21:18   ` Harry G. Coin
2021-06-03 18:48   ` Link Dupont
2021-06-03 19:24     ` Dr. David Alan Gilbert
2021-06-04  0:56       ` Link Dupont
2021-06-04  2:14         ` Link Dupont
2021-06-04 13:30           ` Harry G. Coin
2021-06-04 14:11             ` Vivek Goyal
2021-06-04 14:50               ` Harry G. Coin [this message]
2021-06-04 13:44           ` Vivek Goyal
2021-06-04 13:59             ` Daniel P. Berrangé
2021-06-04 14:43               ` Vivek Goyal
2021-06-04 14:52                 ` Daniel P. Berrangé
2021-06-07 13:01               ` Daniel Walsh
2021-06-07 14:05                 ` Link Dupont
2021-06-07 14:15               ` Daniel P. Berrangé
2021-06-07 14:37                 ` Harry G. Coin
2021-06-08 15:55                   ` Dr. David Alan Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fd336c79-b715-5548-ce3c-f357c44f14ed@gmail.com \
    --to=hgcoin@gmail.com \
    --cc=vgoyal@redhat.com \
    --cc=virtio-fs@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.