fix(vmop): prevent Maintenance mode from getting stuck during restore#2144
Merged
Conversation
Return reconcile.Result instead of nil to properly complete the reconciliation loop when snapshot steps exit early (exit maintenance step, waiting disk ready step). Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
yaroslavborbat
previously approved these changes
Mar 24, 2026
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
yaroslavborbat
approved these changes
Mar 24, 2026
Merged
Isteb4k
pushed a commit
that referenced
this pull request
Mar 25, 2026
…#2144) * fix(vmop): prevent Maintenance mode from getting stuck during restore Return reconcile.Result instead of nil to properly complete the reconciliation loop when snapshot steps exit early (exit maintenance step, waiting disk ready step). Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com> * fix(vmop): set maintenance condition to false instead of early return Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com> --------- Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com> (cherry picked from commit 8b2b353)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Return
reconcile.Result{}instead ofnilfrom two snapshot restore steps to properly complete the reconciliation loop when exiting early.Changes in:
exit_maintenance_step.go— return&reconcile.Result{}, nilafter setting Maintenance condition to Falsewaiting_disk_ready_step.go— return&reconcile.Result{}, nilwhen VirtualDisk is already ReadyWhy do we need it, and what problem does it solve?
When performing a snapshot restore, the VM can get stuck in Maintenance mode indefinitely. This happens because returning
nilfrom a reconcile step causes the controller to skip requeue, but the VM's Maintenance condition was already updated. Without requeue, subsequent reconciliations never process the next steps in the restore pipeline.What is the expected result?
Checklist
Changelog entries