Description of problem: Have a RHV provider connected to CFME. On RHV side, migrate VM from source host to destination host. On CFME side, Refresh VM, so that in VM's details page, the host field will get updated - OK. Go to destination host, to see the number of running VMs got updated - OK. Then go to source host, and refresh it - it still show 1 running VM, though it is no longer running VMs. Run RHV provider full refresh - Fails on: "undefined method `split' for nil:NilClass" Version-Release number of selected component (if applicable): CFME-5.8.0.13 RHV-4.1.1.8 Additional info: evm.log (Part of the ERROR): [----] E, [2017-05-07T02:43:29.972196 #33125:37d138] ERROR -- : MIQ(ManageIQ::Providers::Redhat::InfraManager::Refresh::Strategies::Api3#refresh) EMS: [rhv_cfme_integration], id: [9] Refresh failed [----] E, [2017-05-07T02:43:29.973941 #33125:37d138] ERROR -- : [NoMethodError]: undefined method `split' for nil:NilClass Method:[rescue in block in refresh] [----] E, [2017-05-07T02:43:29.974192 #33125:37d138] ERROR -- : /var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/parser.rb:104:in `block in host_inv_to_hashes' /var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/parser.rb:84:in `each' /var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/parser.rb:84:in `host_inv_to_hashes' /var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/parse/parser.rb:11:in `ems_inv_to_hashes' /var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/refresher.rb:39:in `block in parse_targeted_inventory' /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-4f7327d84270/lib/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store' /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-4f7327d84270/lib/gems/pending/util/extensions/miq-benchmark.rb:30:in `realtime_block' /var/www/miq/vmdb/app/models/manageiq/providers/redhat/infra_manager/refresh/refresher.rb:38:in `parse_targeted_inventory' /var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:87:in `block in refresh_targets_for_ems' /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-4f7327d84270/lib/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store' /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-4f7327d84270/lib/gems/pending/util/extensions/miq-benchmark.rb:30:in `realtime_block' /var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:86:in `refresh_targets_for_ems' /var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:24:in `block (2 levels) in refresh' /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-4f7327d84270/lib/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store' /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-4f7327d84270/lib/gems/pending/util/extensions/miq-benchmark.rb:30:in `realtime_block' /var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:24:in `block in refresh' /var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:14:in `each' /var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:14:in `refresh' /var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:9:in `refresh' /var/www/miq/vmdb/app/models/ems_refresh.rb:98:in `block in refresh' /var/www/miq/vmdb/app/models/ems_refresh.rb:97:in `each' /var/www/miq/vmdb/app/models/ems_refresh.rb:97:in `refresh' /var/www/miq/vmdb/app/models/miq_queue.rb:347:in `block in deliver' /opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:91:in `block in timeout' /opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `block in catch' /opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `catch' /opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `catch' /opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:106:in `timeout' /var/www/miq/vmdb/app/models/miq_queue.rb:343:in `deliver' /var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:107:in `deliver_queue_message' /var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:135:in `deliver_message' /var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:153:in `block in do_work' /var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:147:in `loop' /var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:147:in `do_work' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:336:in `block in do_work_loop' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:333:in `loop' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:333:in `do_work_loop' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:155:in `run' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:130:in `start' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:21:in `start_worker' /var/www/miq/vmdb/app/models/miq_worker.rb:339:in `block in start_runner' /opt/rh/cfme-gemset/gems/nakayoshi_fork-0.0.3/lib/nakayoshi_fork.rb:24:in `fork' /opt/rh/cfme-gemset/gems/nakayoshi_fork-0.0.3/lib/nakayoshi_fork.rb:24:in `fork' /var/www/miq/vmdb/app/models/miq_worker.rb:337:in `start_runner' /var/www/miq/vmdb/app/models/miq_worker.rb:348:in `start' /var/www/miq/vmdb/app/models/miq_worker.rb:266:in `start_worker' /var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:68:in `start_worker_for_ems' /var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:46:in `block in sync_workers' /var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:45:in `each' /var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:45:in `sync_workers' /var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:53:in `block in sync_workers' /var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:50:in `each' /var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:50:in `sync_workers' /var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:22:in `monitor_workers' Comment: This might be related to bug 1368925.
Created attachment 1276840 [details] evm.log
Created attachment 1276841 [details] rhevm.log
On CFME, A consecutive full refresh succeed. Source Host details page still show there is a VM running on it, though there isn't (Host 'vdsClient -s 0 list table' return No VMs).
https://github.com/ManageIQ/ovirt/pull/82
https://github.com/ManageIQ/manageiq-providers-ovirt/pull/31
New commit detected on ManageIQ/ovirt/master: https://github.com/ManageIQ/ovirt/commit/3ac5cc03dd9da68bb2d24df007254f773f0dce66 commit 3ac5cc03dd9da68bb2d24df007254f773f0dce66 Author: Moti Asayag <masayag> AuthorDate: Mon May 8 15:31:08 2017 +0300 Commit: Moti Asayag <masayag> CommitDate: Mon May 8 17:45:07 2017 +0300 Fix host targeted refresh In V3 the host resources retrieved by /ovirt-engine/api/hosts/{host:id} contains the statistics element. The statistics element contains a reference to the host element. The xpath used to collect similar host elements considered the host sub-element of the statistics as a resource to collect, which lead to collecting the same host multiple times. By specifying the exact top level host path, this will be avoided. https://bugzilla.redhat.com/show_bug.cgi?id=1448690 lib/ovirt/service.rb | 5 +++-- spec/service_spec.rb | 61 +++++++++++++++++++++++++++++++++------------------- 2 files changed, 42 insertions(+), 24 deletions(-)
New commit detected on ManageIQ/manageiq-providers-ovirt/master: https://github.com/ManageIQ/manageiq-providers-ovirt/commit/6c468f674d341a1ad27664245136c74c85c1e262 commit 6c468f674d341a1ad27664245136c74c85c1e262 Author: Moti Asayag <masayag> AuthorDate: Mon May 8 14:46:23 2017 +0300 Commit: Moti Asayag <masayag> CommitDate: Mon May 8 20:52:40 2017 +0300 Fix host targeted refresh The PR handles two issues with host targeting refresh: 1. When targeting a refresh of a single host, no vms or templates are reported. Therefore the vm or template collected array should be handled in case of nil. 2. In V3 the host resources retrieved by /ovirt-engine/api/hosts/{host:id} contains the statistics element. The statistics element contains a reference to the host element. The xpath used to collect similar host entries considered the host sub-element as a resource to collect, which lead to collecting the same host multiple times. By specifying the exact top level host path, this will be avoided. https://bugzilla.redhat.com/show_bug.cgi?id=1448690 .../providers/redhat/infra_manager/refresh/parse/parser.rb | 2 +- lib/manageiq/providers/ovirt/legacy/inventory.rb | 9 +++++---- manageiq-providers-ovirt.gemspec | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-)
New commit detected on ManageIQ/manageiq-gems-pending/fine: https://github.com/ManageIQ/manageiq-gems-pending/commit/d7d3c1979eb0c6ac1bc5dce6957eadb8a73787de commit d7d3c1979eb0c6ac1bc5dce6957eadb8a73787de Author: Moti Asayag <masayag> AuthorDate: Tue May 9 16:56:08 2017 +0300 Commit: Moti Asayag <masayag> CommitDate: Tue May 9 17:05:51 2017 +0300 [FINE] Fix host targeted refresh In V3 the host resources retrieved by /ovirt-engine/api/hosts/{host:id} contains the statistics element. The statistics element contains a reference to the host element. The xpath used to collect similar host entries considered the host sub-element as a resource to collect, which lead to collecting the same host multiple times. By specifying the exact top level host path, this will be avoided. https://bugzilla.redhat.com/show_bug.cgi?id=1448690 lib/gems/pending/ovirt_provider/inventory/ovirt_inventory.rb | 9 +++++---- manageiq-gems-pending.gemspec | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-)
Verified on: CFME 5.9.0.4 RHV 4.1.7.4 Verification steps: I followed reproduction steps and the problematic behaviour was not encountered. Migrated VM is no longer shown as running on the source host and on error was found in evm.log during provider refresh.
New commit detected on ManageIQ/manageiq/euwe: https://github.com/ManageIQ/manageiq/commit/acf72e5020e11a81ecfcd962825cb11332faa634 commit acf72e5020e11a81ecfcd962825cb11332faa634 Author: Moti Asayag <masayag> AuthorDate: Sat Dec 9 11:27:09 2017 +0200 Commit: Moti Asayag <masayag> CommitDate: Sun Dec 10 13:02:21 2017 +0200 [EUWE] Fix host targeted refresh The PR handles two issues with host targeting refresh: 1. When targeting a refresh of a single host, no vms or templates are reported. Therefore the vm or template collected array should be handled in case of nil. 2. In V3 the host resources retrieved by /ovirt-engine/api/hosts/{host:id} contains the statistics element. The statistics element contains a reference to the host element. The xpath used to collect similar host entries considered the host sub-element as a resource to collect, which lead to collecting the same host multiple times. By specifying the exact top level host path, this will be avoided. https://bugzilla.redhat.com/show_bug.cgi?id=1448690 .../manageiq/providers/redhat/infra_manager/refresh_parser.rb | 2 +- app/models/manageiq/providers/redhat/infra_manager/refresher.rb | 4 +++- gems/pending/Gemfile | 2 +- gems/pending/ovirt_provider/inventory/ovirt_inventory.rb | 9 +++++---- 4 files changed, 10 insertions(+), 7 deletions(-)