Skip to content

xapi_vm_lifecycle: Only consult data-cant-suspend-reason and feature-suspend for live VMs#7047

Merged
last-genius merged 1 commit intoxapi-project:masterfrom
last-genius:asv/fix-lifecycle
Apr 30, 2026
Merged

xapi_vm_lifecycle: Only consult data-cant-suspend-reason and feature-suspend for live VMs#7047
last-genius merged 1 commit intoxapi-project:masterfrom
last-genius:asv/fix-lifecycle

Conversation

@last-genius
Copy link
Copy Markdown
Contributor

@last-genius last-genius commented Apr 30, 2026

Otherwise, a shutdown VM that had data/cant_suspend_reason populated during its runtime will not be migratable with VM_NON_SUSPENDABLE error.

Additionally uses Xapi_vm_lifecycle_helpers.is_live (which checks for both Paused and Running) instead of a check for Running to determine if the VM is live.

The following matrix of cases was tested:

  • Test on migratable Windows (shouldn't block suspend) → OK

  • Test on Windows with a non-migratable device (should block suspend as VM
    lacks feature) → OK

  • Test on migratable Linux with XenServer tools (shouldn't block) → OK

  • Test on migratable Linux with XCP-ng tools (shouldn't block) → OK

  • Test on Linux with a non-migratable device (should block) → OK

  • Test nopv Windows/Linux without unmigratable devices with manual
    feature-suspend xenstore entry forced (shouldn't block, should
    resume correctly)

    • Windows BIOS → OK

    • Linux BIOS → OK

  • Test VDI migration on VM that had cant_suspend_reason populated but was
    shut down (shouldn't block VDI migration) → OK

Fixes: c895469 ("xapi_vm_lifecycle: Disallow suspend when cant_suspend_reason is present")

…suspend for live VMs

Otherwise, a shutdown VM that had data/cant_suspend_reason populated during its
runtime will not be migratable with VM_NON_SUSPENDABLE error.

Additionally uses Xapi_vm_lifecycle_helpers.is_live (which checks for both
`Paused and `Running) instead of a check for `Running to determine if the VM is
live.

The following matrix of cases was tested:

[x] Test on migratable Windows (shouldn't block suspend) → OK

[x] Test on Windows with a non-migratable device (should block suspend as VM
    lacks feature) → OK

[x] Test on migratable Linux with XenServer tools (shouldn't block) → OK

[x] Test on migratable Linux with XCP-ng tools (shouldn't block) → OK

[x] Test on Linux with a non-migratable device (should block) → OK

[x] Test nopv Windows/Linux without unmigratable devices with manual
    `feature-suspend` xenstore entry forced (shouldn't block, should
    resume correctly)

  [x] Windows BIOS → OK

  [x] Linux BIOS → OK

[x] Test VDI migration on VM that had cant_suspend_reason populated but was
    shut down (shouldn't block VDI migration) → OK

Fixes: c895469 ("xapi_vm_lifecycle: Disallow suspend when cant_suspend_reason is present")

Signed-off-by: Andrii Sultanov <andriy.sultanov@vates.tech>
@last-genius last-genius added this pull request to the merge queue Apr 30, 2026
Merged via the queue into xapi-project:master with commit ca64708 Apr 30, 2026
18 of 19 checks passed
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.

3 participants