containers whose filesystem is a directory on the host

pmlearner

Member
Jul 9, 2019
25
0
6
54
I made a few containers by hand using -rootf :

pct create 100 local:vztmpl/centos-8-default_20191016_amd64.tar.xz -rootfs /vz/private/100

(I'm used to using openvz).

I was surprised this worked as from what I can tell the GUI only allows .raw filesystems.

I have a few questions :

1. What is the official name for the type of file system I'm using (in which my file system is just a normal subdir on the host)

2. Is this "ok" - it does work but does it go against the general philosophy of things? I like it because I can very easily copy into and out of the container. I can quickly inspect it, etc.

3. If I do use these, where is the proper place for them? /var/lib/vz/images? somewhere else?

4. I tried to clone a container like this using the GUI but it did not like it. It said "unable to clone mountpint 'rootfs' (type bind) (500)" - is there any way to "fix" this?

Thanks for all input!
 
I made a few containers by hand using -rootf :

pct create 100 local:vztmpl/centos-8-default_20191016_amd64.tar.xz -rootfs /vz/private/100

(I'm used to using openvz).

I was surprised this worked as from what I can tell the GUI only allows .raw filesystems.

I have a few questions :

1. What is the official name for the type of file system I'm using (in which my file system is just a normal subdir on the host)

you are mixing up two things here. what you probably wanted was

-rootfs local:0,size=0

to create a PVE-managed subvol on a directory based storage. this exists solely to mimic the old OpenVZ style volumes, and exists only for legacy purposes.

what you did was mount the host directory /vz/private/100 as bind mount - PVE treats this as externally managed storage, it will be excluded when backing up, and just mapped in "as-is". this is usually used to map in exports from file servers that you don't want to mount inside the container.

2. Is this "ok" - it does work but does it go against the general philosophy of things? I like it because I can very easily copy into and out of the container. I can quickly inspect it, etc.

3. If I do use these, where is the proper place for them? /var/lib/vz/images? somewhere else?

4. I tried to clone a container like this using the GUI but it did not like it. It said "unable to clone mountpint 'rootfs' (type bind) (500)" - is there any way to "fix" this?

if you just want to be able to quickly look inside the container from the host shell, you might be interested in 'pct mount', 'pct pull', 'pct push' and 'pct exec' ;) a regular volume mountpoint + those commands is the recommended way to go. then (depending on storage) snapshots, linked or full clones etc. all become possible.
 
Thanks for your help - I appreciate it! I'm trying to break my old openvz habits :)

In general are the raw, cow, etc. filesystems "better". Do I need to worry that corruption to the .raw file would break the whole filesystem? I feel a bit more comfortable with directory based storage because I can use all the normal tools to inspect and manipulate the files. As stated though I'm trying to adopt the new and better ways so all input is appreciated!
 
like I said - you can still use all the normal tools because you can mount the image file (either manually, or with 'pct mount') and access all the contents. if the image file gets corrupt, then you most likely have a hardware issue that would also corrupt files stored directly in a directory. we use ext4 inside the image, so powerloss might lose you the last few writes but should leave the image in a consistent state.
 

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!