Bug 1571566

Summary: Refresh fails when inventory item is deleted in the process
Product: Red Hat CloudForms Management Engine Reporter: Boriso <bodnopoz>
Component: ProvidersAssignee: Boriso <bodnopoz>
Status: CLOSED CURRENTRELEASE QA Contact: Angelina Vasileva <anikifor>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.9.0CC: bodnopoz, cpelland, gblomqui, jfrey, jhardy, obarenbo
Target Milestone: GAFlags: istein: needinfo-
Target Release: cfme-future   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-11 15:26:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: RHEVM Target Upstream Version:
Embargoed:

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.