Skip to main content
Version: v1.6 (Dev)

Create a Volume

Create an Empty Volume

Header Section

  1. Set the Volume Name.
  2. (Optional) Provide a Description for the Volume.

Basics Tab

  1. Choose New in Source.
  2. Select an existing StorageClass.
  3. Configure the Size of the volume.

create-empty-volume

Oversized Volumes

In Harvester v1.5.0, which uses Longhorn v1.8.1, oversized volumes (for example, 999999 Gi in size) are marked Not Ready and cannot be deleted.

To resolve this issue, perform the following steps:

  1. Temporarily remove the PVC webhook rule.

    kubectl patch validatingwebhookconfiguration longhorn-webhook-validator \
    --type='json' \
    -p='[{"op": "remove", "path": "/webhooks/0/rules/17"}]'
  2. Wait for the related PVC to be deleted.

  3. Restore the PVC webhook rule to re-enable validation.

    kubectl patch validatingwebhookconfiguration longhorn-webhook-validator \
    --type='json' \
    -p='[{"op": "add", "path": "/webhooks/0/rules/-", "value": {"apiGroups":[""],"apiVersions":["v1"],"operations":["UPDATE"],"resources":["persistentvolumeclaims"],"scope":"Namespaced"}}]'

The issue will be addressed in Longhorn v1.8.2, which will likely be included in Harvester v1.5.1.

Related issues:

Create an Image Volume

Header Section

  1. Set the Volume Name.
  2. (Optional) Provide a Description for the Volume.

Basics Tab

  1. Choose VM Image in Source.
  2. Select an existing Image.
  3. Configure the Size of the volume.
important

When creating volumes from a VM image, ensure that the volume size is greater than or equal to the image size. The volume may become corrupted if the configured volume size is less than the size of the underlying image. This is particularly important for qcow2 images because the virtual size is typically greater than the physical size.

By default, Harvester will set the volume size to the virtual size of the image.

create-image-volume