Skip to content

Conversation

@hardcoretime
Copy link
Contributor

@hardcoretime hardcoretime commented Jun 1, 2025

Description

The restoreMode option has been added to the VirtualMachineRestore resource. It can take two values: safe and forced. The safe mode is used when there are no conflicts with existing resources. The forced mode can be applied to a running VirtualMachine, but it can be a destructive action if problems occur during the restoration process.

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

It is important to have the ability to restore a VirtualMachine as soon as required.

What is the expected result?

A VirtualMachine can be restored if there are no conflicts with VirtualDisks and VMIP resources. If VirtualDisks are used by another VirtualMachine or a VMIP exists with an IP address reserved by another VirtualMachine, the restoration process will fail.

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: vmrestore
type: feature
summary: | 
  Added the ability to forcefully restore a virtual machine from a snapshot using the restoreMode parameter. This parameter has two possible values:
  - Safe - a safe recovery option when there are no conflicts with the virtual machine's resources;
  - Forced - a forced recovery option that can be applied to a running virtual machine but may lead to destructive consequences if conflicts arise during the recovery process.
  
  If the forcibly restored virtual disks are used by another virtual machine or the restored IP address is reserved by another virtual machine, the recovery process will fail, and this will be reported in the VirtualMachineRestore resource status.

@hardcoretime hardcoretime added this to the v0.20.0 milestone Jun 1, 2025
@hardcoretime hardcoretime force-pushed the feat/vmrestore/add-force-option branch 14 times, most recently from e0efd0a to b834223 Compare June 6, 2025 09:12
@hardcoretime hardcoretime force-pushed the feat/vmrestore/add-force-option branch 14 times, most recently from 2a4e4b4 to adf63b5 Compare June 10, 2025 01:04
danilrwx
danilrwx previously approved these changes Jul 21, 2025
Copy link
Member

@z9r5 z9r5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments

Copy link
Member

@z9r5 z9r5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments

@hardcoretime hardcoretime force-pushed the feat/vmrestore/add-force-option branch from e8cbac8 to ebd1de8 Compare July 21, 2025 19:25
@hardcoretime hardcoretime added the e2e/run Run e2e test on cluster of PR author label Jul 21, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Jul 21, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: failure.

@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Jul 22, 2025
danilrwx
danilrwx previously approved these changes Jul 22, 2025
Roman Sysoev added 8 commits July 22, 2025 11:00
- fix typo
- replace slog with deckhouse/pkg/log
- remove vmop complited status(an uuid is used)
- check that vm is existed when `forced`
- check that vm is not pending when `forced`

Signed-off-by: Roman Sysoev <[email protected]>
@hardcoretime hardcoretime force-pushed the feat/vmrestore/add-force-option branch from 97b134f to 74ed18c Compare July 22, 2025 08:00
@hardcoretime hardcoretime added the e2e/run Run e2e test on cluster of PR author label Jul 22, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Jul 22, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: failure.

@hardcoretime hardcoretime requested a review from danilrwx July 22, 2025 09:16
@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Jul 22, 2025
@hardcoretime hardcoretime merged commit c1f2471 into main Jul 22, 2025
74 of 76 checks passed
@hardcoretime hardcoretime deleted the feat/vmrestore/add-force-option branch July 22, 2025 13:40
This was referenced Jul 22, 2025
yachmenevas pushed a commit that referenced this pull request Oct 15, 2025
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.

9 participants