Bug 1348604

Summary: hosts fail to archive upon provider deletion
Product: Red Hat CloudForms Management Engine Reporter: Ramesh A <rananda>
Component: ProvidersAssignee: Adam Grare <agrare>
Status: CLOSED CURRENTRELEASE QA Contact: Dave Johnson <dajohnso>
Severity: medium Docs Contact:
Priority: high    
Version: 5.6.0CC: dajohnso, jfrey, jhardy, obarenbo, rananda, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.7.0Flags: kzvyahin: automate_bug-
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: ui:host
Fixed In Version: 5.7.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1353308 (view as bug list) Environment:
Last Closed: 2017-01-11 19:59:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1353308    
Attachments:
Description Flags
Hosts none

Description Ramesh A 2016-06-21 14:44:34 UTC
Created attachment 1170307 [details]
Hosts

Description of problem:
Host page displays the provider hosts after removing the provider from database

Version-Release number of selected component (if applicable):
5.6.0.11-rc2.2.20160614152915_f315c68 

How reproducible:
Very

Steps to Reproduce:
1. Manage a provider
2. Remove the provider from database via Compute ==> Infrastructure ==> Providers  ==> Select the provider ==> Remove Infrastructure Providers from the VMDB
3. Wait for sometime.  Now navigate to Compute ==> Infrastructure ==> Hosts, and check for hosts

Actual results:
1. Displays all the hosts from the providers which have been deleted.
2. Also clicking on Hosts allows access it
Refer the screenshot for further information

Expected results:
Should not display the hosts in this page

Additional info:

Comment 2 Greg Blomquist 2016-06-22 19:43:36 UTC
Hosts shouldn't be deleted from MIQ when the Provider is deleted.  However, they should eventually become archived.

Ramesh, can you check if the hosts are archived?

Comment 3 Adam Grare 2016-06-27 14:53:27 UTC
When you remove a provider from vmdb it doesn't disconnect the hosts, it just clears the ems_id.  Vms have a method to say they are archived if their ems_id is nil but there isn't anything like that for hosts.  The result is that VMs show up as archived but hosts still have their original power state.  Datastores also still show up for deleted providers.

Confirmed this is the same behavior as 5.4.

Comment 4 Dave Johnson 2016-07-06 13:41:12 UTC
Adam cleared the needinfo...

Comment 7 CFME Bot 2016-07-18 22:45:44 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/6bed278ae60cc15e9d35fd1628b12b664ef981df

commit 6bed278ae60cc15e9d35fd1628b12b664ef981df
Author:     Adam Grare <agrare>
AuthorDate: Wed Jul 6 12:15:42 2016 -0400
Commit:     Adam Grare <agrare>
CommitDate: Tue Jul 12 07:55:01 2016 -0400

    Show hosts as archived when their ems is deleted
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1348604

 app/helpers/quadicon_helper.rb |  2 +-
 app/models/host.rb             | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)