Limitless (quoteless) drive for VM

dominikp

Member
Aug 28, 2018
36
3
13
39
I have virtual machine which stores some data (artifactory). This VM is constantly growing. To avoid situation where i would need to expand this VM's drive from time to time i just created CT with NFS which servers some share for VM. In CT which servers the share, this folder is bind-mounted to some host's directory. Well in fact this is not a simple directory but ZFS dataset. In VM share is mounted and linked to directory with artifactory.

This way storage is limitless, i dont have to rise quote when storage is full. And also it is "backupable" because it is dataset so i just make snapshot and compress it to archive. I just made some script to backup both CT and dataset.

BUT! I feel "in my guts" there must be better/more proper way of achieve this goal. What i dont like in my solution is that:
- breaks the rule of "clean host"
- needs some additional "hacky" ct options to work (binding and lxc.apparmor)
- brings some vulnerability (lxc.apparmor unconfined and 777 on nfs share)

So are there better ways to achieve this goal (limitless storage for VM)? At this moment the only alternative i see is separate disks pool passed through directly to VM.
 
if you use ZFS or LVM thin-provisioning, the used space will not be allocated until it's actually written.

Meaning that if you have a 1 TB drive for example, you can create a rootfs volume for your container with 950 GB (leave some headroom for PVE itself and maybe other CTs/VMs) to effectively allow the CT to use the whole drive (that's as "limitless" as you will get - once the drive fills the limit is reached either way).

It will not actually use all that storage though, it will still be seen as "free" in df -h for example. It can even be assigned to other CTs/VMs, known as overprovisioning, so the total sum of assigned drives can be larger than your physical disk.

Make sure to monitor actual disk usage though, to avoid filling it up entirely and causing potential problems.

Also check out our storage documentation for more.
 
Hi,

In additon to what @Stefan_R allready said you can use the reservation zfs propriety. So you could make a reservation at least for your pool (let say 5% of your pool capacity) and some similarly for your most important VM/CT or even for some datasets(nfs ?).
In the event that your free space il empty your zfs pool will can operate and also your most important VM/CT and dataset.

Good luck / Bafta !
 

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!