[SOLVED] Create ct and vm disks in different path on ZFS

Morphushka

Well-Known Member
Jun 25, 2019
49
6
48
35
Syberia
Hello. For example, I have 3 containers are logically belongs to one service "service1". Proxmox create all disk at root zfs storage, so it looks like this:
mega/subvol-100-disk-0
mega/subvol-101-disk-0
mega/subvol-102-disk-0
I want to see them this way:
mega/service1/subvol-100-disk-0
mega/service2/subvol-101-disk-0
mega/service3/subvol-102-disk-0

Can I do this somehow ?
Thanks!
 
Hi,

Yes you can, go to Datacenter -> Storage -> Add -> Directory , give it ID and the path like /rpool/data/servicesCT then create your LXC Container or just move disk into the new directory
 
Moayad solutions works, but you lose some the benefits of ZFS.

Can I do this somehow ?

Currently, we do not get the mountpoint of a subvolume on the fly, so just changing the mountpoint on the respective ZFS subvolume won't work.

What is your specific reason to have it setup this way? Do you often work directly on the subvolumes mountpoints?
 
  • Like
Reactions: Moayad
OK, I tested stupidly... Setting the ZFS mountpoint works out fine, just actually need to tell ZFS to remount it to the new one ...

Bash:
# first stop the CT
pct shutdown 100

# set the new mountpoint, for example:
zfs set mountpoint=/mega/service1/subvol-100-disk-0 mega/subvol-100-disk-0

# repeat above for other CTs ...

# enforce the new MP
zfs mount -a

# start ct again
pct start 100
 
  • Like
Reactions: Morphushka
What is your specific reason to have it setup this way? Do you often work directly on the subvolumes mountpoints?
We create a lot of small ct, and I just think that would be fine to have some path-logic structure.
I should to reach this solution by myself, it's my miss understanding of zfs, and beyond proxmox staff.
Set mount points is that I need. Simple.
Thanks Moayad and t.lamprecht.
 

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!