Bug 1959306

Summary: Validation does not detect host in maintenance mode
Product: Migration Toolkit for Virtualization Reporter: Amos Mastbaum <amastbau>
Component: ControllerAssignee: Sam Lucidi <slucidi>
Status: CLOSED ERRATA QA Contact: Amos Mastbaum <amastbau>
Severity: medium Docs Contact: Avital Pinnick <apinnick>
Priority: medium    
Version: 2.0.0CC: apinnick, fdupont, istein, mguetta
Target Milestone: ---   
Target Release: 2.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-26 07:09:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Amos Mastbaum 2021-05-11 09:01:49 UTC
This bug was initially created as a copy of Bug #1940896, because it expands its scope.

Description of problem:

When watching inventory resources, each controller has a deliberately narrow set of changes it's interested in. For Host, it only triggers a Host CR reconcile when a referenced (vCenter) Host's path and/or name changes. We need to expand to include changes to: maintenance mode.

However, we currently don't validate maintenance-mode in the back-end so even if the Plan reconcile is triggered by the change in maintenance-mode, the Host CR will remain READY and the Plan will execute.


Steps to Reproduce:

1. Create a Plan with multiple VMs on multiple hosts.
2. Check that the plan is in Ready condition.
3. Put one of the host the VMs belong to in maintenance mode.

Actual results:

Nothing happens. The plan remains in Ready condition.


Expected results:

The change in the inventory should result in the Plan CR being reconciled and the Critical condition set.


Additional info:

This requires adding a validation on the hosts maintenance mode in the Plan CR validation.
This requires adding an external watch on the host maintenance mode for the Plan.

Comment 1 Sam Lucidi 2021-06-23 19:44:23 UTC
This PR causes the inventory to consider the value of InMaintenanceMode when determining whether to update a Host. It also adds a Warn condition to the Plan if any of the VMs on the Plan belong to hosts in maintenance mode. This is a warning rather than critical because we'd prefer to warn rather than block, and the failed VMs can be retried later.


https://github.com/konveyor/forklift-controller/pull/289

Comment 2 Fabien Dupont 2021-06-24 21:50:24 UTC
Please test with the mtv-operator-bundle-2.1.0-5 build / iib:85044.

Comment 3 Amos Mastbaum 2021-08-12 10:25:56 UTC
MTV 2.1.0-48 / IIB 97916
CNV 4.8.1-14

Comment 6 errata-xmlrpc 2021-08-26 07:09:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Migration Toolkit for Virtualization 2.1.0), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2021:3278