Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1096866

Summary: Deleting a host provisioned via foreman should delete the entry from 'Content Host'
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: WebUIAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED CURRENTRELEASE QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.3CC: bbuckingham, bkearney, cwelton, jmontleo, jsherril, mkorbel
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/5184
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-02 14:06:45 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:
Attachments:
Description Flags
deleted system appears under 'Content Host'
none
UI shows 404 resource not found
none
complete production.log none

Description Sachin Ghai 2014-05-12 14:40:35 UTC
Created attachment 894743 [details]
deleted system appears under 'Content Host'

Description of problem:
Provisioned a host via foreman and register it via rhsm. The created host listed under 'content Host'. But when I removed it from 'All Hosts' the system still appears under 'Content Host'

Version-Release number of selected component (if applicable):
Satellite-6.0.3-RHEL-6-20140508.1

How reproducible:
always

Steps to Reproduce:
1. Provision a system via foreman
2. register it via rhsm
3. now delete it from 'All hosts' --> select Host --> delete

Actual results:
system appears under content host even after deleting it from foreman ('All Hosts)

Expected results:
system should be removed from content host' if I removed from it from foreman( all hosts)

Additional info:

Comment 2 Justin Sherrill 2014-05-21 15:27:35 UTC
I think fixed by https://github.com/Katello/katello/pull/4115 (not merged yet)

Comment 4 Sachin Ghai 2014-05-29 12:15:16 UTC
Verified with sat6 beta snap7 compose2.

Provisioned a host via Foreman. And then register it with rhsm to populate the same host under content hosts.

When I deleted the host from All hosts --> select host --> delete.
UI raised, 404 resource not found. 

Re-navigating to content-host, the register host was not listed there.. but same host still appears under 'All hosts'.

So looks like host is deleted from katello not not from foreman. Please see the attached logs from production.log

Comment 5 Sachin Ghai 2014-05-29 12:16:19 UTC
Created attachment 900332 [details]
UI shows 404 resource not found

Comment 6 Sachin Ghai 2014-05-29 12:17:41 UTC
Created attachment 900334 [details]
complete production.log

Comment 7 Brad Buckingham 2014-05-31 18:20:24 UTC
The following katello PR should address this issue:
  https://github.com/Katello/katello/pull/4188

Tested the fix out both on development and production configurations, as the previous code was behaving properly on development configuration.

Comment 9 Sachin Ghai 2014-06-05 12:27:37 UTC
Verified with sat6 beta snap8 (Satellite-6.0.3-RHEL-6-20140604.0)

Yes, now if a delete a host provisioned via foreman and auto register with activation keys, then it removes the entry from content hosts too. 

Will tests with manual rhsm registeration also.

Comment 10 Sachin Ghai 2014-06-05 14:16:23 UTC
so I tested with manuaa registration as well. I provisined a host via foreman and later register that via rhsm. The content host entry populated. Later when I removed the host from foreman, host entry from content-host also be deleted.

And didn't see any exception in logs. Thanks Brad for fixing it.

Comment 11 Brad Buckingham 2014-06-05 18:43:32 UTC
*** Bug 1104668 has been marked as a duplicate of this bug. ***

Comment 12 Bryan Kearney 2014-07-02 14:06:45 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.