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:
https://github.com/ManageIQ/manageiq/pull/5531
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/3cd6fcd41335738c4d6982da572804f4caeff35b commit 3cd6fcd41335738c4d6982da572804f4caeff35b Author: Greg Blomquist <gblomqui> AuthorDate: Thu Nov 19 16:12:49 2015 -0500 Commit: Greg Blomquist <gblomqui> 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(-)
http://gitlab.cloudforms.lab.eng.rdu2.redhat.com/cloudforms/cfme/merge_requests/526
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> AuthorDate: Thu Nov 19 16:12:49 2015 -0500 Commit: Greg Blomquist <gblomqui> 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(-)
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> AuthorDate: Mon Nov 23 16:41:41 2015 -0500 Commit: Oleg Barenboim <obarenbo> 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(-)
Verified in 5.5.0.12
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