Skip to main content
Version: v1.5 (dev)

Local Storage Support

Available as of v1.4.0

Harvester v1.4.0 allows you to use local storage on the host to create persistent volumes for your workloads with better performance and latency. This functionality is made possible by LVM, which provides logical volume management facilities on Linux.

Installing and Enabling harvester-csi-driver-lvm

The harvester-csi-driver-lvm add-on is a CSI driver that supports local path provisioning through LVM. It is not packaged into the Harvester ISO, but is available in the experimental-addons repository.

If you are using the Harvester kubeconfig file, you can perform the following steps:

  1. Install the add-on by running the following command:
# kubectl apply -f https://raw.githubusercontent.com/harvester/experimental-addons/main/harvester-csi-driver-lvm/harvester-csi-driver-lvm.yaml
  1. On the Harvester UI, go to Advanced > Add-ons.

  2. Select harvester-csi-driver-lvm (Experimental), and then select > Enable.

Creating a Volume Group for LVM

A volume group combines physical volumes to create a single storage structure that can be divided into logical volumes.

note

Harvester currently does not allow you to modify the volume group composition (add or remove disks) after you create a logical volume. This issue will be addressed in a future release.

  1. Verify that the harvester-csi-driver-lvm add-on is installed.

  2. On the Harvester UI, go to the Hosts screen.

  3. Select the target host, and then select > Edit Config.

  4. On the Storage tab, add disks for the volume group.

    Configure the following settings for each selected disk:

  • Provisioner: Select LVM.

  • Volume Group: Select an existing volume group or specify a name for a new volume group.

    For more information about adding disks, see Multi-Disk Management.

  1. Click Save.

  2. On the host details screen, verify that the disks were added and the correct provisioner was set.

Creating a StorageClass for LVM

note

You can only use one type of local volume in each volume group. If necessary, create different volume groups for the volume types that you want to use.

  1. On the Harvester UI, go to the Storage screen.

  2. Create a new StorageClass and select LVM in the Provisioner list.

  3. On the Parameters tab, configure the following settings:

  • Node: Select the target node for the intended workloads.

  • Volume Group Name: Select the volume group that you created.

  • Volume Group Type: Select the type of local volume that matches your requirements. Harvester currently supports striped and dm-thin.

  1. Click Save.

  2. On the Storage screen, verify that the StorageClass was created and the correct provisioner was set.

For more information, see StorageClass.

Creating a Volume with LVM

  1. On the Harvester UI, go to the Volumes screen.

  2. Create a new volume using the LVM StorageClass that you created.

    note

    The status Not Ready is normal because Harvester creates the LVM volume only when the first workload is created.

  3. On the Virtual Machines screen, select the target virtual machine, and then select > Add Volume.

    note

    Because the LVM volume is a local volume, you must ensure that the target node of the LVM StorageClass is the node on which the virtual machine is scheduled.

  4. Specify the volume that you want to attach.

  5. On the Volumes screen, verify that the state is In-use.

You can also create a new virtual machine with the volume of the LVM StorageClass that you created. This virtual machine will be scheduled on the target node with local storage for the volume.

Creating Snapshots for an LVM Volume

  1. On the Harvester UI, go to the Settings screen.

  2. In the csi-driver-config section, select > Edit Setting.

  3. Add an entry with the following settings:

  • Provisioner: Select lvm.driver.harvesterhci.io.

  • Volume Snapshot Class Name: Select lvm-snapshot.

  • Backup Volume Snapshot Class Name: Select lvm-snapshot.

  1. On the Virtual Machines screen, select the target virtual machine, and then select > Take Virtual Machine Snapshot.

    Example:

  2. On the Virtual Machine Snapshots screen, verify that snapshot is ready to use.

Supported LVM Volume Features

  • Volume resizing
  • Volume cloning
  • Snapshot creation
note

Backup creation is currently not supported. This limitation will be addressed in a future release.