Skip to content

fix(vd): use requested size for PVC generated from snapshot when available#2109

Open
danilrwx wants to merge 1 commit intomainfrom
fix/vd-snapshot-restore-size
Open

fix(vd): use requested size for PVC generated from snapshot when available#2109
danilrwx wants to merge 1 commit intomainfrom
fix/vd-snapshot-restore-size

Conversation

@danilrwx
Copy link
Copy Markdown
Contributor

@danilrwx danilrwx commented Mar 16, 2026

Fixes an issue when restoring a snapshot on NFS CSI results in tiny PVC instead of original size.

Description

When restoring a VirtualDisk from a VDSnapshot on NFS CSI, the PVC was created with an incorrect (tiny) size instead of the requested size from vd.Spec.PersistentVolumeClaim.Size.

The fix checks for vd.Spec.PersistentVolumeClaim.Size first and uses it for PVC creation. Falls back to vs.Status.RestoreSize only if size is not explicitly specified in the VirtualDisk spec.

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

On NFS CSI, restoring a snapshot resulted in a PVC with an incorrect size (likely 0 or minimal size), causing VM boot failures. This fix ensures the PVC is created with the explicitly requested size when available.

What is the expected result?

  1. Create a VirtualDisk with explicit persistentVolumeClaim.size
  2. Create a VDSnapshot from that disk
  3. Restore a new VirtualDisk from the snapshot
  4. Verify the restored PVC has the requested size, not the tiny restore size

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: core
type: fix
summary: "Use requested size for PVC generated from VDSnapshot when available."

…lable

Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
@danilrwx danilrwx force-pushed the fix/vd-snapshot-restore-size branch from fb0cab5 to b10884a Compare March 24, 2026 16:28
@danilrwx danilrwx added this to the v1.7.0 milestone Mar 24, 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.

1 participant