How to share a single SSD for both VMs and plain "directory" storage

marcosscriven

Member
Mar 6, 2021
130
11
23
I have a 4TB disk I'd like to use for VMs/LXCs, as well as just local storage (mostly to mount to the LXCs - as a form of shared storage).

Ideally I don't want to have to arbitrarily partition the drive, just dynamically allow either the VMs/LXCs use as much as they need, and the rest to be available as local storage.

Is there a way to do this?
 
well, you can use a directory storage for VM and LXC volumes as well, but you won't have snapshot support for containers then (and for VMs only if you use qcow2 as image format).
 
Thanks

I'm not looking to move the VMs/LXCs away from LVM-thin storage.

What's confusing me is how I can have both that, as well as some raw ext4 space (on the same SSD) that I don't have to declare as only a certain size?

Unless the solution is simply to add another LV manually (on the default 'data' LV) - but not sure if that would confuse Proxmox somehow.
 
Last edited:
you can't, a directory storage backed by ext4 will always have a certain size. you can of course start small and extend it later if it is backed by a storage that can resize the backing volume and if there is still space available. or you can overcommit if the backing storage is thinly provisioned.
 
  • Like
Reactions: marcosscriven
you can't, a directory storage backed by ext4 will always have a certain size. you can of course start small and extend it later if it is backed by a storage that can resize the backing volume and if there is still space available. or you can overcommit if the backing storage is thinly provisioned.
Sorry, confused now. You're saying I can't create an ext4 file system on a thin volume?

I was proposing to do this (on the default 'data' thin pool Proxmox sets up):

Code:
lvcreate --type thin --name myvol --virtualsize 100G pve/data
mkfs.ext4 /dev/myvg/myvol
mount /dev/myvg/myvol /mnt/myvol

My worry was that if I did this, Promox might not expect such a volume in the 'data' pool, and I might break some assumption that Proxmox "owns" that pool somehow.
 
Last edited:
you can, but it has a fixed size (100G) and is thinly provisioned, so you risk running out of space if you are not careful. PVE will only handle volumes on LVM thin that conform to its naming scheme.
 
  • Like
Reactions: marcosscriven

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!