Clone a Volume or a Snapshot

Prev Next

With VAST CSI Driver, you can create an instantly writable clone of either a Kubernetes snapshot or another Kubernetes volume.

When cloning a volume, a temporary snapshot is created behind the scenes. This transient snapshot is invisible to Kubernetes, and is eventually deleted by VAST CSI Driver once the clone operation is complete.

As with regular volumes, VAST CSI Driver automatically creates a view and a quota for the resulting clone volume on the VAST cluster. The clone is mounted to the underlying directory of the view and can be used for read and write operations. It can also be expanded through Kubernetes volume expansion.

Note

Cloning is done using Global Snapshot Clones, a feature of VAST Cluster 4.6.0 and later. Cloning is not available when using VAST CSI Driver with VAST Cluster 4.5 or earlier.

Requirements and limitations include:

  • VAST Cluster 4.6.0 or later is required.

  • Cloning cannot be used if VAST Catalog is enabled on the VAST cluster.

  • Cloning to another VAST cluster is not supported.

To clone a volume from its snapshot:

  1. Create a YAML configuration file for cloning and specify the following required parameters (see the example below for correct indentation and line breaks when specifying the keywords):

    • In metadata:

      • name is the Persistent Volume Claim (PVC) name for the clone.

    • In spec:

      • storageClassName is the name of the storage class used for the PVC.

      • In dataSource:

        • name is the PVC name of the volume that stores the snapshot from which cloning is done.

    For example:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: pvc-clone
    spec:
      storageClassName: vastdata-filesystem
      dataSource:
        name: snapshot-pvc-1
        kind: VolumeSnapshot
        apiGroup: snapshot.storage.k8s.io
      accessModes:
        - ReadWriteMany
      resources:
        requests:
          storage: 1Gi
  2. Deploy the YAML configuration file:

    kubectl apply -f vast-csi-deployment.yaml

    The output is similar to the following:

    persistentvolumeclaim/pvc-clone created
  3. Verify that the clone can be displayed:

    kubectl get pvc

    The output is similar to the following:

    NAME        STATUS VOLUME                                   CAPACITY ACCESS MODES STORAGECLASS        AGE
    pvc-clone   Bound  pvc-c212dc9e-1b72-49da-8a58-8c1ceb97b9e3 1Gi      RWX          vastdata-filesystem 7s