Skip to content

LifeCycleManager::trigger_deploy_success does not update running_stime when transitioning from BOOT* to RUNNING #8181

Open

Description

@trukhinyuri

Description
Commit 038e3420ed (#4416) added ignore_state_update() in src/im/InformationManager.cc (the_time - vm->get_running_stime() < 30) so stale monitoring polls don't overwrite a VM's state right after a transition.

In LifeCycleManager::trigger_deploy_success() (src/lcm/LifeCycleStates.cc), vm->set_running_stime(...) is called in the MIGRATE branch (line 325), but not in the BOOT* branch (lines 353-378). For BOOT* transitions, running_stime stays at the timestamp set when PROLOG finished (prolog_success_action, line 743) or when BOOT_POWEROFF / BOOT_SUSPENDED started (LifeCycleActions.cc, lines 813 and 875), and is not updated at all when recovering from BOOT_FAILURE or BOOT_UNKNOWN.

When vmm/deploy or vmm/restore takes 30s or more (or after onevm recover --retry from BOOT_FAILURE), time(0) - vm->get_running_stime() is already >= 30 by the time the VM becomes RUNNING. If a host SYNC_STATE poll collected while the VM was still booting is processed right after DEPLOY_SUCCESS, ignore_state_update() returns false and process_vm_states() moves the newly started VM to POWEROFF (VM reported as missing by the drivers, moving it to poweroff).

To Reproduce

  1. Deploy or resume a VM where vmm/deploy takes >= 30s (or retry a VM from BOOT_FAILURE after 30s).
  2. Have a host SYNC_STATE poll collected just before virsh create finishes arrive at InformationManager::process_vm_states right after trigger_deploy_success.
  3. ignore_state_update() returns false and the running VM is marked POWEROFF.

Expected behavior
LifeCycleManager::trigger_deploy_success() should update vm->set_running_stime(time(0)) in the BOOT* branch too, matching the MIGRATE branch.

Details

  • Affected Component: Core (LCM)
  • Hypervisor: KVM
  • Version: 6.10, 7.0, master

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions