Description of problem: When removing a VM snapshot from RHV side, on CFME, RHV refresh fail with Last message "Couldn't find Snapshot with 'id'=204" (In RHv provider summary page) Version-Release number of selected component (if applicable): CFME-5.9.2.1 (Graph refresh=ON) Not on CFME-5.9.2.3 (Graph refresh=OFF) RHV-4.2.2.5 How reproducible: 100% Actual results: RHV refresh fail on snapshot not found. Expected results: RHV refresh should not fail on snapshot found, CFME just need to get updated with the snapshot removal. Additional info: This is probably related to having the Graph refresh activated, since on CFME-5.9.2.3 this same flow, do not fail the provider refresh.
Created attachment 1426044 [details] evm.log
Created attachment 1426045 [details] automation.log
Created attachment 1426046 [details] production.log
https://github.com/ManageIQ/manageiq-providers-ovirt/pull/241
https://github.com/ManageIQ/manageiq/pull/17462
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/ff840c93f4731de6ad7a92b26dabc4c2e5918b27 commit ff840c93f4731de6ad7a92b26dabc4c2e5918b27 Author: Ladislav Smola <lsmola> AuthorDate: Tue May 22 02:51:16 2018 -0400 Commit: Ladislav Smola <lsmola> CommitDate: Tue May 22 02:51:16 2018 -0400 Do not delete children snapshots as part of parent Do not delete children snapshots as part of parent. The default relation :children, added by acts_as_tree, has :dependent => :destroy. So deleting parent, will delete all it's children. This is not behavior we want in refresh. In old refresh, we were bypassing this by: https://github.com/ManageIQ/manageiq/blob/master/app/models/ems_refresh/save_inventory.rb#L366 So first, we deleted the tree relations, then we did create/update/delete of the nodes, then we updated the tree connections again. All of that should not be needed, if we will just use :dependent => :nullify Partially fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1571291 app/models/snapshot.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commit detected on ManageIQ/manageiq-providers-ovirt/master: https://github.com/ManageIQ/manageiq-providers-ovirt/commit/629c024021e34097ffe09cfb7182a0075725362d commit 629c024021e34097ffe09cfb7182a0075725362d Author: Boris Odnopozov <bodnopoz> AuthorDate: Thu May 17 04:58:26 2018 -0400 Commit: Boris Odnopozov <bodnopoz> CommitDate: Thu May 17 04:58:26 2018 -0400 Fix refreshing targeted vm after snapshot removal Avoid refreshing the vm a second time if snapshot was removed. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1571291 app/models/manageiq/providers/redhat/inventory/collector/target_collection.rb | 14 +- spec/models/manageiq/providers/redhat/infra_manager/refresh/refresher_graph_target_vm_spec.rb | 14 +- spec/vcr_cassettes/manageiq/providers/redhat/infra_manager/refresh/ovirt_sdk_refresh_graph_target_vm_deleted_snapshot.yml | 2452 + 3 files changed, 2469 insertions(+), 11 deletions(-)
Verified on: CFME 5.10.0.15 Verification steps: 1. Have a CFME with RHV provider and some VM 2. Go to CFME UI and find your VM's detail page and go to Snapshots. 3. Create a new snapshot. 4. Go to the provider's summary page. 5. Now switch to RHV UI and locate you VM's snapshots and delete the one you just created. 6. Wait until RHV reports that the deletion is complete. 7. Go back to CFME UI and verify there are no error on Provider's summary page or on VM's detail page. 8. Verify there are no errors in evm.log.