Skip to content

Conversation

@gangj
Copy link
Contributor

@gangj gangj commented Dec 3, 2025

During rolling pool upgrade (RPU), RestartVM guidance should only be cleared when a VM restarts on a host that has been updated to match the coordinator's software version. Previously, the guidance was cleared whenever a VM restarted, regardless of the host's update status.

This commit ensures that RestartVM guidance persists until the VM restarts on an up-to-date host, this provides accurate feedback to administrators about which VMs still need restarting after RPU.

Also adds unit tests covering 6 scenarios:

  • VM restart on updated vs old host (via xenopsd)
  • VM halt on updated vs old host (via force_state_reset)
  • Suspended VM resume on updated vs old host

@gangj gangj force-pushed the private/gangj/CA-420533 branch from c1edabb to cff51af Compare December 3, 2025 14:30
During rolling pool upgrade (RPU), RestartVM guidance should only be
cleared when a VM restarts on a host that has been updated to match
the coordinator's software version. Previously, the guidance was
cleared whenever a VM restarted, regardless of the host's update
status.

This commit ensures that RestartVM guidance persists until the VM
restarts on an up-to-date host, this provides accurate feedback to
administrators about which VMs still need restarting after RPU.

Also adds unit tests covering 6 scenarios:
* VM restart on updated vs old host (via xenopsd)
* VM halt on updated vs old host (via force_state_reset)
* Suspended VM resume on updated vs old host

Signed-off-by: Gang Ji <[email protected]>
@gangj gangj force-pushed the private/gangj/CA-420533 branch from cff51af to ba48b75 Compare December 3, 2025 14:36
remove_pending_guidance ~__context ~self ~value:`restart_device_model ;
remove_pending_guidance ~__context ~self ~value:`restart_vm
(* Only remove RestartVM guidance if host is up-to-date with coordinator *)
let resident_on = Db.VM.get_resident_on ~__context ~self in
Copy link
Member

Choose a reason for hiding this comment

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

This is in the branch of "state = `Halted". If the VM can't start on a host whose running xapi version lower than the one on the coordinator, this will not be necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is a great question!
After a VM is Halted on an up-to-date host, does it still required for it to be started on an up-to-date host to clear the RestartVM guidance?
I think it should be yes? Then we can't clear the RestartVM guidance here at all?

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.

2 participants