Skip to content

B #8179: Run VMM cleanup when deleting VMs in EPILOG* states - #8180

Open
trukhinyuri wants to merge 1 commit into
OpenNebula:masterfrom
trukhinyuri:fix/lcm-cleanup-epilog-vmm
Open

trukhinyuri wants to merge 1 commit into
OpenNebula:masterfrom
trukhinyuri:fix/lcm-cleanup-epilog-vmm

Conversation

@trukhinyuri

@trukhinyuri trukhinyuri commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #8179.

LifeCycleManager::clean_up_vm() handles EPILOG, EPILOG_STOP, EPILOG_UNDEPLOY and their *_FAILURE variants with a plain tm->trigger_epilog_delete(vm). Every other state where a domain may exist on the host goes through vmm->trigger_cleanup().

Normally the domain is already gone when the VM reaches EPILOG*, but that is not guaranteed. For example, onevm recover --success on a VM stuck in SHUTDOWN or SAVE_STOP moves it to EPILOG* while the domain may still be running. If the TM delete then fails and the VM is removed with onevm terminate --hard or onevm recover --delete, nothing cancels the domain and it keeps running (and using its IP/MAC) after the VM is DONE.

This change uses vmm->trigger_cleanup(vid, false) for those states. The driver CLEANUP action (one_vmm_exec.rb) runs vmm/cancel with no_fail, then vnm/clean, then the same TM delete commands produced by TransferManager::epilog_delete_commands() that trigger_epilog_delete() uses today. When the domain is already gone, the extra steps are no-ops.

Branches to which this PR applies

  • master
  • one-7.0

  • Check this if this PR should not be squashed

Copilot AI balanced review requested due to automatic review settings October 14, 2026 11:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change correctly uses the existing ordered VMM cleanup workflow and addresses the orphaned-domain failure mode.

0 open findings

What changed in this PR

Routes EPILOG-state cleanup through VMM cleanup to terminate hypervisor domains before deleting storage.

Changes:

  • Replaces direct TM epilog deletion with coordinated VMM cleanup.
File Description
src/​lcm/​LifeCycleActions.cc Triggers VMM cleanup for EPILOG states.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

LifeCycleManager::clean_up_vm() only issued the TM delete for VMs in
EPILOG, EPILOG_STOP, EPILOG_UNDEPLOY and their *_FAILURE variants.
If the domain is still present on the host (for example after
"onevm recover --success" on a VM stuck in SHUTDOWN or SAVE_STOP), it
is never cancelled and keeps running after the VM reaches DONE.

Use vmm->trigger_cleanup() as the other running states do. The driver
CLEANUP action cancels the domain (no_fail), runs vnm clean and then
the same TM delete commands built by epilog_delete_commands().

Signed-off-by: Iurii Trukhin <yuri@trukhin.com>
@trukhinyuri
trukhinyuri force-pushed the fix/lcm-cleanup-epilog-vmm branch from 0747fc7 to 2dfe76e Compare October 14, 2026 11:54
@trukhinyuri trukhinyuri changed the title B #8179: Trigger VMM cleanup in clean_up_vm for EPILOG* states B #8179: Run VMM cleanup when deleting VMs in EPILOG* states Oct 14, 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.

LifeCycleManager::clean_up_vm skips VMM cleanup in EPILOG* states, leaving orphaned hypervisor VMs after EPILOG_FAILURE

3 participants