Bug 1810406

Summary: [v2v] No response in CFME to Delete Conversion host VM action, after it was removed from RHV
Product: Red Hat CloudForms Management Engine Reporter: Ilanit Stein <istein>
Component: V2VAssignee: Fabien Dupont <fdupont>
Status: CLOSED ERRATA QA Contact: Maayan Hadasi <mguetta>
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: low    
Version: 5.11.4CC: bthurber, fdupont, mguetta, nachandr, pvauter, simaishi
Target Milestone: GAKeywords: ZStream
Target Release: 5.11.6Flags: pm-rhel: cfme-5.11.z+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.11.6.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-10 13:39:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: V2V Target Upstream Version:
Embargoed:

Description Ilanit Stein 2020-03-05 07:40:30 UTC
Description of problem:
Have a conversion host VM, that is configured successfully on CFME side.
Removing the VM on RHV side.
On CFME, there is no indication that this conversion host is no longer valid.
(Seems CFME so not track VM status).
And when trying to Delete this conversion host VM, in CFME UI, Conversion Hosts tab, there is no response. The VM keeps appearing as before, as a valid conversion host.

Version-Release number of selected component (if applicable):
CFME-5.11.4.1
RHV-4.3.7

Expected results:
1. Conversion host VM should track the VM status,
so that if it becomes down, paused, removed, rebooted, conversion host can not still appear as a valid conversion host.
2. Delete a conversion host VM, on cases like described (VM removed),
Should at least fail, on that the connection to VM fails.
And if possible allow VM delete, as it no longer exist, and CFME inventory should reflect that.

Additional info:
This is probably relevant for Openstack too.

Comment 2 Fabien Dupont 2020-04-10 09:39:06 UTC
An invalid conversion host cannot be selected to run a conversion, so ask #1 is already covered.

For the second point, we can add a condition here: https://github.com/ManageIQ/manageiq/blob/master/app/models/conversion_host/configurations.rb#L118, to not call the 'disable_conversion_host_role' method if the resource doesn't exist.

Comment 3 Fabien Dupont 2020-05-07 07:37:36 UTC
https://github.com/ManageIQ/manageiq/pull/20133

Comment 4 CFME Bot 2020-05-21 20:30:18 UTC
New commit detected on ManageIQ/manageiq/ivanchuk:

https://github.com/ManageIQ/manageiq/commit/7e2c4a7386309067db9a069ee1a787d1ff924658
commit 7e2c4a7386309067db9a069ee1a787d1ff924658
Author:     Adam Grare <agrare>
AuthorDate: Wed May 13 12:36:49 2020 +0000
Commit:     Adam Grare <agrare>
CommitDate: Wed May 13 12:36:49 2020 +0000

    Merge pull request #20133 from fdupont-redhat/v2v_bz_1810406

    [V2V] Don't run Ansible playbook if conversion host resource is absent or archived

    (cherry picked from commit 5916d54d21a9ea3b32abbecb5479e19643fe2ad7)

    https://bugzilla.redhat.com/show_bug.cgi?id=1810406

 app/models/conversion_host.rb | 6 +
 spec/models/conversion_host_spec.rb | 36 +
 2 files changed, 42 insertions(+)

Comment 6 Ilanit Stein 2020-06-02 18:58:53 UTC
This fix is applicable for both conversion host & VM.
Can be verified by enabling a conversion host.
The remove the host from RHV.

1. Check that VM migration plan do not pick this host for migration.
2. Try to delete the conversion host, it should fail.

Comment 7 Maayan Hadasi 2020-06-03 11:02:45 UTC
Verified as fixed with CFME 5.11.6.0
After removing host from RHV - the conversion host in CFME was removed, and is not listed in Rails Console
As expected, the followed migration picked the other valid conversion host

Comment 10 errata-xmlrpc 2020-06-10 13:39:10 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, 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/RHSA-2020:2480