Bug 1297101

Summary: ems_refresh errors out with "invoking [on_error] method=[update_provision_status(status => '[No Cloud/Infrastructure Provider defined]"
Product: Red Hat CloudForms Management Engine Reporter: Josh Carter <jocarter>
Component: ProvidersAssignee: Jason Frey <jfrey>
Status: CLOSED ERRATA QA Contact: Niyaz Akhtar Ansari <nansari>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 5.4.0CC: cpelland, jfrey, jhardy, mfeifer, mkanoor, nachandr, obarenbo, tfitzger
Target Milestone: GAKeywords: ZStream
Target Release: 5.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: provision:ems_refresh
Fixed In Version: 5.6.0.1 Doc Type: Bug Fix
Doc Text:
Cause: If a Vm moves to another Host, but we are doing a Host targeted refresh, it will appear to be deleted from that Host. However,we also delete the Vm from its EMS. This is not correct as we actually don't have enough information at that time. Consequence: - Ems_refresh errors out with "invoking [on_error] method=[update_provision_status(status => '[No Cloud/Infrastructure Provider defined]" Fix: Queue up a targeted refresh for that Vm. Result: Refresh completes.
Story Points: ---
Clone Of:
: 1300794 (view as bug list) Environment:
Last Closed: 2016-06-29 15:27:14 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: 1332836    
Bug Blocks: 1300794    

Description Josh Carter 2016-01-09 07:04:24 UTC
Description of problem:
During provisioning, we have an intermittent issue that presents with an error in the ems_refresh.
[----] I, [2016-01-08T20:47:26.750374 #14729:11c9ea8]  INFO -- : Q-task_id([miq_provision_702000000008690]) In State=[WaitForIP], invoking [on_error] method=[update_provision_status(status => '[No Cloud/Infrastructure Provider defined]
(druby://127.0.0.1:60711) /var/www/miq/vmdb/app/models/vm_or_template.rb:1171:in `refresh_ems'
(druby://127.0.0.1:60711) /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:239:in `block in object_send'
(druby://127.0.0.1:60711) /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:259:in `ar_method'
(druby://127.0.0.1:60711) /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:270:in `ar_method'
(druby://127.0.0.1:60711) /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:237:in `object_send'
(druby://127.0.0.1:60711) /var/www/miq/vmdb/lib/miq_automation_engine/engine/miq_ae_service_model_base.rb:92:in `block (2 levels) in expose'
(druby://127.0.0.1:60711) /opt/rh/ruby200/root/usr/share/ruby/drb/drb.rb:1588:in `perform_without_block'
(druby://127.0.0.1:60711) /opt/rh/ruby200/root/usr/share/ruby/drb/drb.rb:1548:in `perform'
(druby://127.0.0.1:60711) /opt/rh/ruby200/root/usr/share/ruby/drb/drb.rb:1626:in `block (2 levels) in main_loop'
(druby://127.0.0.1:60711) /opt/rh/ruby200/root/usr/share/ruby/drb/drb.rb:1622:in `loop'
(druby://127.0.0.1:60711) /opt/rh/ruby200/root/usr/share/ruby/drb/drb.rb:1622:in `block in main_loop'
(druby://127.0.0.1:60711) /var/www/miq/vmdb/lib/extensions/ar_thread.rb:22:in `block in start_with_release'
<code: vm.refresh>:58:in `<main>'', status_state => 'on_error')]
[----] W, [2016-01-08T20:47:26.748118 #14729:11c9ea8]  WARN -- : Q-task_id([miq_provision_702000000008690]) Error in State=[WaitForIP]


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 5 CFME Bot 2016-01-11 22:36:10 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/4539e873faf20c133343ca84a605bb87f0150623

commit 4539e873faf20c133343ca84a605bb87f0150623
Author:     Jason Frey <jfrey>
AuthorDate: Sat Jan 9 12:16:28 2016 -0500
Commit:     Jason Frey <jfrey>
CommitDate: Mon Jan 11 15:40:56 2016 -0500

    Fix refresh issue when a Vm moves to another Host.
    
    If a Vm moves to another Host, but we are doing a Host targeted
    refresh, it will appear to be deleted from that Host.  However,
    we also delete the Vm from its EMS.  This is not correct as we
    actually don't have enough information at that time.  Instead,
    we should just queue up a targeted refresh for that Vm.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1297101

 app/models/ems_refresh/save_inventory.rb | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comment 8 CFME Bot 2016-04-25 16:55:55 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=deeb06a9291c9c281c81a11a1b88f29e7cb7bb81

commit deeb06a9291c9c281c81a11a1b88f29e7cb7bb81
Author:     Jason Frey <jfrey>
AuthorDate: Sat Jan 9 12:16:28 2016 -0500
Commit:     Joe Rafaniello <jrafanie>
CommitDate: Mon Apr 25 10:46:59 2016 -0400

    Fix refresh issue when a Vm moves to another Host.
    
    If a Vm moves to another Host, but we are doing a Host targeted
    refresh, it will appear to be deleted from that Host.  However,
    we also delete the Vm from its EMS.  This is not correct as we
    actually don't have enough information at that time.  Instead,
    we should just queue up a targeted refresh for that Vm.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1297101

 app/models/ems_refresh/save_inventory.rb | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comment 9 CFME Bot 2016-04-25 16:56:00 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=c88a67db59c9a55423cd69d6e8db651913fe6062

commit c88a67db59c9a55423cd69d6e8db651913fe6062
Merge: 1ee73ea deeb06a
Author:     Oleg Barenboim <obarenbo>
AuthorDate: Mon Apr 25 12:51:43 2016 -0400
Commit:     Oleg Barenboim <obarenbo>
CommitDate: Mon Apr 25 12:51:43 2016 -0400

    Merge branch '5.5.z_1300794' into '5.5.z'
    
    Fix refresh issue when a Vm moves to another Host.
    
    If a Vm moves to another Host, but we are doing a Host targeted
    refresh, it will appear to be deleted from that Host.  However,
    we also delete the Vm from its EMS.  This is not correct as we
    actually don't have enough information at that time.  Instead,
    we should just queue up a targeted refresh for that Vm.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1297101
    
    
    Clean cherry-pick from: https://github.com/ManageIQ/manageiq/pull/6114
    Backport for blocker: https://bugzilla.redhat.com/show_bug.cgi?id=1300794
    
    See merge request !910

 app/models/ems_refresh/save_inventory.rb | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comment 10 Niyaz Akhtar Ansari 2016-04-26 09:26:30 UTC
Jason,
 
I tried moving a vm to another host and tried refreshing the host and vm too in  5.6.0.4-beta.refresh was successful.
Is there any other steps which i need to verify?

Thanks,
Niyaz

Comment 11 Niyaz Akhtar Ansari 2016-05-12 07:20:13 UTC
No Error when a VM is migrated to another host. VM refresh successful.

verified in 5.6.0.6-beta2.5.20160511140943_ff75fb2

Comment 13 errata-xmlrpc 2016-06-29 15:27:14 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/RHBA-2016:1348