Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport: Wait for host to be in result state (#621) #667

Conversation

mwperina
Copy link
Member

  • Wait for host to be in result state

Bug introduced in #580.
The update_available is false just after the upgrade, and
HOST_UPGRADE_FINISHED_AND_WILL_BE_REBOOTED is logged. But the host is
not yet rebooted, so we still need to wait for the status to be UP or
MAINTENANCE.

Signed-off-by: Martin Nečas necas.marty@gmail.com

  • Fix wait_condition on host upgrade

In #580 we introduced a check on update_available state of the host to
determine if the host upgrade finished when there were no updates
available for te host.

The downside of this is that when the update finishes, the
update_available flag is cleared, and ansible thinks the host upgrade is
complete and starts upgrading the next node. But the reboot is not
completed yet, so result_state != h.status.

The fix here is to save the update_available status before starting the
update. If there were no updates and status hasn't changed, then it goes
on. If there was an update on the other hand, it will wait for the
HOST_UPGRADE_FAILED / HOST_UPGRADE_FINISHED /
HOST_UPGRADE_FINISHED_AND_WILL_BE_REBOOTED events.

Signed-off-by: Jean-Louis Dupond jean-louis@dupond.be
Signed-off-by: Martin Nečas necas.marty@gmail.com

Signed-off-by: Martin Nečas necas.marty@gmail.com
Signed-off-by: Jean-Louis Dupond jean-louis@dupond.be
Co-authored-by: Martin Nečas necas.marty@gmail.com

@mwperina mwperina requested a review from mnecas as a code owner January 24, 2023 11:38
@mwperina mwperina force-pushed the backport-wait-for-host-to-be-in-result-state branch from 4eca779 to 57cb43a Compare January 24, 2023 12:19
* Wait for host to be in result state

Bug introduced in oVirt#580.
The update_available is false just after the upgrade, and
HOST_UPGRADE_FINISHED_AND_WILL_BE_REBOOTED is logged. But the host is
not yet rebooted, so we still need to wait for the status to be UP or
MAINTENANCE.

Signed-off-by: Martin Nečas <necas.marty@gmail.com>

* Fix wait_condition on host upgrade

In oVirt#580 we introduced a check on update_available state of the host to
determine if the host upgrade finished when there were no updates
available for te host.

The downside of this is that when the update finishes, the
update_available flag is cleared, and ansible thinks the host upgrade is
complete and starts upgrading the next node. But the reboot is not
completed yet, so result_state != h.status.

The fix here is to save the update_available status before starting the
update. If there were no updates and status hasn't changed, then it goes
on. If there was an update on the other hand, it will wait for the
HOST_UPGRADE_FAILED / HOST_UPGRADE_FINISHED /
HOST_UPGRADE_FINISHED_AND_WILL_BE_REBOOTED events.

Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
Signed-off-by: Martin Nečas <necas.marty@gmail.com>

Signed-off-by: Martin Nečas <necas.marty@gmail.com>
Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
Co-authored-by: Martin Nečas <necas.marty@gmail.com>
@mwperina mwperina force-pushed the backport-wait-for-host-to-be-in-result-state branch from 57cb43a to 2168735 Compare January 24, 2023 12:23
@mwperina mwperina merged commit 47676c4 into oVirt:ovirt-ansible-collection-2.y Jan 24, 2023
@mwperina mwperina deleted the backport-wait-for-host-to-be-in-result-state branch January 24, 2023 12:28
@mnecas mnecas mentioned this pull request Jan 24, 2023
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