Skip to content

Conversation

danilrwx
Copy link
Contributor

@danilrwx danilrwx commented Sep 1, 2025

Description

This pull request implements a comprehensive VM clone operation feature. The changes include:

  • Added new Clone operation type to VirtualMachineOperationType.
  • Added snapshot condition support for VMs during restore operations
  • Implemented clone controller with comprehensive resource management
  • Added support for resource tracking during restore operations
  • Enhanced CRD definitions with restore operation specifications

The implementation provides three restore modes:

  • DryRun: Validates compatibility without making changes
  • Strict: Clone exactly as in the snapshot, failing if dependencies are missing
  • BestEffort: Clone while handling missing external dependencies gracefully

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

Virtual machine snapshots are essential for backup and disaster recovery scenarios, but without a proper restore mechanism, snapshots are only half of the solution. This PR implements a reliable way to clone VMs, ensuring that VMs can be clone with proper dependency validation and conflict resolution.

What is the expected result?

  1. Create clone operations using the new VirtualMachineOperation with type: Clone.
  2. Specify clone parameters including the source VM name and clone mode.
  3. Monitor restore progress through the operation status and resource tracking.
  4. Handle restore conflicts through different restore modes (Strict vs BestEffort).
  5. Validate restore compatibility using DryRun mode before actual restoration.
  6. Add prefix and suffix for conflicts name resolutions.
  7. Add nameReplacement for conflicts name resolutions.

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: vmop
type: feature
summary: "Added an operation with the `Clone` type to create a clone of a VM from an existing VM (`VirtualMachineOperation` `.spec.type: Clone`)."

@danilrwx danilrwx force-pushed the feat/vmop/clone-operation branch from eecd1e5 to 019d271 Compare September 1, 2025 15:16
@danilrwx danilrwx added this to the v0.26.0 milestone Sep 1, 2025
@danilrwx danilrwx force-pushed the feat/vmop/clone-operation branch 2 times, most recently from 872b3fa to 46aaa23 Compare September 1, 2025 15:56
@danilrwx danilrwx changed the base branch from main to feat/vmop/restore-operation September 1, 2025 16:39
@danilrwx danilrwx force-pushed the feat/vmop/clone-operation branch 4 times, most recently from 5549f9c to 34fc556 Compare September 3, 2025 15:32
@danilrwx danilrwx force-pushed the feat/vmop/restore-operation branch from c20bafc to c0a16fb Compare September 3, 2025 15:54
@danilrwx danilrwx force-pushed the feat/vmop/clone-operation branch 7 times, most recently from 03bd135 to 2e88b8e Compare September 5, 2025 13:41
@danilrwx danilrwx force-pushed the feat/vmop/restore-operation branch from f29d138 to 6a5f64e Compare September 5, 2025 13:48
@danilrwx danilrwx force-pushed the feat/vmop/clone-operation branch 11 times, most recently from 668150c to 799020b Compare September 9, 2025 07:53
prismagod
prismagod previously approved these changes Sep 15, 2025
Signed-off-by: Vladislav Panfilov <[email protected]>
prismagod
prismagod previously approved these changes Sep 15, 2025
z9r5
z9r5 previously approved these changes Sep 15, 2025
Signed-off-by: Dmitry Lopatin <[email protected]>
@LopatinDmitr LopatinDmitr dismissed stale reviews from z9r5 and prismagod via b992651 September 17, 2025 20:14
@LopatinDmitr LopatinDmitr force-pushed the feat/vmop/clone-operation branch 6 times, most recently from 9f55e48 to 34031ba Compare September 18, 2025 13:45
@LopatinDmitr LopatinDmitr force-pushed the feat/vmop/clone-operation branch from 34031ba to 94ec7d8 Compare September 18, 2025 14:50
Signed-off-by: Dmitry Lopatin <[email protected]>
@LopatinDmitr LopatinDmitr merged commit 8151480 into main Sep 22, 2025
124 of 150 checks passed
@LopatinDmitr LopatinDmitr deleted the feat/vmop/clone-operation branch September 22, 2025 11: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.

6 participants