From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Daniel Kral <d.kral@proxmox.com>,
Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH container v2 03/11] alloc_disk: fail fast if storage does not support content type rootdir
Date: Tue, 15 Apr 2025 16:19:10 +0200 [thread overview]
Message-ID: <1744725224.c1q2wtkmtz.astroid@yuna.none> (raw)
In-Reply-To: <wp6iyf3ylrdu2lgrcrmhfk57x2j3xgsyvzntmphw33j6asmjdp@6inpwihnpyvk>
On April 15, 2025 3:31 pm, Wolfgang Bumiller wrote:
> On Tue, Apr 15, 2025 at 02:27:24PM +0200, Daniel Kral wrote:
>> On 2/20/25 13:15, Fiona Ebner wrote:
>> > I also noticed that we have no check against starting a container with
>> > volumes on a storage that does not support 'rootdir'. We have such a
>> > check for VMs IIRC. Prohibiting that would also be good, but maybe
>> > something for PVE 9 where we can also check for misconfigured
>> > containers/storages via the pve8to9 script up front so users can adapt.
>>
>> I'm preparing the v3 for this now, but I just noticed there actually is a
>> assertion for this since e6da5357cc ("fix #3421: allow custom storage
>> plugins to support rootfs") if I'm not missing something here in
>> __mountpoint_mount(...).
>>
>> What I don't yet understand is why there is no similar check for this in
>> __mountpoint_mount for subvolumes, e.g. I can't start the container if I
>> have a mountpoint on a directory storage without 'rootdir' support, but I
>> can do so if the mountpoint is on a zfs pool without 'rootdir' support.
>>
>> Since starting the container results in
>>
>> run_buffer: 571 Script exited with status 25
>> lxc_init: 845 Failed to run lxc.hook.pre-start for container "101"
>> __lxc_start: 2034 Failed to initialize container "101"
>> TASK ERROR: startup for container '101' failed
>>
>> for the WebGUI, I'll try to squeeze in a patch to make the error message a
>> little more readable if there's something going wrong when mounting.
>>
>> ---
>>
>> On another note, I've also noticed that if the root disk / mountpoint is
>> already on a storage which does not support 'rootdir', the user is unable to
>> move it to another storage... Shouldn't we allow users to do that so they
>> can easily move out error states? Either way, this can be a follow-up anway,
>> so no need to make this patch series any longer.
>
> The `rootdir` content type is generally a bit wonky currently.
> The problem is we're mixing content types and "allowed contents"
> together:
>
> For ZFS and btrfs we use subvolumes which are their own *content type*:
> "subvol".
no? that's just the format, not the volume type.
>
> For *other* directory storages, we have a special case for `size=0`
> where we have a directory of an "unlimited" size, which is also
> considered to be of *content type* "subvol".
same here
> In the other case we actually allocate the content type *image*,
> *BUT*(!!!) the Plugin.pm's default `list_volumes` implementation will
> artificially *name* it "rootdir" *if* the *associated VMID* is from a
> container by querying the VM list via `PVE::Cluster::get_vmlist()`.
> This is not something we can ask external storage plugin devs to do,
> IMO.
yes
> *rootdir* as an actual *content type* does not *really* exist in
> pve-storage, other than as a remnant from openvz times for directories
> under the `rootdir/` directory on a directory storage, which I'm fairly
> certain we don't support in pve-container...
it was actually `private`, and yes, this is not used anymore other than
if you happen to have a system upgraded from PVE < 4 that still has
images that are not usable in practice lying around..
>
> This means that currently what is referred to as the "rootdir" content
> type is actually just the *permission* to put containers on the storage.
>
> This is something we really need to fix up with PVE9 one way or another.
> Personally I'd argue the content type should disappear entirely.
> `list_volumes` should call use the correct type (images or subvol), and
> the rootdir content permission should (and always / indepenent from the
> storage and what *content type* we create) in pve-container's disk
> allocation code.
yes, there are basically three levels involved
- content type on the storage itself - this defines what you can put on
the storage, and it properly differentiates between rootdir and images
- volume type as returned by parse_volname and consumed by other storage
helpers (often abbreviated vtype) - this very often cannot
differentiate whether a volume of type image is an image or a rootdir
(this is something we want to change, but it's a tricky and long
migration path)
- image format (raw, qcow2, subvol, ..)
also see Max' pve-storage series thread, where some of this came up
during review as well. but the TL;DR (for now) is: when looking at what
a storage can store, check for rootdir for containers. when looking
whether a volume has the expected type, check for rootdir or image. when
actually handling it, also check the format to decide what to do with
it.
the issue is that for properly differentiating between 'images' and
'rootdir' on the storage level, we need to split them both on the volid
level (so we can differentiate without asking the storage) and on the
storage level (so we can map back from the things we find on the storage
to a volid). and somehow handle transitioning from the current mess to a
cleanly separated state, and coordinate this with external plugins as
well. Fiona and me had some chats about that already in the past, maybe
we should sit down next week and make a concrete plan?
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-04-15 14:19 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-11 16:07 [pve-devel] [PATCH container/qemu-server/storage v2 00/31] consistent assertions for volume's content types Daniel Kral
2025-02-11 16:07 ` [pve-devel] [PATCH pve-storage v2 1/5] api: {upload, download}_url: factor out common parameter hash accesses Daniel Kral
2025-02-19 15:39 ` [pve-devel] applied: " Fiona Ebner
2025-02-11 16:07 ` [pve-devel] [PATCH pve-storage v2 2/5] introduce helpers for content type assertions of storages and volumes Daniel Kral
2025-02-19 14:54 ` Fiona Ebner
2025-02-20 9:14 ` Daniel Kral
2025-02-20 9:36 ` Fiona Ebner
2025-02-20 12:53 ` Daniel Kral
2025-02-20 12:58 ` Fiona Ebner
2025-02-11 16:07 ` [pve-devel] [PATCH pve-storage v2 3/5] tree-wide: make use of content type assertion helper Daniel Kral
2025-02-19 15:16 ` Fiona Ebner
2025-02-20 9:31 ` Daniel Kral
2025-02-11 16:07 ` [pve-devel] [PATCH pve-storage v2 4/5] vdisk_alloc: factor out optional parameters in options hash argument Daniel Kral
2025-02-20 8:49 ` Fiona Ebner
2025-02-20 9:34 ` Daniel Kral
2025-02-11 16:07 ` [pve-devel] [PATCH pve-storage v2 5/5] vdisk_alloc: add optional assertion for volume's content type Daniel Kral
2025-02-20 9:03 ` Fiona Ebner
2025-02-20 10:40 ` Fabian Grünbichler
2025-02-20 10:48 ` Fiona Ebner
2025-02-20 12:33 ` Daniel Kral
2025-02-20 13:09 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 01/15] test: cfg2cmd: expect error for invalid volume's storage " Daniel Kral
2025-02-19 15:45 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 02/15] fix #5284: api: move-disk: assert content type support for target storage Daniel Kral
2025-02-20 14:04 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 03/15] fix #5284: api: clone_vm: " Daniel Kral
2025-02-20 14:04 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 04/15] api: remove unused size variable in check_storage_access Daniel Kral
2025-02-20 14:04 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 05/15] api: remove unusable default storage parameter " Daniel Kral
2025-02-20 14:09 ` Fiona Ebner
2025-02-21 8:27 ` Daniel Kral
2025-02-21 9:15 ` Fiona Ebner
2025-02-20 14:15 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 06/15] fix #5284: api: update-vm: assert content type support for cloudinit images Daniel Kral
2025-02-20 14:23 ` Fiona Ebner
2025-02-21 8:30 ` Daniel Kral
2025-02-21 9:42 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 07/15] fix #5284: cli: importovf: assert content type support for target storage Daniel Kral
2025-02-20 14:29 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 08/15] tree-wide: update vdisk_alloc optional arguments signature Daniel Kral
2025-02-20 14:36 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 09/15] cfg2cmd: improve error message for invalid volume content type Daniel Kral
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 10/15] api: {clone, move}_vm: use volume content type assertion helpers Daniel Kral
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 11/15] api: {create, update}_vm: " Daniel Kral
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 12/15] api: import{disk, ovf}: " Daniel Kral
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 13/15] api: qmrestore: " Daniel Kral
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 14/15] api: migrate_vm: " Daniel Kral
2025-02-20 14:46 ` Fiona Ebner
2025-02-20 17:50 ` Daniel Kral
2025-02-21 9:45 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH qemu-server v2 15/15] tree-wide: add todos for breaking content type assertions Daniel Kral
2025-02-20 14:47 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH container v2 01/11] migration: prepare: factor out common read-only variables Daniel Kral
2025-02-20 9:20 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH container v2 02/11] tests: add tests for expected behavior of alloc_disk wrapper Daniel Kral
2025-02-20 10:21 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH container v2 03/11] alloc_disk: fail fast if storage does not support content type rootdir Daniel Kral
2025-02-20 12:15 ` Fiona Ebner
2025-02-20 17:52 ` Daniel Kral
2025-04-15 12:27 ` Daniel Kral
2025-04-15 13:31 ` Wolfgang Bumiller
2025-04-15 14:19 ` Fabian Grünbichler [this message]
2025-04-16 8:19 ` Wolfgang Bumiller
2025-02-11 16:08 ` [pve-devel] [PATCH container v2 04/11] alloc_disk: factor out common arguments for call to vdisk_alloc Daniel Kral
2025-02-20 13:11 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH container v2 05/11] alloc_disk: simplify storage-specific logic for vdisk_alloc arguments Daniel Kral
2025-02-20 13:22 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH container v2 06/11] alloc_disk: update vdisk_alloc optional arguments signature Daniel Kral
2025-02-20 13:24 ` Fiona Ebner
2025-02-11 16:08 ` [pve-devel] [PATCH container v2 07/11] alloc_disk: use volume content type assertion helpers Daniel Kral
2025-02-11 16:08 ` [pve-devel] [PATCH container v2 08/11] api: create: " Daniel Kral
2025-02-11 16:08 ` [pve-devel] [PATCH container v2 09/11] migration: prepare: " Daniel Kral
2025-02-11 16:08 ` [pve-devel] [PATCH container v2 10/11] api: update_vm: " Daniel Kral
2025-02-11 16:08 ` [pve-devel] [PATCH container v2 11/11] mount: raw/iso: " Daniel Kral
2025-02-20 13:29 ` Fiona Ebner
2025-02-21 8:38 ` Daniel Kral
2025-02-21 9:50 ` [pve-devel] [PATCH container/qemu-server/storage v2 00/31] consistent assertions for volume's content types Fiona Ebner
2025-02-28 8:46 ` [pve-devel] partially-applied: " Fiona Ebner
2025-04-15 13:58 ` [pve-devel] superseded: " Daniel Kral
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=1744725224.c1q2wtkmtz.astroid@yuna.none \
--to=f.gruenbichler@proxmox.com \
--cc=d.kral@proxmox.com \
--cc=pve-devel@lists.proxmox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal