[SOLVED] zfs - from pool to VM-filesystem?

rcd

Active Member
Jul 12, 2019
245
23
38
62
So, I read up on zfs and thought I'd play around with it a bit. I created a pool on the hypervisor, and I gave a slice of it to a VM by adding a harddisk for the VM in proxmox.

Now in the VM i see a /dev/vda device. In fdisk it is unpartitioned. But how do I use it?

Should I just pvcreate /dev/vda and create my filesystems as usual? But it is my understanding that it is not good practice to create file systems on top of zfs?

I just need someone to explain howI get from this /dev/vda to something that can be used to store files in the VM. If it can be done in more than one way I'd like to know which one is best practice to use and why. Thanks.
 
It depends on your needs. You can pvcreate /dev/vda or create partitions on it. Or you can even directly format /dev/vda (that's what I do for data disks as it makes it easier to resize it later)
 
Well that was kinda my point. I don't have any particular need, other than to understand how to do this best. If I create a second filesystem on top I will lose the advantage of the zfs. Is there no way to share the pool from the hypervisor to the vm while retaining the magical benefits of the zfs?
 
No. For VM, Proxmox creates zvols, which are presented as raw block devices. You must use another FS inside the guest (except for very specific use cases). You will not loose all the benefit of ZFS : snapshot, compression etc... can be managed at the proxmox level
 

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!