ProxmoxVirtualisation

    Convert Existing ZFS on Proxmox to Thin Provisioning

    If you’ve already setup your ZFS pool and hadn’t done it at the Data Center > Storage Level, but on the node itself or hadn’t ticked the thin box and have then gone on to create a load of VM’s, you might suddenly find you’ve used up all the storage.

    There proxmox GUI doesn’t give you a way to make a disk thin even once you enable thin provisioning, but instead requires you to migrate the storage twice to so.

    First we need to enable thin provsioning on the existing pool. This can be done two ways:

    Option 1: Use the GUI to tick the thin box.

    Option 2: Edit the storage configuration file /etc/pve/storage.cfg and add the keyword sparse under the ZFS Pool.

    vim /etc/pve/storage.cfg
    zfspool: VMStorageHDD
            pool VMStorageHDD
            content images,rootdir
            mountpoint /VMStorageHDD
            nodes proxmox1
            sparse
    

    This now means the next time you create a VM the disk will be thin provisioned.

    To modify existing VM’s you have two options:

    1. Migrate the Disk to another Storage device and then migrate it back.
    2. Use the CLI command as follows for each disk:
    zfs set refreservation=0G VMStorageHDD/vm-114-disk-0

    This should give you everything you need to free up some storage!

    Hi, I’m Richard

    Leave a Reply

    Your email address will not be published. Required fields are marked *