Red Hat Bugzilla – Bug 1465761
Refresh failed for VMware Provider in Cloudforms 4.5
Last modified: 2017-08-09 16:43:40 EDT
Description of problem:
While doing the manual refresh of the Provider, it failed with below exception:
[----] E, [2017-06-26T15:28:24.832907 #29096:1311130] ERROR -- : MIQ(ManageIQ::Providers::Vmware::InfraManager::Refresher#refresh) EMS: [vCenter-DR], id:  Unable to perform refresh for the following targets:
[----] E, [2017-06-26T15:28:24.833036 #29096:1311130] ERROR -- : MIQ(ManageIQ::Providers::Vmware::InfraManager::Refresher#refresh) --- ManageIQ::Providers::Vmware::InfraManager [vCenter-DR] id 
[----] I, [2017-06-26T15:28:24.864483 #29096:1311130] INFO -- : MIQ(ManageIQ::Providers::Vmware::InfraManager::Refresher#refresh) Refreshing all targets...Complete
[----] E, [2017-06-26T15:28:24.869871 #29096:1311130] ERROR -- : [EmsRefresh::Refreshers::EmsRefresherMixin::PartialRefreshError]: undefined method `xsiType' for nil:NilClass Method:[rescue in deliver]
[----] E, [2017-06-26T15:28:24.872356 #29096:1311130] ERROR -- : /var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:50:in `refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:98:in `block in refresh'
Version-Release number of selected component (if applicable):
Refresh is failing with exception undefined method `xsiType' for nil:NilClass Method:[rescue in deliver]
Refresh should be done successfully.
Increased the memory threshold from 2GB to 4 GB of vim_broker_worker but still didn't work.
Seems like the target refresh is failing as full refresh is completed above it.
From the logs it looks like the error is:
[----] E, [2017-06-22T12:17:18.852473 #26538:1311130] ERROR -- : [NoMethodError]: undefined method `xsiType' for nil:NilClass Method:[rescue in block in refresh]
[----] E, [2017-06-22T12:17:18.852641 #26538:1311130] ERROR -- : /opt/rh/cfme-gemset/bundler/gems/manageiq-providers-vmware-30e6243bf993/app/models/manageiq/providers/vmware/infra_manager/refresh_parser.rb:1074:
This is coming from https://github.com/ManageIQ/manageiq-providers-vmware/blob/fine/app/models/manageiq/providers/vmware/infra_manager/refresh_parser.rb#L1074
It looks to me like there is a VM that has a disk assigned to a deleted controller but we will need to see the managed object browser to confirm.
Created attachment 1294568 [details]
MOB screen shot
Created attachment 1295178 [details]
Created attachment 1295179 [details]
Created attachment 1295180 [details]
Don't know how such a vm is created. vSphere client doesn't seem to allow that to be created. Can you request customer to inspect this vm and see how they can fix it, e.g. adding controller to the disks or removing the disks? And then rerun the refresh.
We probably can't do much with such disks without controller key. What we can do to fix this error is to skip them.
Customer is unable to remove the disk as the disk is in inconsistent state( as per attached). Let me know if you have any other suggestion so to rectify this issue.
Created attachment 1303436 [details]
inconsistent hard disk
The customer probably has to contact VMware support for fixing the vm.
If they are savvy enough, they may try to de-register the VM and then edit the vm file (in the datastore) to remove the disk. But they should consult VMware support first.
Any update from the customer?
What we are doing to the code is to inventory these disks as having 'unknown' controller type.
We haven't received any response from customer till date whether he is able to remove the disk or not so we can lower down the severity.
In case if he is not able to delete the disk we can suggest the provided PR.
Thanks for all help.
New commit detected on ManageIQ/manageiq-providers-vmware/master:
Author: James Wong <jwong@jwong-OSX.local>
AuthorDate: Tue Jul 18 09:54:46 2017 -0400
Commit: James Wong <jwong@jwong-OSX.local>
CommitDate: Tue Aug 1 11:47:55 2017 -0400
dealing with disks which have no controller key
.../providers/vmware/infra_manager/refresh_parser.rb | 17 +++++++++++------
.../providers/vmware/infra_manager/refresher_spec.rb | 15 +++++++++++++++
.../vim_data/miq_vim_inventory/virtualMachinesByMor.yml | 10 +---------
3 files changed, 27 insertions(+), 15 deletions(-)