Bug 1571566 - Refresh fails when inventory item is deleted in the process
Summary: Refresh fails when inventory item is deleted in the process
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: GA
: cfme-future
Assignee: Boriso
QA Contact: Angelina Vasileva
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-25 06:48 UTC by Boriso
Modified: 2019-08-01 13:19 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-11 15:26:35 UTC
Category: ---
Cloudforms Team: RHEVM
Target Upstream Version:
Embargoed:
istein: needinfo-


Attachments (Terms of Use)

Description Boriso 2018-04-25 06:48:55 UTC
Description of problem:
On a big environment if an inventory item (vm or host) is deleted in the process of the refresh (after the top level collections were collected but the lower level collections like disks or nics were not) the refresh will fail.


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

How reproducible:
100%

Steps to Reproduce:
1. Add a delay to the method collect_top_level_futures in inventory collection:
1.1. go to app/models/manageiq/providers/redhat/infra_manager/inventory/strategies/v4.rb

https://github.com/ManageIQ/manageiq-providers-ovirt/blob/master/app/models/manageiq/providers/redhat/infra_manager/inventory/strategies/v4.rb#L125

1.2. add the following lines before the last line of the method (before res):
_log.info(">>>>>>>>>>>>>>>>>>>>>>>>>> Time to delete vms!!!")
sleep(1.minute)
(line 127 currently)
1.3 add the following line before the method definition (line 122 currently)
include Vmdb::Logging


So it should look like:

    include Vmdb::Logging
    def collect_top_level_futures
      res = {}
      TOP_LEVEL_INVENTORY_TYPES.each { |inv_name| res[inv_name.to_sym] = collect_inv_future(inv_name.to_sym) }
      _log.info(">>>>>>>>>>>>>>>>>>>>>>>>>> Time to delete vms!!!")
      sleep(1.minute)
      res
    end

before the method defenition (line 123 currently)
2. Start a full refresh
3. Monitor the evm.log, when you see ">>>>>>>>>>>>>>>>>>>>>>>>>> Time to delete vms!!!"
in the log, delete a vm form the provider with its disks before a minute passes.

Actual results:
The refresh fails

Expected results:
The refresh succeeds.

Additional info:
The state of the deleted VM immediately after refresh is not so important, it will be dealt with later as the even of it deletion will be processed after the refresh.

Comment 2 Dave Johnson 2018-04-25 07:03:44 UTC
Please assess the impact of this issue and update the severity accordingly.  Please refer to https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity for a reminder on each severity's definition.

If it's something like a tracker bug where it doesn't matter, please set the severity to Low.


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