[PVE-User] local zfs storage for backups and running VM images

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Feb 20 10:27:52 CET 2019


On Mon, Feb 18, 2019 at 07:21:04PM +0100, lists wrote:
> Hi,
> 
> I would like (if possible) to store VMs and backups on local 6TB mirrored
> zfs volumes on our three-node proxmox cluster. (secondary to the ceph
> storage that we also use)
> 
> So, what I did: In the proxmox GUI created on all nodes a local mirrored ZFS
> storage, used for storing running VM images called:
> > zfs-pve1 (similar for pve2, pve3)
> 
> (to my suprise these then also appear on the datacenter level, as storage,
> non-shared)
> 
> Then, for each node, I created a dataset 'backups' in the zfs pool:
> > zfs create zfs-pve1/backups (similar for pve2, pve3)
> > zfs set mountpoint=/mnt/zfs zfs-pve1/backups (similar for pve2, pve3)
> 
> Finally, I created a datacenter-wide storage of type 'directory', set to
> /mnt/zfs, for backups and iso images, and edited my backups to use this as a
> target.
> 
> (it's secondary backup, and yes, I realise that backups should not be hosted
> on the same server)
> 
> Having read on the forums many do's and don't on using zfs for VM images and
> backups, I believe the above config is safe and healthy? Am I correct? :-)
> 
> Can I assume pve to auto-mount the defined zfs mount points on boot?
> 
> Thanks!
> 
> MJ

usually you'd use the same pool name on all hosts, as PVE differentiates
between local and shared storages anyway. for containers, PVE assumes
that ZFS datasets use the default mountpoint (but of course, for a a
dataset used as directory storage this is irrelevant, just something to
keep in mind in general).

some features are limited to local storages existing on multiple nodes,
so if you can I'd rename the pool and just use one ZFS storage
definition with one directory storage definition.

the directory storage should be marked as 'is_mountpoint' so that PVE
does not race with zfs mounting (see 'man pvesm'). another often made
mistake is to mark such directory storages as shared - they are not, as
each node has different content. a shared directory storage would be one
located on NFS or CIFS, for example.




More information about the pve-user mailing list