--- # CDI StorageProfiles — the storage "recipes" CDI uses when it provisions/clones VM disk PVCs # (ADR-0005). CONSUME the cdi.kubevirt.io CRD registered by the CDI operator (platform pass), so — # like cdi-cr.yaml — these CRs are applied by the `platform-config` Flux Kustomization # (dependsOn: platform). They live here beside the KubeVirt/CDI component and are referenced in # place from platform-config/kustomization.yaml. # # CDI AUTO-CREATES a StorageProfile per StorageClass and fills its STATUS (inferred capabilities). # The operator owns `.status`; the USER owns `.spec`. Setting `.spec` here does NOT fight CDI — it # overrides only the fields we set (server-side apply), and CDI keeps reconciling status around them. # # ── longhorn: turn on SNAPSHOT smart-clone ───────────────────────────────────────────────────── # Default (empty spec) the longhorn profile reports `cloneStrategy: copy` — CDI clones a golden image # by spinning a host-assisted byte-for-byte copy pod (slow, doubles I/O). With external-snapshotter # installed and a driver.longhorn.io VolumeSnapshotClass present (../longhorn/volumesnapshotclass.yaml), # `cloneStrategy: snapshot` makes CDI clone by taking a CSI VolumeSnapshot and provisioning the new # PVC from it — near-instant, space-efficient. claimPropertySets left unset: CDI keeps inferring the # class's native RWO/Filesystem, correct for ordinary (non-migratable) longhorn PVCs. apiVersion: cdi.kubevirt.io/v1beta1 kind: StorageProfile metadata: name: longhorn annotations: homelab.keithjackson.dev/adr: ADR-0005 spec: cloneStrategy: snapshot --- # ── longhorn-vm: SNAPSHOT smart-clone + RWX/Block for live-migratable VM disks ────────────────── # This is the default *virtualization* StorageClass (is-default-virt-class in ../longhorn/ # storageclasses.yaml). Its profile must advertise the access/volume mode combo Longhorn 1.7.3 # supports for migratable RWX — ReadWriteMany + Block — so every VM DataVolume CDI provisions on this # class is stamped RWX/Block and is therefore live-migratable. Together with cloneStrategy: snapshot # (smart clone) this profile is NON-DEGRADED (supports smart-clone AND RWX), which is what clears the # CDIDefaultStorageClassDegraded alert (the default virt class must support BOTH). apiVersion: cdi.kubevirt.io/v1beta1 kind: StorageProfile metadata: name: longhorn-vm annotations: homelab.keithjackson.dev/adr: ADR-0005 spec: cloneStrategy: snapshot claimPropertySets: - accessModes: - ReadWriteMany volumeMode: Block