Replies: 22 comments 36 replies
-
Thank you so much! This worked flawlessly for me. I really appreciate it that you took the time to document this. |
Beta Was this translation helpful? Give feedback.
-
Thank you @iGadget. I'm using this solution for some time, but until now I haven't found a solution for the snapshots/migration problem. Your I've published a collection of scripts I'm using here, if anyone is interested. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your comments, @joost00719 & @fdcastel ! |
Beta Was this translation helpful? Give feedback.
-
Hi guys! I already refactored the logic to just rebuild the I'm just finishing the the docs for everything. Please give me a little more time and it will all be there. 😉 |
Beta Was this translation helpful? Give feedback.
-
Just a note: I'll need to look into this more closely, but OP suggestions generally seem to follow what I described here The difference seems to be the naming schema, which seem to solve the migration/snapshot issues, thanks for sharing! |
Beta Was this translation helpful? Give feedback.
-
Hello. It seems we no need these dances with tambourine anymore.
Yes, it still has some sort of issues as mentioned here porxmox forum and here du.nkel.dev, but they related to unprivileged mode.
I run some docker containers and it seems really overlay2 is working well. It give me 1.6G instead of 6,9G used space with vfs for the same docker-compose setup file. Snapshots and vzdump backups is working too. @iGadget @Sieboldianus What do you think? Proxmox stuff make it easy for now? Or I miss something? Here is PVE versions
|
Beta Was this translation helpful? Give feedback.
-
Just passing to say that I did a PVE fresh install and I can confirm @frenzymind findings: 🙌 # docker info | grep -A 7 "Storage Driver:"
Storage Driver: overlay2
Backing Filesystem: zfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: false
userxattr: true
Logging Driver: json-file
Cgroup Driver: systemd Remember to create the LXC container with It appears the solution came with Docker Engine v23.0 but I'm not sure. I didn't made any more exhaustive tests, yet. I will build a test environment with my production containers in the following days and will report back here in case of problems. |
Beta Was this translation helpful? Give feedback.
-
Same problem here. :(
Pihole image running on unprivileged / keyctl=1 / nesting=1 LXC
```bash
Pulling pihole (pihole/pihole:latest)...
latest: Pulling from pihole/pihole
bb263680fed1: Pull complete
de9654fb76c7: Pull complete
4f4fb700ef54: Pull complete
cbe6380c3a6b: Pull complete
34575e9e3344: Pull complete
44048c8f578a: Pull complete
ee827dbc8bf8: Extracting
[==================================================>] 30.34MB/30.34MB
6c22f91571c7: Download complete
67421bc419c4: Download complete
ERROR: failed to register layer: ApplyLayer exit status 1 stdout: stderr:
unlinkat /var/cache/apt/archives: invalid argument
```
|
Beta Was this translation helpful? Give feedback.
-
I can confirm that paperless not work as expected Luke in this topic at proxmox forum. |
Beta Was this translation helpful? Give feedback.
-
What we've found until now: This problem appears to be caused by UIDs out of allowed ranges used in lower images: |
Beta Was this translation helpful? Give feedback.
-
Install works with /var/lib/docker formatted as ext4 vm-disk, but warning: if you backup and restore, the disk gets restored as normal zfs subvol and crashes any updates of the container. |
Beta Was this translation helpful? Give feedback.
-
I try to make some kind of conclusion here about failed layer registered error. I get 'failed to register layer' error with overlay2 and zfs Overlayfs is not supported in 2.1.x versions of zfs : read here Why docker says it works then ? Generally docker is lie here and incorrectly let you pick overlay2 driver. dmesg shows in log that something is wrong.
Some of the system calls docker use don't work in every scenario. That why some images works, but others don't. What to do ?
But remember: In both 1 and 2 cases there is still some dirt happening under the hood, even it looks fine outside.
Hope this helps. Thanks. |
Beta Was this translation helpful? Give feedback.
-
I am having trouble using it. I am on PVE8. I need to change the /etc/pve/lxc/*.conf so I am using /dev/zvol/rpool/proxmox/container/subvol-2111-disk-4 instead of subvol-2111-disk-4. Then it started working fine. |
Beta Was this translation helpful? Give feedback.
-
Just thought i add my dirty solution for this on the promox lxc unprivileged mode: Basically if you want to maintain the zfs volumes and use docker in lxc unprivileged mode, then the simple fix is just mount the zfs volume as a directory i.e. a mounted zfs volume is called /apps in proxmox host, so just create a folder /apps/containers |
Beta Was this translation helpful? Give feedback.
-
I seems that ZFS 2.2.0 (that was released yesterday) will solve all our problems! |
Beta Was this translation helpful? Give feedback.
-
Just here to say thank you so much for sharing your knowledge, worked perfectly first time to get Immich up and running in a container for me. |
Beta Was this translation helpful? Give feedback.
-
It seems ZFS 2.2 is available in testing: |
Beta Was this translation helpful? Give feedback.
-
More info here: |
Beta Was this translation helpful? Give feedback.
-
Proxmox VE 8.1 was yesterday released with official support for ZFS 2.2.x and kernel 6.5 included (interesting for AMD servers). |
Beta Was this translation helpful? Give feedback.
-
Besides, I observed an interesting heavy drop in memory consumption after the 2.2.0 upgrade on my Proxmox (48 TB ZFS pools running 18 docker services in nested unprivileged LXC):
1) If you did a *clean install *using the latest proxmox ISO it may be due to [this change](https://bugzilla.proxmox.com/show_bug.cgi?id=4829)
From Proxmox VE Changelog:
The arc_max parameter for installations on ZFS can now be set in the Advanced Options. If not explicitly set by the user, it is set to a value targeting 10% of system memory instead of 50%, which is a better fit for a virtualization workload (issue 4829).
2) However, if you did an *in-place upgrade* I believe -- to the best of my understanding -- that the `arc_max` parameter shouldn't be changed.
*Edit: Bad formatting due reply-by-email.*
|
Beta Was this translation helpful? Give feedback.
-
How much poor we talk about? With NVME (Ext4), bare metal nextcloud don't get less than 1sec to open a page... |
Beta Was this translation helpful? Give feedback.
-
I've been reading through this discussion and several others on the proxmox forums for a few days but I fail to understand what part of the workaround applies to the old and the new (ZFS 2.2) situation. I am running proxmox 8.1.3 and upgraded my pools to ZFS 2.2, created an unprivileged LXC with its root filesystem on a ZFS pool (I did not create a zvol, just selected the pool). Then I followed the steps mentioned in [https://du.nkel.dev/blog/2021-03-25_proxmox_docker/](this blog) until right before the "ZFS" section (as this should work natively with ZFS 2.2, right?). I am confused how I should setup the environment, do I use the ZFS docker storage driver or overlay2? The output of
Do I need to do something else? Please enlighten me |
Beta Was this translation helpful? Give feedback.
-
Update 20241104: As per #1490 (reply in thread) this workaround is no longer needed and in fact may produce issues on the latest PVE version(s).
TLDR: Using Proxmox 8.1 / ZFS 2.2 (or newer) no workarounds are needed.
overlay2
should be the default driver and should not cause any problems with any docker image.Old info:
If you're deploying Nextcloud AIO (or probably any other resource intensive Dockerized app) on Proxmox + LXC and your storage is ZFS, you'll soon find that:
a) Performance is poor
b) Your /var/lib/docker dir is HUGE (i.e. 40+ GB after fresh install) and only increasing in size
c) Updating containers via the Nextcloud AIO interface fails
This is because Docker falls back to the
vfs
storage driver when deployed on ZFS storage.The
vfs
storage driver is intended for testing purposes only, serves as a fallback and should not be used in production.An often cited, relatively easy to deploy alternative is the
fuse-overlayfs
driver, but there have been reports of PVE nodes crashing when this is used, so I'd avoid that if I were you.The latest version of the Nextcloud AIO installation script should warn you if the
vfs
storage driver orfuse-overlayfs
driver is being used (as soon as this patch has been released).Besides the 'bad' examples above, Docker provides several other storage driver options. The
zfs
option mentioned in the docs seems logical, but I haven't been able to get that working in LXC so far.So for LXC + Docker on ZFS you'll want
overlay2
.The problem here is that
overlay2
only supports EXT4 and XFS as backing filesystems, not ZFS. Fortunately, a zvol can be formatted as EXT4 or XFS. But... by default, Proxmox only allows zvols to be used with VMs, not LXCs. For LXC, Proxmox uses ZFS subvols, but ZFS subvols cannot be formatted with a different filesystem.... A catch 22?Luckily, no. With a few lines of shell code directly on the PVE node and a number of clicks in the PVE WebGUI we can work around this issue:
zfs create -s -V 100G rpool/data/vm-104-disk-1
(yes, that's vm-104, not lxc-104, you read that right. Proxmox weirdiness. If you use anything else than this naming scheme, the zvol will not be picked up by the PVE storage manager)mkfs.ext4 /dev/zvol/rpool/data/vm-104-disk-1
mkdir /tmp/docker-ext4
mount /dev/zvol/rpool/data/vm-104-disk-1 /tmp/docker-ext4
chown -R 100000:100000 /tmp/docker-ext4
/tmp/docker-ext4
umount /tmp/docker-ext4
pct rescan
You should see some feedback in the console and then the should be visible in the Proxmox WebGUI under
PVE node -> 104 -> Resources as
'Unused Disk 0 - local-zfs:vm-104-disk-1'.
/var/lib/docker
docker info
- it should now state:Storage Driver: overlay2
Backing Filesystem: extfs
If you have any suggestions for improving the steps above, please share!
Beta Was this translation helpful? Give feedback.
All reactions