From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 85FF791F95 for ; Thu, 5 Oct 2023 10:57:37 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 66F411581B for ; Thu, 5 Oct 2023 10:57:07 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 5 Oct 2023 10:57:05 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 9D48944852 for ; Thu, 5 Oct 2023 10:57:04 +0200 (CEST) Date: Thu, 05 Oct 2023 10:56:58 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20230809083739.100024-1-m.frank@proxmox.com> <20230809083739.100024-4-m.frank@proxmox.com> In-Reply-To: <20230809083739.100024-4-m.frank@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1696494947.lj3xmc46wa.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL -0.088 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH docs v7 3/11] added shared filesystem doc for virtio-fs X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Oct 2023 08:57:37 -0000 On August 9, 2023 10:37 am, Markus Frank wrote: > Signed-off-by: Markus Frank > --- > qm.adoc | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 68 insertions(+), 2 deletions(-) >=20 > diff --git a/qm.adoc b/qm.adoc > index e35dbf0..8f4020d 100644 > --- a/qm.adoc > +++ b/qm.adoc > @@ -997,6 +997,71 @@ recommended to always use a limiter to avoid guests = using too many host > resources. If desired, a value of '0' for `max_bytes` can be used to dis= able > all limits. > =20 > +[[qm_virtiofs]] > +Virtio-fs > +~~~~~~~~~ > + > +Virtio-fs is a shared file system, that enables sharing a directory betw= een > +host and guest VM while taking advantage of the locality of virtual mach= ines > +and the hypervisor to get a higher throughput than 9p. > + > +Linux VMs with kernel >=3D5.4 support this feature by default. > + > +There is a guide available on how to utilize virtiofs in Windows VMs. > +https://github.com/virtio-win/kvm-guest-drivers-windows/wiki/Virtiofs:-S= hared-file-system > + > +Add mapping for Shared Directories > +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > + > +To add a mapping, go to the Resource Mapping tab in Datacenter in the We= bUI, > +use the API directly with pvesh as described in the > +xref:resource_mapping[Resource Mapping] section, > +or add the mapping to the configuration file `/etc/pve/mapping/dir.cfg`: > + > +---- > +some-dir-id > + map node=3Dnode1,path=3D/mnt/share/,submounts=3D1 > + map node=3Dnode2,path=3D/mnt/share/, > + xattr 1 > + acl 1 > +---- > + > +Set `submounts` to `1` when multiple file systems are mounted in a > +shared directory. > + > +Add virtiofs to VM > +^^^^^^^^^^^^^^^^^^ > + > +To share a directory using virtio-fs, you need to specify the directory = ID > +(dirid) that has been configured in the Resource Mapping. Additionally, = you > +can set the `cache` option to either `always`, `never`, or `auto`, depen= ding on > +your requirements. If you want virtio-fs to honor the `O_DIRECT` flag, y= ou can > +set the `direct-io` parameter to `1`. > +Additionally it possible to overwrite the default mapping settings > +for xattr & acl by setting then to either `1` or `0`. > + > +The `acl` parameter automatically implies `xattr`, that is, it makes no > +difference whether you set xattr to `0` if acl is set to `1`. > + > +---- > +qm set -virtiofs0 dirid=3D,tag=3D,cache=3Dalway= s,direct-io=3D1 > +qm set -virtiofs1 ,tag=3D,cache=3Dnever,xattr= =3D1 > +qm set -virtiofs2 ,tag=3D,acl=3D1 nit: the mount tag is not settable anymore in this version some more caveats and limitations would be nice in the docs IMHO! > +---- > + > +To mount virtio-fs in a guest VM with the Linux kernel virtiofs driver, = run the > +following command: > + > +The dirid associated with the path on the current node is also used as t= he > +mount tag (name used to mount the device on the guest). > + > +---- > +mount -t virtiofs > +---- > + > +For more information on available virtiofsd parameters, see the > +https://gitlab.com/virtio-fs/virtiofsd[GitLab virtiofsd project page]. > + > [[qm_bootorder]] > Device Boot Order > ~~~~~~~~~~~~~~~~~ > @@ -1600,8 +1665,9 @@ in the relevant tab in the `Resource Mappings` cate= gory, or on the cli with > # pvesh create /cluster/mapping/ > ---- > =20 > -Where `` is the hardware type (currently either `pci` or `usb`) an= d > -`` are the device mappings and other configuration parameters. > +Where `` is the hardware type (currently either `pci`, `usb` or > +xref:qm_virtiofs[dir]) and `` are the device mappings and other > +configuration parameters. > =20 > Note that the options must include a map property with all identifying > properties of that hardware, so that it's possible to verify the hardwar= e did > --=20 > 2.39.2 >=20 >=20 >=20 > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel >=20 >=20 >=20