Bug 2003996

Summary: ovirt_snapshot module fails to delete snapshot when there is a "Next Run configuration snapshot"
Product: Red Hat Enterprise Virtualization Manager Reporter: Marian Jankular <mjankula>
Component: ovirt-engineAssignee: Arik <ahadas>
Status: CLOSED ERRATA QA Contact: Nisim Simsolo <nsimsolo>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.4.7CC: bzlotnik, emarcus, michal.skrivanek, mnecas, mperina, nsimsolo
Target Milestone: ovirt-4.5.0Keywords: ZStream
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.5.0 Doc Type: Bug Fix
Doc Text:
Previously, snapshots that represent VM next-run configuration were reported by ovirt-ansible but their type was missing and they could not be removed. In this release, snapshots that represent VM next-run configuration are not reported to clients, including ovirt-ansible.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-26 16:23:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marian Jankular 2021-09-14 09:43:41 UTC
Description of problem:
ovirt_snapshot module fails to delete snapshot when there is a "Next Run configuration snapshot"

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

How reproducible:
everytime

Steps to Reproduce:
1. make sure there is Next Run configuration snapshot for the vm as well as regular snapshot
2. try to delete the regular snapshot

Actual results:
TASK [Delete snapshots] *******************************************************************************************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ovirtsdk4.Error: Fault reason is "Operation Failed". Fault detail is "[Cannot remove Snapshot. The operation is only allowed for regular snapshots.]". HTTP response code is 409.
failed: [localhost] (item=VM1) => {"ansible_loop_var": "item", "changed": false, "item": "VM1", "msg": "Fault reason is \"Operation Failed\". Fault detail is \"[Cannot remove Snapshot. The operation is only allowed for regular snapshots.]\". HTTP response code is 409."}

Expected results:
regular snapshot will be deleted, module will not attempt to delete "Next Run configuration snapshot"

Additional info:

Comment 4 Nisim Simsolo 2022-05-02 18:43:24 UTC
Verified:
ovirt-engine-4.5.0.5-0.7.el8ev
vdsm-4.50.0.13-1.el8ev.x86_64
qemu-kvm-6.2.0-11.module+el8.6.0+14707+5aa4b42d.x86_64
libvirt-daemon-8.0.0-5.module+el8.6.0+14480+c0a3aa0f.x86_64

Verification scenario:
1. Run VM 
2. Create 3 snapshots.
3. increase VM memory, CPUs and change VM HA configuration (in order to create "next run configuration" snapshot). make sure delta icon now appears next to VM. Keep VM running.
4. Observe VM snapshots, verify "next run configuration" snapshot is now filtered. Verify actions are available for any of the snapshots (create, delete, clone and make template).
5. While VM is running, delete the 2nd snapshot.
   Verify snapshot deleted and no error observed (engine.log and vdsm.log)
6. clone 3rd snapshot. 
   Verify clone created, run cloned VM and verify VM is running.
7. make template from 1st snapshot.
   Verify template created. create new VM from template, verify VM created, run VM and verify VM is running.
8. Restart the VM and verify changes made before the restart are now effective.

Comment 9 errata-xmlrpc 2022-05-26 16:23:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: RHV Manager (ovirt-engine) [ovirt-4.5.0] security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:4711