Bug 1440104

Summary: Unable to delete Host in Sat6 which has been delete in RHV already
Product: Red Hat Satellite Reporter: daniel <dmoessne>
Component: Compute Resources - RHEVAssignee: Ivan Necas <inecas>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.7CC: bbuckingham, bkearney, inecas, jcallaha, lhellebr
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.15.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 17:31:39 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:

Description daniel 2017-04-07 09:58:13 UTC
Description of problem:
When set up RHV (in this case 4.1 beta but I think this is valid for previous version, too) as a compute resource and install a client which is then deleted in RHEV prior to Sat6, Sat 6 is unable to delete the client on Sat6 side

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Set up Satellite6 compute RHEV resource with RHV 4.1 beta
2. Create and deploy VM from Sat6
3. Delete VM via RHV UI
4. Delete VM in Sat -> error:

Error: Failed to destroy a compute RHEV COE LAB (RHEV) instance dmoessne-kw-test1.coe.muc.redhat.com: ActiveRecord::RecordNotFound

Actual results:
Unable to remove host in Sat6

Expected results:
Even if VM is removed from RHEV already it should be possible to delete in in Sat6


Additional info:

Comment 2 Ivan Necas 2017-04-10 14:33:29 UTC
Created redmine issue http://projects.theforeman.org/issues/19236 from this bug

Comment 3 Ivan Necas 2017-04-10 15:02:27 UTC
Fix proposed in https://github.com/theforeman/foreman/pull/4448.

As a workaround, one should be able to use "Dissociate Host" button in host edit form, or 'PUT /api/v2/hosts/:id/disassociate' API call  to remove the invalid link to the compute resource that prevents the deletion.

Comment 4 Satellite Program 2017-04-10 16:01:56 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/19236 has been resolved.

Comment 5 Lukáš Hellebrandt 2017-10-05 12:41:38 UTC
Verified with Sat6.3 snap 18.

Used reproducer from OP. It is possible to remove a host that has been removed from RHEV previously: Hosts -> All hosts -> <host> -> Delete. This also removes the content host.

Comment 6 Bryan Kearney 2018-02-21 17:31:39 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-2018:0336