Skip to content

fix(vd): vdsnapshot without size annotation#2458

Open
danilrwx wants to merge 3 commits into
mainfrom
fix/vd/vdsnapshot-without-size-annotation
Open

fix(vd): vdsnapshot without size annotation#2458
danilrwx wants to merge 3 commits into
mainfrom
fix/vd/vdsnapshot-without-size-annotation

Conversation

@danilrwx

@danilrwx danilrwx commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Description

Handle legacy VirtualDiskSnapshot restores for NFS snapshots that do not have the virtualization.deckhouse.io/vd-original-size annotation.

When a VirtualDisk is restored from such a snapshot and the source StorageClass provisioner is nfs.csi.k8s.io, the controller no longer falls back to VolumeSnapshot.status.restoreSize silently. Instead, it stops provisioning and waits for the user to specify spec.persistentVolumeClaim.size explicitly.

The change adds:

  • SnapshotSizeFallback condition on VirtualDisk;
  • DataSourceImportFallback warning event;
  • tests for NFS and non-NFS provisioners.

Why do we need it, and what problem does it solve?

Legacy NFS snapshots may not contain the original requested VirtualDisk size annotation. Falling back to VolumeSnapshot.status.restoreSize can create a PVC with an unexpected size.

For NFS snapshots without the annotation, the controller now makes the situation explicit and requires the user to provide the desired disk size before provisioning continues.

What is the expected result?

  1. Create a VirtualDisk from a legacy VirtualDiskSnapshot whose VolumeSnapshot has no vd-original-size annotation.
  2. If the snapshot StorageClass provisioner is nfs.csi.k8s.io and spec.persistentVolumeClaim.size is not set, verify that:
    • PVC is not created;
    • VirtualDisk remains in Pending;
    • Ready=False with ProvisioningNotStarted reason;
    • SnapshotSizeFallback=True with LegacyNFSVolumeSnapshot reason;
    • DataSourceImportFallback warning event is emitted.
  3. Specify spec.persistentVolumeClaim.size and verify that provisioning continues.
  4. Verify that non-NFS snapshots keep the previous fallback behavior.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: vd
type: fix
summary: Require explicit VirtualDisk size when restoring legacy NFS snapshots without original size metadata.

@danilrwx danilrwx marked this pull request as ready for review June 9, 2026 10:43
@danilrwx danilrwx added this to the v1.9.0 milestone Jun 9, 2026
danilrwx added 3 commits June 9, 2026 14:00
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
@danilrwx danilrwx force-pushed the fix/vd/vdsnapshot-without-size-annotation branch from f9a247b to d0725f1 Compare June 9, 2026 12:00
@universal-itengineer universal-itengineer modified the milestones: v1.9.0, v1.10.0 Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants