Skip to content

fix(vmop): restore requested virtual disk size from snapshot metadata#2278

Merged
danilrwx merged 6 commits into
mainfrom
fix/vmop/restored-disk-size-small
Apr 28, 2026
Merged

fix(vmop): restore requested virtual disk size from snapshot metadata#2278
danilrwx merged 6 commits into
mainfrom
fix/vmop/restored-disk-size-small

Conversation

@danilrwx
Copy link
Copy Markdown
Contributor

@danilrwx danilrwx commented Apr 27, 2026

Description

Restore the original requested VirtualDisk PVC size when restoring VM disks from snapshots.

The change stores vd-original-size in the VolumeSnapshot annotations during VirtualDiskSnapshot creation and uses this annotation when VMOP restores VirtualDisks from snapshot resources. If the annotation is absent, the restore flow keeps the previous behavior.

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

A restored VirtualDisk could be created without the original requested PVC size and rely on the snapshot restore defaults. This could make the restored disk size differ from the size requested by the source VirtualDisk.

Persisting and reading the original size from snapshot metadata makes VMOP restore recreate VirtualDisks with the same requested PVC size as the original disk.

What is the expected result?

  1. Create a VirtualDisk with a requested PVC size.
  2. Create a VirtualDiskSnapshot for this disk.
  3. Restore the VM or disk via VMOP from the snapshot.
  4. Verify that the restored VirtualDisk has spec.persistentVolumeClaim.size equal to the original requested size.
  5. Verify that the corresponding VolumeSnapshot contains the virtualization.deckhouse.io/vd-original-size annotation.

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: Restore requested VirtualDisk size from snapshot metadata.
impact_level: low

@danilrwx danilrwx force-pushed the fix/vmop/restored-disk-size-small branch from 2c500cd to 75627bf Compare April 27, 2026 09:43
@danilrwx danilrwx added this to the v1.9.0 milestone Apr 27, 2026
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
@danilrwx danilrwx force-pushed the fix/vmop/restored-disk-size-small branch from 75627bf to 52020de Compare April 27, 2026 12:01
@danilrwx danilrwx marked this pull request as ready for review April 27, 2026 12:02
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>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Comment thread images/virtualization-artifact/pkg/common/annotations/annotations.go Outdated
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
@danilrwx danilrwx merged commit 51235eb into main Apr 28, 2026
27 of 28 checks passed
@danilrwx danilrwx deleted the fix/vmop/restored-disk-size-small branch April 28, 2026 08:11
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