Use ZFS dataset as storage directory?

tycoonbob

Member
Aug 25, 2014
67
0
6
I'm not sure if I'm just overlooking something, or if I'm missing something completely.

I have a server (dual Xeon L5640s, 96GB RAM, 2x128GB SSD's in ZFS mirror for OS, 8x5TB drives in 2-way ZFS mirrors for data pool) in which I recently installed Proxmox VE 3.4 on. Install went great, got the boot volume in a ZFS mirror, created a new zpool with 4 vdev's each in 2-way mirror, and set up some shares. I plan to use this box for both centralized storage, as well as KVM host (Proxmox), and plan to create another zpool for VM's once I get a couple 500GB SSD's. In the mean time, I created a dataset/volume on my large ZFS zpool, in which I called "proxmox", set a quota of 200GB, and mounted at /tanks/tank_data_01/proxmox (my zpool is called tank_data_01, mounted at /tanks/tank_data_01).

I see the "proxmox" dataset, and I can successfully use it as a local directory with Proxmox, and I can create VM's and store ISO's on it. However, VM's won't start in this fashion (throws an error -- don't have that error handy). So I decided to add storage using "ZFS" from the drop down (as opposed to the "directory" I just tried with), and I can select my zpool. Problem is, I don't want to use the root of my pool for proxmox storage, and I want to use that proxmox dataset/volume. If I edit storage.cfg and append the correct path (/tanks/tank_data_01 to /tanks/tank_data_01/proxmox), it acts like it's working, but when I try to upload an ISO to that storage, it fails.

Is it not possible to select a ZFS dataset for my storage location, or do I have to use the root of my zpool? Any idea why I couldn't use the local path to that dataset? I know the error would be handy, and I'm trying to recall what it was. Server is offline at the moment and won't be back up until tomorrow.

Thanks!
 
Hi,
The error you got is because ZFS don't support O_DIRECT to solve this use at the VM Disk settings write back mode.
I do not understand why you can't select you tank_data_01 as an ZFSpool storage?
do you get a error msg?
 
Hi,
The error you got is because ZFS don't support O_DIRECT to solve this use at the VM Disk settings write back mode.
I do not understand why you can't select you tank_data_01 as an ZFSpool storage?
do you get a error msg?

Would it make sense for Proxmox to detect if a VM is on ZFS and if so change the default setting for a VM to one that does work? Also hide the setting which ZFS cannot support so people cannot pick it and have VM's that don't start.

Just a little GUI change to make life easier as the default is an option which doesn't work.
 
Hi,
The error you got is because ZFS don't support O_DIRECT to solve this use at the VM Disk settings write back mode.
I do not understand why you can't select you tank_data_01 as an ZFSpool storage?
do you get a error msg?

Code:
root@proxmox01:~# zfs list
NAME                   USED  AVAIL  REFER  MOUNTPOINT
rpool                 18.9G  98.2G    96K  /rpool
rpool/ROOT            3.13G  98.2G    96K  /rpool/ROOT
rpool/ROOT/pve-1      3.13G  98.2G  3.13G  /
rpool/swap            15.8G   114G    64K  -
tank_data_01           256K  17.8T    19K  /tanks/tank_data_01
tank_data_01/audio      19K  17.8T    19K  /tanks/tank_data_01/audio
tank_data_01/proxmox    19K   200G    19K  /tanks/tank_data_01/proxmox
tank_data_01/users      19K  17.8T    19K  /tanks/tank_data_01/users
tank_data_01/video      19K  17.8T    19K  /tanks/tank_data_01/video

Basically, I want to use /tanks/tank_data_01/proxmox as storage for my VM/CT's. /tanks/tank_data_01/proxmox is a dataset/volume I created using:
Code:
zfs create tank_data_01/proxmox -o quota=200gb

If I try to add storage via the GUI, and select ZFS, it won't let me select that volume and instead only lets me select the pool "tank_data_01", which is not what I want to do.

If I try to add storage as a directory, and select that mount point (/tanks/tank_data_01/proxmox), it works until I try to boot a VM. That's when I get that O_DIRECT error, but thank you for that solution (which I haven't tested yet, but assume works).

Is it not possible to select a ZFS dataset/volume as the storage location when adding a ZFS type storage?
 

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!