This is unreleased documentation for SUSE® Storage 1.11 (Dev).

SUSE Storage with CDI Imports

This document explains how to use the Containerized Data Importer (CDI) to import Raw or QCOW2 images into SUSE Storage. It describes the workflow for creating a reusable Golden Image and provisioning multiple workloads from it by using CSI Volume Cloning.

Overview

In Kubernetes environments that require pre-populated disk images, CDI enables importing external images into SUSE Storage-backed PersistentVolumeClaims (PVCs). These PVCs serve as reusable Golden Images for provisioning subsequent workloads.

Technically, the Golden Image acts as a Base Image PVC. SUSE Storage implements this by using CSI Volume Cloning, which creates a full, independent copy for each new claim. This approach ensures complete data isolation. Each workload receives its own writable volume, and the original Golden Image remains unchanged and independent of the clones at runtime.

Workflow

  1. Import: CDI pulls an image from an external source (HTTP, S3, or a container registry) and populates a SUSE Storage-backed PVC.

  2. Protect: This PVC functions as the Golden Image. It is recommended to treat this PVC as read-only or immutable to ensure consistency for future clones.

  3. Clone: Workloads create new PVCs that reference the base image as their dataSource. SUSE Storage copies the data from the base image to the new volume.

Creating a Base Image PVC

A DataVolume manifest specifies the source image and the Longhorn storage class. For example, the following manifest imports a QCOW2 image by using HTTP:

apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
  name: golden-base-image
spec:
  source:
    http:
      url: "https://example.com/images/base-image.qcow2"
  pvc:
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 10Gi
    storageClassName: longhorn

After creation, CDI handles the image import and conversion. The result is a SUSE Storage-backed PVC that acts as the base image. It is recommended to treat this PVC as immutable and avoid direct writes from workloads.

Cloning Base Images

Cloning a base image PVC in SUSE Storage is performed in full copy mode. This creates a complete, independent copy of the base image for each cloned PVC. Each workload therefore has its own isolated volume and does not rely on the base image for runtime operations.

The following example shows how to create a cloned PVC:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: cloned-pvc-1
spec:
  dataSource:
    name: golden-base-image
    kind: PersistentVolumeClaim
    apiGroup: ""
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
  storageClassName: longhorn

You can create multiple clones from the same base image. Each clone is a full, independent copy that ensures workload isolation.