Bug 1552732 - RHV Snapshots: Reverting to "Active VM" throws "Cannot preview Active VM snapshot" in evm.log
Summary: RHV Snapshots: Reverting to "Active VM" throws "Cannot preview Active VM snap...
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
high
high
Target Milestone: GA
: 5.10.0
Assignee: Boriso
QA Contact: Angelina Vasileva
URL:
Whiteboard:
: 1554745 (view as bug list)
Depends On:
Blocks: 1588038
TreeView+ depends on / blocked
 
Reported: 2018-03-07 16:08 UTC by Antonin Pagac
Modified: 2019-10-22 14:36 UTC (History)
14 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1588038 (view as bug list)
Environment:
Last Closed: 2019-02-11 13:59:22 UTC
Category: ---
Cloudforms Team: RHEVM
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
error in evm.log (4.73 KB, text/plain)
2018-03-07 16:08 UTC, Antonin Pagac
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github ManageIQ manageiq-providers-ovirt pull 230 0 None closed Properly fetch snapshot current state 2020-05-18 20:09:13 UTC

Description Antonin Pagac 2018-03-07 16:08:02 UTC
Created attachment 1405453 [details]
error in evm.log

Description of problem:
It's possible I'm doing something stupid.
I have a VM running on RHV 4.1 added in CFME. I created one snapshot, shut down the VM and reverted to this snapshot, all went well. Then I tried to revert back, meaning I tried to revert to the "Active VM" snapshot, and that failed. The revert button is enabled, I can initiate the action from the OPS UI. When the operation fails, there is no error in the UI. Error is thrown in evm.log, see attachment.

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

How reproducible:
Always

Steps to Reproduce:
1. Have RHV 4.1 added to cfme and a VM on it running.
2. Create a snapshot for that VM.
3. Shut down the VM. This has to be done in order to revert to a snapshot with RHV 4.1
4. Revert to the snapshot created in step 2
5. Try to revert to "Active VM"

Actual results:
Revert not successful; no error in the UI; error in evm.log

Expected results:
One of the following:
 - revert successful
 - or revert button disabled, if the action is not allowed
Also the error should be visible in the UI, if it's relevant.

Additional info:

Comment 3 Moti Asayag 2018-03-13 08:11:02 UTC
Ilanit, could you test it on gaprindashvili / master ?

Comment 4 Moti Asayag 2018-03-13 08:12:06 UTC
(Was verified on  Bug 1396068)

Comment 5 Ilanit Stein 2018-03-13 10:34:02 UTC
*** Bug 1554745 has been marked as a duplicate of this bug. ***

Comment 6 Moti Asayag 2018-03-20 09:49:59 UTC
The root cause of this bug is how the miq-providers-ovirt identifies the active snapshot.

The snapshot type is reported by rhv for the vm's snapshots, i.e.:

<snapshots>
    <snapshot>
        <description>snap1</description>
        <snapshot_status>ok</snapshot_status>
        <snapshot_type>regular</snapshot_type>
    </snapshot>
    <snapshot>
        <description>Active VM</description>
        <snapshot_status>ok</snapshot_status>
        <snapshot_type>active</snapshot_type>
    </snapshot>
</snapshots>

However, on MIQ side, the 'snap1' is considered to be the active one, which lead to the described bug.

miq-providers-ovirt should be modified to rely on the snapshot_type in order to identify the actual active snapshot.

Once snapshot is previewed, its type is changed to 'in preview', and after it is committed, the snapshot named 'vm active' returns to be the active, but the uid will be changed.

Comment 8 Ilanit Stein 2018-04-01 10:16:55 UTC
This bug do not reproduce on CFME-5.9.2.0/RHV-4.2.2, but does reproduce on CFME-5.9.2.0/RHV-4.1.10.3

Comment 9 CFME Bot 2018-04-10 08:12:03 UTC
New commit detected on ManageIQ/manageiq-providers-ovirt/master:

https://github.com/ManageIQ/manageiq-providers-ovirt/commit/0d7039b5ecbe568e08c3281eb34500316bb8daf4
commit 0d7039b5ecbe568e08c3281eb34500316bb8daf4
Author:     Boris Odnopozov <bodnopoz>
AuthorDate: Tue Mar 27 10:52:36 2018 -0400
Commit:     Boris Odnopozov <bodnopoz>
CommitDate: Tue Mar 27 10:52:36 2018 -0400

    Properly fetch snapshot current state

    We will now fetch the snapshot current state from the snapshot_type returned
    form the oVirt api, the previous calculation we used for this attribute did not
    always work.

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

 app/models/manageiq/providers/redhat/infra_manager/refresh/parse/strategies/vm_inventory.rb | 9 +-
 app/models/manageiq/providers/redhat/inventory/parser/infra_manager.rb | 6 +-
 spec/models/manageiq/providers/redhat/infra_manager/refresh/refresher_4_async_graph_spec.rb | 5 +-
 spec/models/manageiq/providers/redhat/infra_manager/refresh/refresher_4_async_spec.rb | 6 +-
 spec/vcr_cassettes/manageiq/providers/redhat/infra_manager/refresh/ovirt_sdk_refresh_recording.yml | 4 +-
 5 files changed, 15 insertions(+), 15 deletions(-)

Comment 10 Martin Perina 2018-06-06 07:19:04 UTC
Moving back to POST, because it was improperly retargeted from 5.9.3 to future

Comment 12 Jan Zmeskal 2018-09-17 14:35:30 UTC
During my verification on 5.10.0.15, I found out it is no longer possible to revert to Active VM. I suppose that's actually the correct solution and expected behavior. Can you please confirm, Boris?

Jan

Comment 13 Boriso 2018-09-20 10:35:43 UTC
Yes this is the expected behavior.


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