Bug 1439387 - Full refresh of second VMware provider isn't automatically started after it is added
Summary: Full refresh of second VMware provider isn't automatically started after it i...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.11.0
Assignee: Adam Grare
QA Contact: Nandini Chandra
URL:
Whiteboard: ems_refresh:vmware
: 1518385 1573490 (view as bug list)
Depends On:
Blocks: 1443696 1443697 1737124
TreeView+ depends on / blocked
 
Reported: 2017-04-05 21:26 UTC by Nandini Chandra
Modified: 2019-12-13 14:57 UTC (History)
10 users (show)

Fixed In Version: 5.11.0.18
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1443696 1443697 1737124 (view as bug list)
Environment:
Last Closed: 2019-12-13 14:57:21 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:


Attachments (Terms of Use)

Description Nandini Chandra 2017-04-05 21:26:40 UTC
Description of problem:
-----------------------
My appliance is managing vSphere 6 and vSphere 65.I first added the vSphere 6 provider and then added the vSphere 65 provider.The initial refresh failed.
When I manually refreshed the provider by clicking 'Configuration' and then clicking Refresh Relationships and Power Stated, the refresh succeeded.

On a second appliance, I changed the order in which the two providers are added and the result was the same.


Version-Release number of selected component (if applicable):
--------------------------
5.8.0.9 (This issue probably occurs in earlier versions as well).


How reproducible:
----------------
Always


Steps to Reproduce:
-------------------
1.Add a VMware provider to CFME
2.Add a second VMWare provider to CFME.


Actual results:
---------------
Full refresh of second VMware provider fails


Expected results:
-----------------
Full refresh of second VMware provider should succeed.


Additional info:
----------------

Comment 4 Adam Grare 2017-04-06 19:11:56 UTC
Nandini I don't see any errors and if I run a refresh manually on your appliance for your second EMS it succeeds.

Can you please attach a traceback from the logs when it failed?

Comment 5 Nandini Chandra 2017-04-07 18:19:01 UTC
There are no errors in the log.Manual refresh does succeed, but I'd like to know why the refresh doesn't succeed upon adding the second provider.

After the second provider was added, the 'Last Refresh' field showed 'Never' in the summary page until a manual refresh was done.As a result, the VM count, host count remained zero until the manual refresh was done.

Comment 6 Adam Grare 2017-04-12 19:53:28 UTC
I confirmed on 5.4 that when adding the second VMware provider a refresh is not automatically started so this is not a regression.

The problem is that while most RefreshWorkers run a refresh when they start up (https://github.com/ManageIQ/manageiq/blob/master/app/models/manageiq/providers/base_manager/refresh_worker/runner.rb#L16-L19), the VMware one does not (https://github.com/ManageIQ/manageiq-providers-vmware/blob/master/app/models/manageiq/providers/vmware/infra_manager/refresh_worker/runner.rb#L4-L7) because the MiqVimBrokerWorker does that after it finishes priming the ems cache (https://github.com/ManageIQ/manageiq/blob/master/app/models/miq_vim_broker_worker/runner.rb#L116-L121)

Comment 7 Adam Grare 2017-04-12 19:55:00 UTC
I should note that this is only an issue after adding a provider the first time, the scheduled refresh will run normally and after a reboot a full refresh will be queued on startup as expected.

Comment 9 CFME Bot 2017-04-19 15:28:29 UTC
New commit detected on ManageIQ/manageiq-providers-vmware/master:
https://github.com/ManageIQ/manageiq-providers-vmware/commit/816a3634009ce87577f65bc8d540bbbb5e03aa1c

commit 816a3634009ce87577f65bc8d540bbbb5e03aa1c
Author:     Adam Grare <agrare@redhat.com>
AuthorDate: Mon Apr 17 13:55:57 2017 -0400
Commit:     Adam Grare <agrare@redhat.com>
CommitDate: Mon Apr 17 15:42:14 2017 -0400

    Queue initial refresh if the Broker is available
    
    If the MiqVimBrokerWorker is starting up then it will queue a refresh
    when it finishes priming the cache.  If the broker is already running
    when the RefreshWorker starts then we need to queue our own initial
    refresh.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1439387

 .../manageiq/providers/vmware/infra_manager/refresh_worker/runner.rb  | 4 ++++
 1 file changed, 4 insertions(+)

Comment 12 Adam Grare 2017-07-27 16:56:54 UTC
Re-opening due to unintended consequence noted in https://bugzilla.redhat.com/show_bug.cgi?id=1469198

This patch was backed out in https://github.com/ManageIQ/manageiq-providers-vmware/pull/75#event-1182127222

Comment 13 Adam Grare 2017-11-29 00:52:09 UTC
*** Bug 1518385 has been marked as a duplicate of this bug. ***

Comment 14 Adam Grare 2018-03-09 20:40:56 UTC
This depends on some core refactoring (i.e. moving the DMiqVim connection out of the VimBrokerWorker and into the per-ems RefreshWorker) so setting to XL

Comment 15 Adam Grare 2018-05-01 14:26:44 UTC
*** Bug 1573490 has been marked as a duplicate of this bug. ***

Comment 16 Greg Blomquist 2018-05-02 13:42:48 UTC
Adam scoped this as XL, and this particular issue is an edge case with a workaround (manual refresh).

If necessary, we can doc this issue.

Comment 17 Adam Grare 2019-07-19 18:02:32 UTC
We have removed the worker restart_interval from core so we are able to implement this now

Comment 19 CFME Bot 2019-08-02 13:32:13 UTC
New commit detected on ManageIQ/manageiq-providers-vmware/master:

https://github.com/ManageIQ/manageiq-providers-vmware/commit/0acf5aa8bf66f61f66ffeeae84ff73b138e72f9b
commit 0acf5aa8bf66f61f66ffeeae84ff73b138e72f9b
Author:     Adam Grare <agrare@redhat.com>
AuthorDate: Fri Jul 19 14:02:35 2019 -0400
Commit:     Adam Grare <agrare@redhat.com>
CommitDate: Fri Jul 19 14:02:35 2019 -0400

    Let the RefreshWorker queue the first full refresh

    Move VMware more in line with the other providers by allowing the
    RefreshWorker to queue the first full when it starts up.

    This used to be done by the VimBrokerWorker because the RefreshWorkers
    restarted every 2 hours. Now that
    https://github.com/ManageIQ/manageiq/pull/19010 does restart the
    refresh_worker every 2 hours we can go back to just handling this in the
    RefreshWorker.

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1439387
    Fixes https://github.com/ManageIQ/manageiq/issues/14813

 app/models/manageiq/providers/vmware/infra_manager/refresh_worker/runner.rb | 5 -
 app/models/miq_vim_broker_worker/runner.rb | 7 -
 spec/models/miq_vim_broker_worker/runner_spec.rb | 23 -
 3 files changed, 35 deletions(-)

Comment 20 CFME Bot 2019-08-02 16:06:57 UTC
New commit detected on ManageIQ/manageiq-providers-vmware/ivanchuk:

https://github.com/ManageIQ/manageiq-providers-vmware/commit/992757a1556dc781fc712da375e9dddbf3ba7c58
commit 992757a1556dc781fc712da375e9dddbf3ba7c58
Author:     Gregg Tanzillo <gtanzill@redhat.com>
AuthorDate: Fri Aug  2 09:28:28 2019 -0400
Commit:     Gregg Tanzillo <gtanzill@redhat.com>
CommitDate: Fri Aug  2 09:28:28 2019 -0400

    Merge pull request #414 from agrare/bz_1439387_queue_refresh_when_refresh_worker_starts

    Let the RefreshWorker queue the first full refresh

    (cherry picked from commit 1822f675f176ce135915327f59c3c4676ff46c81)

    https://bugzilla.redhat.com/show_bug.cgi?id=1439387

 app/models/manageiq/providers/vmware/infra_manager/refresh_worker/runner.rb | 5 -
 app/models/miq_vim_broker_worker/runner.rb | 7 -
 spec/models/miq_vim_broker_worker/runner_spec.rb | 23 -
 3 files changed, 35 deletions(-)

Comment 22 Nandini Chandra 2019-08-22 20:57:38 UTC
Verified on 5.11.0.19


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