Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1283195 - Host entries are no longer adopted after deletion and re-add
Host entries are no longer adopted after deletion and re-add
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers (Show other bugs)
5.5.0
Unspecified Unspecified
unspecified Severity high
: GA
: 5.5.0
Assigned To: Greg Blomquist
Pete Savage
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-18 07:35 EST by Pete Savage
Modified: 2015-12-08 08:48 EST (History)
6 users (show)

See Also:
Fixed In Version: 5.5.0.12
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-08 08:48:34 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:2551 normal SHIPPED_LIVE Moderate: CFME 5.5.0 bug fixes and enhancement update 2015-12-08 12:58:09 EST

  None (edit)
Description Pete Savage 2015-11-18 07:35:32 EST
Description of problem: Host entries are no longer adopted after deletion and re-add


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


How reproducible: 100%


Steps to Reproduce:
1. Add a provider (rhevm tested) with at least one host
2. Wait for inventory to complete
3. Delete the provider
4. Re add the provider

Actual results: Hosts are duplicated with a suffix for example there will be two host entries

host.example.com
host.example.com - 2

All vms will now be associated with the second host


Expected results: VMs should associate with the first host and the second host should not be created


Additional info:
Comment 4 CFME Bot 2015-11-23 15:55:25 EST
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/3cd6fcd41335738c4d6982da572804f4caeff35b

commit 3cd6fcd41335738c4d6982da572804f4caeff35b
Author:     Greg Blomquist <gblomqui@redhat.com>
AuthorDate: Thu Nov 19 16:12:49 2015 -0500
Commit:     Greg Blomquist <gblomqui@redhat.com>
CommitDate: Mon Nov 23 12:10:39 2015 -0500

    Re-adding provider will adopt old hosts
    
    When an Infrastructure Provider is deleted, the hosts associated with that
    Provider are left behind with a nil ems_id.  If the same Infrastructure Provider
    is re-added, it is supposed to pick up the old orphaned hosts.
    
    f4aa372a570c934f99a5d789aaffafb8ac84c6c9 introduced a bug where re-adding a
    previously deleted Provider would fail to pick up orphaned hosts.  It resulted
    in the following situation:
    
    1. Add Provider for the first time
    
       Hosts
       1: name:"hostname.domain.com", ems_id:1
    
    2. Delete the provider
    
       Hosts
       1: name:"hostname.domain.com", :ems_id:nil
    
    3. Re-add the provider
    
       Hosts
       1: name:"hostname.domain.com", ems_id:nil
       2: name:"hostname.domain.com - 1", ems_id:2
    
    This patch changes the third step to:
    
    3. Re-add the provider
    
       Hosts
       1: name:"hostname.domain.com", ems_id:2
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1283195

 app/models/ems_refresh/save_inventory_infra.rb |  5 +--
 spec/models/host_spec.rb                       | 43 +++++++++++++++++---------
 2 files changed, 32 insertions(+), 16 deletions(-)
Comment 6 CFME Bot 2015-11-23 17:07:28 EST
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=474948bcf726a67aae9e3dab0c9b09c6820e5486

commit 474948bcf726a67aae9e3dab0c9b09c6820e5486
Author:     Greg Blomquist <gblomqui@redhat.com>
AuthorDate: Thu Nov 19 16:12:49 2015 -0500
Commit:     Greg Blomquist <gblomqui@redhat.com>
CommitDate: Mon Nov 23 15:56:57 2015 -0500

    Re-adding provider will adopt old hosts
    
    When an Infrastructure Provider is deleted, the hosts associated with that
    Provider are left behind with a nil ems_id.  If the same Infrastructure Provider
    is re-added, it is supposed to pick up the old orphaned hosts.
    
    f4aa372a570c934f99a5d789aaffafb8ac84c6c9 introduced a bug where re-adding a
    previously deleted Provider would fail to pick up orphaned hosts.  It resulted
    in the following situation:
    
    1. Add Provider for the first time
    
       Hosts
       1: name:"hostname.domain.com", ems_id:1
    
    2. Delete the provider
    
       Hosts
       1: name:"hostname.domain.com", :ems_id:nil
    
    3. Re-add the provider
    
       Hosts
       1: name:"hostname.domain.com", ems_id:nil
       2: name:"hostname.domain.com - 1", ems_id:2
    
    This patch changes the third step to:
    
    3. Re-add the provider
    
       Hosts
       1: name:"hostname.domain.com", ems_id:2
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1283195

 app/models/ems_refresh/save_inventory_infra.rb |  5 +--
 spec/models/host_spec.rb                       | 43 +++++++++++++++++---------
 2 files changed, 32 insertions(+), 16 deletions(-)
Comment 7 CFME Bot 2015-11-23 17:07:34 EST
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=fc7f69732168e6733cf9ca08a0a10b9a099482ea

commit fc7f69732168e6733cf9ca08a0a10b9a099482ea
Merge: b058ef4 474948b
Author:     Oleg Barenboim <obarenbo@redhat.com>
AuthorDate: Mon Nov 23 16:41:41 2015 -0500
Commit:     Oleg Barenboim <obarenbo@redhat.com>
CommitDate: Mon Nov 23 16:41:41 2015 -0500

    Merge branch 'bz1283195-readd-host-5.5.z-backport' into '5.5.z'
    
    Re-adding provider will adopt old hosts
    
    Clean cherry-pick of upstream PR: https://github.com/ManageIQ/manageiq/pull/5531
    
    When an Infrastructure Provider is deleted, the hosts associated with that
    Provider are left behind with a nil ems_id.  If the same Infrastructure Provider
    is re-added, it is supposed to pick up the old orphaned hosts.
    
    f4aa372a570c934f99a5d789aaffafb8ac84c6c9 introduced a bug where re-adding a
    previously deleted Provider would fail to pick up orphaned hosts.  It resulted
    in the following situation:
    
    1. Add Provider for the first time
    
       Hosts
       1: name:"hostname.domain.com", ems_id:1
    
    2. Delete the provider
    
       Hosts
       1: name:"hostname.domain.com", :ems_id:nil
    
    3. Re-add the provider
    
       Hosts
       1: name:"hostname.domain.com", ems_id:nil
       2: name:"hostname.domain.com - 1", ems_id:2
    
    This patch changes the third step to:
    
    `3.` Re-add the provider
    
       Hosts
       1: name:"hostname.domain.com", ems_id:2
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1283195
    
    See merge request !526

 app/models/ems_refresh/save_inventory_infra.rb |  5 +--
 spec/models/host_spec.rb                       | 43 +++++++++++++++++---------
 2 files changed, 32 insertions(+), 16 deletions(-)
Comment 8 Pete Savage 2015-11-25 05:13:52 EST
Verified in 5.5.0.12
Comment 10 errata-xmlrpc 2015-12-08 08:48:34 EST
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-2015:2551

Note You need to log in before you can comment on or make changes to this bug.