LXC storage other than "local"

Heptan

New Member
Sep 26, 2024
4
0
1
I have a proxmox cluster v 8.3.1, each node has a boot drive (rpool) and 2 SSDs mirrored with ZFS (vm-storage0).

Under cluster>storage there are listed
  • local, Type directory
  • local-zfs, Type ZFS
  • vm-storage0, Type ZFS
Bash:
root@prox3:~# zfs list
NAME                            USED  AVAIL  REFER  MOUNTPOINT
rpool                          2.36G   428G    96K  /rpool
rpool/ROOT                     2.19G   428G    96K  /rpool/ROOT
rpool/ROOT/pve-1               2.19G   428G  2.19G  /
rpool/data                       96K   428G    96K  /rpool/data
rpool/var-lib-vz                121M   428G   121M  /var/lib/vz
vm-storage0                    38.4G  1.64T  38.0G  /vm-storage0
vm-storage0/subvol-104-disk-0   448M  7.56G   448M  /vm-storage0/subvol-104-disk-0

Bash:
root@prox3:~# cat /etc/pve/storage.cfg
dir: local
    path /var/lib/vz
    content iso,backup,vztmpl

zfspool: local-zfs
    pool rpool/data
    content rootdir,images
    sparse 1

zfspool: vm-storage0
    pool vm-storage0
    content rootdir,images
    mountpoint /vm-storage0
    nodes prox3,prox4

Question:
  • When I create a new LXC container, I can only choose storage "local", why?
  • Why can I not enable backup for vm-storage0 in the gui?
 
When I create a new LXC container, I can only choose storage "local", why?
You can only choose "local" as the template source directory. The LXC itself will be stored in any of the other two ZFS storages.

Why can I not enable backup for vm-storage0 in the gui?
Because "backup" type requires a file storage and ZFS is a block storage. You may manually create a zfs filesystem on that zpool, add it as "directory" type of storage and select "backup" as the storage content.
 
you can also just add another dir to storage.cfg pointing to the dataset you want to use as a template/container storage directory, same for backups etc, add as a dir

personally i did this by making a dataset under zfs
example of commands i used you can adjust for your system if you decide to:

Code:
zfs create twelve/backups
zfs set compression=zstd-13 twelve/backups
zfs set recordsize=1M  twelve/backups
(you may not want zstd compression, or a record size of 1M, so be mindful of which options you are using)

then add the created datasets as directories to storage.cfg

example:
Code:
dir: containers
    path /vm-storage0/containers
    content rootdir,images,iso,vztmpl


dir: backups
    path /vm-storage0/backups
    content iso,backup,vztmpl

Code:
images = QEMU/KVM VM images.
rootdir = Allow to store container data.
vztmpl = Container templates.
backup = Backup files (vzdump).
iso = ISO images
snippets = Snippet files, for example guest hook scripts
Proxmox Storage Wiki

then you just use those as options
 

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!