From 58749551c19163de09743b3c7f30da55ff63ca80 Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Tue, 1 Dec 2026 13:50:05 +0100 Subject: [PATCH 1/2] fix(velero): bump server and node-agent to 1.18.5 Every VM backup that grouped its disks into a VolumeGroupSnapshot timed out after CSISnapshotTimeout (10 minutes) with the guest filesystems frozen, then failed. Velero 1.18.1 only accepted member snapshots whose owner reference carried groupsnapshot.storage.k8s.io/v1beta2, while snapshot-controller v8.7.0 writes v1, so no member ever matched. Velero 1.18.5 matches members by kind and UID and negotiates the group snapshot version the cluster serves. It is a patch release on the same line, so the chart, plugins and CRDs stay; no chart release ships it yet, hence the image tag override. Group snapshots, and with them one freeze for all of a VM's disks, keep working. Assisted-by: LLM Signed-off-by: Andrei Kvapil --- .../system/snapshot-controller/tests/crds_test.yaml | 6 +++--- packages/system/velero/tests/velero_test.yaml | 13 ++++++++++++- packages/system/velero/values.yaml | 9 +++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/packages/system/snapshot-controller/tests/crds_test.yaml b/packages/system/snapshot-controller/tests/crds_test.yaml index 202f0901c..d4c878299 100644 --- a/packages/system/snapshot-controller/tests/crds_test.yaml +++ b/packages/system/snapshot-controller/tests/crds_test.yaml @@ -3,9 +3,9 @@ suite: snapshot CRDs and the VolumeGroupSnapshot gate # The vendored chart renders the snapshot CRDs from a template, so they belong # to this release: keepCRDs stops an uninstall from taking every VolumeSnapshot # with them. The group snapshot API is read at v1 by snapshot-controller, -# csi-snapshotter and the linstor gate, and at v1beta2 by Velero 1.18 and the -# vm-instance hook. The controller only acts on group snapshots with the -# CSIVolumeGroupSnapshot gate on. +# csi-snapshotter, the linstor gate and Velero 1.18.5 (which takes the highest +# version served), and at v1beta2 by the vm-instance hook. The controller only +# acts on group snapshots with the CSIVolumeGroupSnapshot gate on. templates: - charts/snapshot-controller/templates/crds.yaml diff --git a/packages/system/velero/tests/velero_test.yaml b/packages/system/velero/tests/velero_test.yaml index 75dc378dd..43998eaf8 100644 --- a/packages/system/velero/tests/velero_test.yaml +++ b/packages/system/velero/tests/velero_test.yaml @@ -11,7 +11,18 @@ tests: asserts: - equal: path: spec.template.spec.containers[0].image - value: docker.io/velero/velero:v1.18.1 + value: docker.io/velero/velero:v1.18.5 + + # The data mover runs in node-agent on the same image. Below 1.18.5 a VM + # backup that groups its disks never sees its snapshots on a cluster whose + # snapshot-controller writes v1 owner references, and times out with the + # guest frozen. + - it: runs node-agent on the same Velero release as the server + template: charts/velero/templates/node-agent-daemonset.yaml + asserts: + - equal: + path: spec.template.spec.containers[?(@.name=="node-agent")].image + value: docker.io/velero/velero:v1.18.5 - it: pins the backup-plugin initContainers to velero-1.18-compatible releases template: charts/velero/templates/deployment.yaml diff --git a/packages/system/velero/values.yaml b/packages/system/velero/values.yaml index fccb6e0aa..9fd984a9b 100644 --- a/packages/system/velero/values.yaml +++ b/packages/system/velero/values.yaml @@ -1,4 +1,13 @@ velero: + # Velero 1.18.1, which chart 12.0.3 ships, keeps a volume group snapshot's + # members only when their owner reference says + # groupsnapshot.storage.k8s.io/v1beta2. snapshot-controller v8.7.0 writes + # v1, so a VM backup waited out CSISnapshotTimeout (10 minutes) with the + # guest filesystems frozen and then failed. 1.18.5 matches members by kind + # and UID and talks to whichever group snapshot version the cluster serves. + # No chart release carries 1.18.5 yet; drop this override once one does. + image: + tag: v1.18.5 # Disable the upgrade-crds Job: CRD lifecycle is owned by the generated # HelmRelease instead (upgradeCRDs: CreateReplace on the velero PackageSource), # which applies the chart's crds/ directory on install and on every upgrade, From 26af1dafe50407773a34eaa38ef301caa292ccc0 Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Tue, 1 Dec 2026 13:50:07 +0100 Subject: [PATCH 2/2] fix(vm-instance): render empty disk lists as arrays A VMInstance with no disks and no cloud-init rendered `disks:` and `volumes:` as null, and the KubeVirt webhook refused the VirtualMachine because both fields must be arrays. Assisted-by: LLM Signed-off-by: Andrei Kvapil --- packages/apps/vm-instance/templates/vm.yaml | 4 +-- .../tests/disk_boot_order_test.yaml | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/packages/apps/vm-instance/templates/vm.yaml b/packages/apps/vm-instance/templates/vm.yaml index d7288a61e..e3682e3c5 100644 --- a/packages/apps/vm-instance/templates/vm.yaml +++ b/packages/apps/vm-instance/templates/vm.yaml @@ -116,7 +116,7 @@ spec: deviceName: {{ $gpu.name }} {{- end }} {{- end }} - disks: + disks:{{ if not (or .Values.disks .Values.cloudInit .Values.sshKeys .Values.netplanDhcp) }} []{{ end }} {{- /* KubeVirt rejects two devices sharing a bootOrder, so a clash is reported here with the disk names rather than surfacing as a webhook denial on the VirtualMachine. */}} @@ -172,7 +172,7 @@ spec: {{- include "virtual-machine.nodeAffinity" . | nindent 6 }} - volumes: + volumes:{{ if not (or .Values.disks .Values.cloudInit .Values.sshKeys .Values.netplanDhcp) }} []{{ end }} {{- range .Values.disks }} - name: disk-{{ .name }} dataVolume: diff --git a/packages/apps/vm-instance/tests/disk_boot_order_test.yaml b/packages/apps/vm-instance/tests/disk_boot_order_test.yaml index 146cbaf53..ee4eee320 100644 --- a/packages/apps/vm-instance/tests/disk_boot_order_test.yaml +++ b/packages/apps/vm-instance/tests/disk_boot_order_test.yaml @@ -126,3 +126,30 @@ tests: asserts: - failedTemplate: errorPattern: "minimum" + + # KubeVirt's schema wants arrays here; an empty block renders as null and + # the VirtualMachine is refused ("must be of type array"). + - it: renders an empty disk and volume list for a VM without disks + set: + disks: [] + asserts: + - equal: + path: spec.template.spec.domain.devices.disks + value: [] + - equal: + path: spec.template.spec.volumes + value: [] + + - it: keeps only the cloud-init disk for a VM without disks but with cloud-init + set: + disks: [] + cloudInit: "#cloud-config" + asserts: + - equal: + path: spec.template.spec.domain.devices.disks + value: + - name: cloudinitdisk + disk: {} + - lengthEqual: + path: spec.template.spec.volumes + count: 1