Setting up LXC Container with (multiple) directory storages?

Apollon77

Well-Known Member
Sep 24, 2018
153
13
58
47
Hi All,

I'm currently doing my fuirst things with LXC containers and my idea was to have a COntainer with Redis in there and use a special Mount-Point for the "/var/lib/redis" directory inside the container to be able to update container independently from persisted data.
I use a glusterfs shared storage and because it is still not officially allowed to use it for container I did what was told in a thread and added a Directory storage with the glusterfs mount point as base to be able to store Container stuff on GlusterFS :)

So I added a container and ended up in having two "RAW image files" with the defined sizes ... basically works.

Now (also to be able to better backup the stuff on a file basis) I thought about changing the setup again and use a "directory" based rootfs and "data", but because it is not possible using GUI I struggle with the command line ... and it is very hard to find examples. Infos from Docs saying pass "size=0" ...

So I tried:

Code:
root@pm7:~# pct create 301 apollonnas-nfs:vztmpl/ubuntu-18.04-standard_18.04.1-1_amd64.tar.gz --cores 2 --cpuunits 1024 --memory 1024 --swap 512 --hostname redis2 --net0 bridge=vmbr0,name=eth0,ip=dhcp,ip6=dhcp,firewall=1 --rootfs glusterfs-container:rootdir-301,size=0,replicate=0,shared=1 --mp0 glusterfs-container:libredis-301,size=0,mp=/var/lib/redis,replicate=0,shared=1 --onboot 1 --pool Test --unprivileged 1 --ssh-public-keys .ssh/nuc-ingof-rsa.pub

Result:
unable to create CT 301 - unable to parse directory volume name 'rootdir-301'

After that I check through the perl sources a bit and found a place where the volume ID is parsed and for root dir I found a regex (https://github.com/proxmox/pve-storage/blob/master/PVE/Storage/Plugin.pm#L382) ... that regex assumes that only one dir per VM-ID is possible (??), so I tried to adopt the volume name and removed the mp0 :-( But ok, next try:

Code:
root@pm7:~# pct create 301 apollonnas-nfs:vztmpl/ubuntu-18.04-standard_18.04.1-1_amd64.tar.gz --cores 2 --cpuunits 1024 --memory 1024 --swap 512 --hostname redis2 --net0 bridge=vmbr0,name=eth0,ip=dhcp,ip6=dhcp,firewall=1 --rootfs glusterfs-container:rootdir/301,size=0,replicate=0,shared=1 --onboot 1 --pool Test --unprivileged 1 --ssh-public-keys .ssh/nuc-ingof-rsa.pub

Result:
unable to create CT 301 - volume 'glusterfs-container:rootdir/301' does not exist


Ok, so I went to the storage in private and created the directory 301 and executed the command again.

Result:
Use of uninitialized value $format in string eq at /usr/share/perl5/PVE/LXC.pm line 1441.
Use of uninitialized value $format in string eq at /usr/share/perl5/PVE/LXC.pm line 1463.
Use of uninitialized value $format in string eq at /usr/share/perl5/PVE/LXC.pm line 1463.
Use of uninitialized value $format in concatenation (.) or string at /usr/share/perl5/PVE/LXC.pm line 1500.
mounting container failed
unable to create CT 301 - unsupported image format ''

So my question now ... how the command needs to be to get that working? Is it possible to have two "directories" for it to separate "system" and "data"?

Thank you for help on that.

For completenes: I use latest Proxmox 5.x version
 
Thank you. I will try that later. Do you have an idea how to call it to get two separate directories for system and data?
 
Try glusterfs-container:301/rootdir.

Nope, Result:
unable to create CT 301 - unable to parse volume filename 'rootdir'

I also tried the short form with "glusterfs-container:0":

extracting archive '/mnt/pve/apollonnas-nfs/template/cache/ubuntu-18.04-standard_18.04.1-1_amd64.tar.gz'
tar: failed to return to initial working directory: Permission denied
unable to create CT 301 - command 'lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar xpf - -z --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs '--xattrs-include=user.*' '--xattrs-include=security.capability' '--warning=no-file-ignored' '--warning=no-xattr-write' -C /var/lib/lxc/301/rootfs --skip-old-files --anchored --exclude './dev/*'' failed: exit code 2
 
unable to create CT 301 - unable to parse volume filename 'rootdir'
I was apparently sleeping yesterday, try this --rootfs /<path>/<to>/<directory>/<unique-name-for-container>,size=0. The folder needs to exist beforehand.
 
Ok, so path to be /mnt/pve/glusterfs-container/my/own/path/structure/ ?!
Yes. This will put the path for rootfs or mp in the config. They need to be the same on all nodes.
 
I tried with

Code:
root@pm7:~# pct create 302 apollonnas-nfs:vztmpl/ubuntu-18.04-standard_18.04.1-1_amd64.tar.gz --cores 2 --cpuunits 1024 --memory 1024 --swap 512 --hostname redis3 --net0 bridge=vmbr0,name=eth0,ip=dhcp,ip6=dhcp,firewall=1 --rootfs /mnt/pve/glusterfs/private/302/rootfs,replicate=0,size=0 --mp0 /mnt/pve/glusterfs/private/302/redis,replicate=0,size=0,mp=/var/lib/redis --onboot 1 --pool Test --unprivileged 1 --ssh-public-keys .ssh/nuc-ingof-rsa.pub

I also created these paths via "mkdir", Result:
Code:
extracting archive '/mnt/pve/apollonnas-nfs/template/cache/ubuntu-18.04-standard_18.04.1-1_amd64.tar.gz'
tar: ./etc: Cannot mkdir: Permission denied
tar: ./etc/appliance.info: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/pidof: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/sed: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/kill: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/ps: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/dmesg: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/findmnt: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/lsblk: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/more: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/mountpoint: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/wdctl: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/mount: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/umount: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/login: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/su: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/hostname: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/dnsdomainname: Cannot create symlink to 'hostname': No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/domainname: Cannot create symlink to 'hostname': No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/nisdomainname: Cannot create symlink to 'hostname': No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/ypdomainname: Cannot create symlink to 'hostname': No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/gunzip: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/gzexe: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/gzip: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/uncompress: Cannot hard link to './bin/gunzip': No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/zcat: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/zcmp: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/zdiff: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/zegrep: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/zfgrep: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/zforce: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/zgrep: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/zless: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/zmore: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/znew: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/egrep: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/fgrep: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/grep: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/tar: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/dash: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/cat: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/chgrp: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/chmod: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/chown: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/cp: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/date: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/dd: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/df: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/dir: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/echo: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/false: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/ln: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/ls: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/mkdir: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/mknod: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/mktemp: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/mv: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/pwd: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/readlink: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/rm: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/rmdir: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/sleep: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/stty: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/sync: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/touch: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/true: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/uname: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/vdir: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied
tar: ./bin/run-parts: Cannot open: No such file or directory
tar: ./bin: Cannot mkdir: Permission denied


... here i canceled it

BTW: I had the same result yesterday while experimenting with using

glusterfs-container:302/vm-302-disk-0.subvol

(The "subvol" ending is handled then as directory, but yes I needed to manually create all dirs).

Is it maybe because the dirs now belong to root? Maybe I need to give them to a different user? Or give other users more rights then "r"?

Please advise.

All in all it still feels not completely "right" that way
 
Is it maybe because the dirs now belong to root? Maybe I need to give them to a different user? Or give other users more rights then "r"?
For an unprivileged container the root UID 0 inside the container is mapped to an unprivileged user outside the container. AFAIK, the chown will happen after the template was extracted. This seems to be a permission problem on the storage for root.
 
  • Like
Reactions: panchuz
So that would mean that I need to make a "chown" to that unprivileged user (whats his name?) or make a "chmod 777" on this directory? What I need to do?
 
Last edited:
extracting archive '/mnt/pve/apollonnas-nfs/template/cache/ubuntu-18.04-standard_18.04.1-1_amd64.tar.gz' tar: ./etc: Cannot mkdir: Permission denied
This says that the during extraction of the archive the target folder couldn't be created. Try directly as root to extract the archive to target location and see if the permission denied still shows up.
 
But then all files would be "root" ... this will not really work, or?

I have used the same container template several times to setup "raw image based" containers and in general this is working, so yes I think it is because the directory is owned by root and "Other users" are not allowed to write there ...

Ok, I tried chmod 777 on the two base directories.

Result:

extracting archive '/mnt/pve/apollonnas-nfs/template/cache/ubuntu-18.04-standard_18.04.1-1_amd64.tar.gz'
tar: failed to return to initial working directory: Permission denied
unable to create CT 302 - command 'lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar xpf - -z --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs '--xattrs-include=user.*' '--xattrs-include=security.capability' '--warning=no-file-ignored' '--warning=no-xattr-write' -C /var/lib/lxc/302/rootfs --skip-old-files --anchored --exclude './dev/*'' failed: exit code 2


root@pm7:~# ls -la /mnt/pve/glusterfs/private/302/rootfs/
total 16
drwxrwxrwx 4 root root 4096 Oct 24 11:22 .
drwxr-xr-x 4 root root 4096 Oct 24 10:06 ..
drwxr-xr-x 2 100000 100000 4096 Oct 24 11:22 etc
drwxr-xr-x 3 root root 4096 Oct 24 10:07 var

I also tried to make "chown 100000.100000" for all the base directories (rootfs and redis and also the 302) but still the same error
 
Ok, and next try ... I now changed to the 302 directory (that I gave to ownership 100000.100000 before) ... now it brings:

Code:
extracting archive '/mnt/pve/apollonnas-nfs/template/cache/ubuntu-18.04-standard_18.04.1-1_amd64.tar.gz'
tar: ./sbin/pam_extrausers_chkpwd: Cannot change ownership to uid 0, gid 42: Operation not permitted
tar: ./sbin/unix_chkpwd: Cannot change ownership to uid 0, gid 42: Operation not permitted
tar: ./usr/bin/chage: Cannot change ownership to uid 0, gid 42: Operation not permitted
tar: ./usr/bin/expiry: Cannot change ownership to uid 0, gid 42: Operation not permitted
tar: ./usr/bin/wall: Cannot change ownership to uid 0, gid 5: Operation not permitted
tar: ./usr/bin/crontab: Cannot change ownership to uid 0, gid 101: Operation not permitted
tar: ./usr/bin/ssh-agent: Cannot change ownership to uid 0, gid 111: Operation not permitted
tar: ./usr/bin/mlocate: Cannot change ownership to uid 0, gid 112: Operation not permitted
tar: ./usr/bin/bsd-write: Cannot change ownership to uid 0, gid 5: Operation not permitted
tar: ./usr/lib/dbus-1.0/dbus-daemon-launch-helper: Cannot change ownership to uid 0, gid 108: Operation not permitted
tar: ./usr/sbin/postqueue: Cannot change ownership to uid 0, gid 110: Operation not permitted
tar: ./usr/sbin/postdrop: Cannot change ownership to uid 0, gid 110: Operation not permitted
tar: ./usr/local/share/fonts: Cannot change ownership to uid 0, gid 50: Operation not permitted
tar: ./usr/local/lib/python3.6/dist-packages: Cannot change ownership to uid 0, gid 50: Operation not permitted
tar: ./usr/local/lib/python3.6: Cannot change ownership to uid 0, gid 50: Operation not permitted
tar: ./etc/ssl/private/ssl-cert-snakeoil.key: Cannot change ownership to uid 0, gid 103: Operation not permitted
tar: ./etc/ssl/private: Cannot change ownership to uid 0, gid 103: Operation not permitted
tar: ./etc/shadow: Cannot change ownership to uid 0, gid 42: Operation not permitted
tar: ./etc/gshadow: Cannot change ownership to uid 0, gid 42: Operation not permitted
tar: ./etc/shadow-: Cannot change ownership to uid 0, gid 42: Operation not permitted
tar: ./etc/gshadow-: Cannot change ownership to uid 0, gid 42: Operation not permitted
tar: ./var/lib/pam: Cannot mkdir: Permission denied
tar: ./var/lib/pam: Cannot mkdir: Permission denied
tar: ./var/lib/pam/seen: Cannot open: No such file or directory
tar: ./var/lib/pam: Cannot mkdir: Permission denied
tar: ./var/lib/pam/auth: Cannot open: No such file or directory
tar: ./var/lib/pam: Cannot mkdir: Permission denied
tar: ./var/lib/pam/account: Cannot open: No such file or directory
tar: ./var/lib/pam: Cannot mkdir: Permission denied
tar: ./var/lib/pam/password: Cannot open: No such file or directory
tar: ./var/lib/pam: Cannot mkdir: Permission denied
tar: ./var/lib/pam/session: Cannot open: No such file or directory
tar: ./var/lib/pam: Cannot mkdir: Permission denied
tar: ./var/lib/pam/session-noninteractive: Cannot open: No such file or directory
tar: ./var/lib/systemd: Cannot mkdir: Permission denied
tar: ./var/lib/systemd: Cannot mkdir: Permission denied
... and many more :-)

So it works better for a bit but then /var/lib still breaks ... I also know why (befause of the "mp0") but for me the me the question would be which effects the errors on top
 
But then all files would be "root" ... this will not really work, or?
Not for a running container, but to rule out that the target storage has permission problems, aside our tooling.

I checked, the creation is happen in a namespace and therefore with the ID of the unprivileged container. So better use the --rootfs glusterfs-container:0 notation. This will also create the folder for the container.
 
Ok, I removed mp0, now it is:


Code:
extracting archive '/mnt/pve/apollonnas-nfs/template/cache/ubuntu-18.04-standard_18.04.1-1_amd64.tar.gz'
tar: ./var/lib/apt/lists/partial: Cannot change ownership to uid 105, gid 0: Operation not permitted
tar: ./var/lib/apt/lists/auxfiles: Cannot change ownership to uid 105, gid 0: Operation not permitted
tar: ./var/lib/postfix: Cannot change ownership to uid 104, gid 109: Operation not permitted
tar: ./var/cache/apt/archives/partial: Cannot change ownership to uid 105, gid 0: Operation not permitted
tar: ./var/cache/man/CACHEDIR.TAG: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/cat1: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/cat2: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/cat3: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/cat4: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/cat5: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/cat6: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/cat7: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/cat8: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/index.db: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/cs/cat1: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/cs/cat5: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/cs/cat8: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/cs/index.db: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/cs: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/de/cat1: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/de/cat5: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/de/cat8: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/de/index.db: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/de: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/es/cat1: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/es/cat5: Cannot change ownership to uid 6, gid 12: Operation not permitted

tar: ./var/cache/man/sr/cat5: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/sr/cat8: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/sr/index.db: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man/sr: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/cache/man: Cannot change ownership to uid 6, gid 12: Operation not permitted
tar: ./var/local: Cannot change ownership to uid 0, gid 50: Operation not permitted
tar: ./var/log/wtmp: Cannot change ownership to uid 0, gid 43: Operation not permitted
tar: ./var/log/btmp: Cannot change ownership to uid 0, gid 43: Operation not permitted
tar: ./var/log/lastlog: Cannot change ownership to uid 0, gid 43: Operation not permitted
tar: ./var/log/journal: Cannot change ownership to uid 0, gid 105: Operation not permitted
tar: ./var/log: Cannot change ownership to uid 0, gid 102: Operation not permitted
tar: ./var/spool/rsyslog: Cannot change ownership to uid 100, gid 4: Operation not permitted
tar: ./var/spool/cron/crontabs: Cannot change ownership to uid 0, gid 101: Operation not permitted
tar: ./var/spool/postfix/private: Cannot change ownership to uid 104, gid 0: Operation not permitted
tar: ./var/spool/postfix/public: Cannot change ownership to uid 104, gid 110: Operation not permitted
tar: ./var/spool/postfix/incoming: Cannot change ownership to uid 104, gid 0: Operation not permitted
tar: ./var/spool/postfix/active: Cannot change ownership to uid 104, gid 0: Operation not permitted
tar: ./var/spool/postfix/bounce: Cannot change ownership to uid 104, gid 0: Operation not permitted
tar: ./var/spool/postfix/defer: Cannot change ownership to uid 104, gid 0: Operation not permitted
tar: ./var/spool/postfix/deferred: Cannot change ownership to uid 104, gid 0: Operation not permitted
tar: ./var/spool/postfix/flush: Cannot change ownership to uid 104, gid 0: Operation not permitted
tar: ./var/spool/postfix/saved: Cannot change ownership to uid 104, gid 0: Operation not permitted
tar: ./var/spool/postfix/corrupt: Cannot change ownership to uid 104, gid 0: Operation not permitted
tar: ./var/spool/postfix/maildrop: Cannot change ownership to uid 104, gid 110: Operation not permitted
tar: ./var/mail: Cannot change ownership to uid 0, gid 8: Operation not permitted
tar: ./run/utmp: Cannot change ownership to uid 0, gid 43: Operation not permitted
tar: ./run/systemd/netif/links: Cannot change ownership to uid 101, gid 106: Operation not permitted
tar: ./run/systemd/netif/leases: Cannot change ownership to uid 101, gid 106: Operation not permitted
tar: ./run/systemd/netif: Cannot change ownership to uid 101, gid 106: Operation not permitted
Total bytes read: 637347840 (608MiB, 5.1MiB/s)
tar: Exiting with failure status due to previous errors
unable to create CT 302 - command 'lxc-usernsexec -m u:0:100000:65536 -m g:0:100000:65536 -- tar xpf - -z --totals --one-file-system -p --sparse --numeric-owner --acls --xattrs '--xattrs-include=user.*' '--xattrs-include=security.capability' '--warning=no-file-ignored' '--warning=no-xattr-write' -C /var/lib/lxc/302/rootfs --skip-old-files --anchored --exclude './dev/*'' failed: exit code 2

This all seems weird ...
 
Not for a running container, but to rule out that the target storage has permission problems, aside our tooling.

I checked, the creation is happen in a namespace and therefore with the ID of the unprivileged container. So better use the --rootfs glusterfs-container:0 notation. This will also create the folder for the container.
Yes it will create stuff, but then still an error, see https://forum.proxmox.com/threads/s...multiple-directory-storages.59323/post-273840
 
Yes it will create stuff, but then still an error,
Hm... with the rootfs, mpX or with both?

The reason for this error is that he wants to return to the "current" path where the command was executed where this unprivileged user has no access too (assumption because it changed as soon as I started the command out of an directory which was owned by the 10000.10000 user
Yeah, that seems also to be an issue. :oops: Can you please open up a bug report and reference this thread? Thanks.
https://bugzilla.proxmox.com/

In the meantime, I guess, creating the rootfs and mpX by hand (cumbersome) or running with image based containers is the only alternative.
 
  • Like
Reactions: Alwin
For the original problem, for the use of a gluster volume for container, you can perhaps activate the nfs-share directly on the gluster volume (
gluster volume set volume_name nfs.disable off),, or use nfs ganesha for it ( https://download.nfs-ganesha.org ), but from my experience, the performance are very poor with ganesha.

And after that, you can mount the gluster storage as NFS an use it directly for container.

my 2 cents.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!