Bug 1438349

Summary: [RHV] Timing issue between refreshes when a vm is removed
Product: Red Hat CloudForms Management Engine Reporter: Piotr Kliczewski <pkliczew>
Component: ProvidersAssignee: Piotr Kliczewski <pkliczew>
Status: CLOSED CURRENTRELEASE QA Contact: Angelina Vasileva <anikifor>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.8.0CC: agrare, jfrey, jhardy, jzmeskal, obarenbo, pkliczew, simaishi
Target Milestone: GAKeywords: TestOnly
Target Release: 5.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: rhev
Fixed In Version: 5.9.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1438518 (view as bug list) Environment:
Last Closed: 2018-03-06 15:10:11 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:
Bug Depends On:    
Bug Blocks: 1438518    
Attachments:
Description Flags
evm.log when trying to verify none

Description Piotr Kliczewski 2017-04-03 07:21:28 UTC
When we have an event order like vm stop and later vm delete it could happen that vm would be already removed from inventory during the first event refresh which would cause second refresh to fail during disconnect_storage step.

Expected behavior:
disconnect_storage is able to handle situation when a vm was already removed.

Comment 4 Jan Zmeskal 2017-11-09 16:27:31 UTC
How would the bug look like from user's perspective? Do I understand correctly that the reproduction steps are these?
1. Stop VM
2. Delete VM

Comment 5 Piotr Kliczewski 2017-11-10 11:44:58 UTC
(In reply to Jan Zmeskal from comment #4)
> How would the bug look like from user's perspective? Do I understand
> correctly that the reproduction steps are these?
> 1. Stop VM
> 2. Delete VM

Correct, the issue is that second needs to be done just after first.

Comment 6 Jan Zmeskal 2017-11-15 12:34:01 UTC
I tried to verify in this manner:

1. I had RHV provider in CFME
2. I added one running VM (from within RHV) and refreshed relationships in CFME
3. VM is visible in CFME inventory
4. I powered off VM from CFME
5. Right after that I clicked "Remove selected items from inventory" for the given VM
6. Observing logs (see attachment) -> no error found
7. Refreshed relationships in CFME
8. VM is still visible in CFME inventory under RHV provider
9. I tried removing VM again
10. Refreshed relationships for the provider
11. VM is still visible

I believe this is not what is supposed to be happening, is that right? As far as I understand it, the VM should have been removed from inventory in this scenario. Please correct me if I am wrong.

Comment 7 Jan Zmeskal 2017-11-15 12:34:49 UTC
Created attachment 1352576 [details]
evm.log when trying to verify

Comment 8 Piotr Kliczewski 2017-11-20 10:12:56 UTC
The steps are not correct. Your step 5 is not correct. You want to retire a vm not remove it from inventory. Retire means that it will be removed from ovirt and remove from inventory means that on next refresh it will be recreated.

Comment 9 Jan Zmeskal 2017-11-20 15:13:19 UTC
(In reply to Piotr Kliczewski from comment #8)
> The steps are not correct. Your step 5 is not correct. You want to retire a
> vm not remove it from inventory. Retire means that it will be removed from
> ovirt and remove from inventory means that on next refresh it will be
> recreated.

I repaired my steps and after powering off the VM, I retired it. Everything worked as expected and no error found in evm.log.