Bug 2090331 - Ansible ovirt_vm module should fail if snapshot_name doesn't exist
Summary: Ansible ovirt_vm module should fail if snapshot_name doesn't exist
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-ansible-collection
Version: 4.4.10
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ovirt-4.5.1
: ---
Assignee: Martin Necas
QA Contact: Barbora Dolezalova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-25 14:26 UTC by Juan Orti
Modified: 2022-08-07 10:42 UTC (History)
6 users (show)

Fixed In Version: ovirt-ansiblle-collection-2.0.5
Doc Type: Bug Fix
Doc Text:
The ovirt_vm Ansible module displays an error message if a non-existent snapshot is used to clone a VM.
Clone Of:
Environment:
Last Closed: 2022-07-14 12:55:59 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-ansible-collection pull 525 0 None Closed Selinux SSHD throwing errors and causing log on random issues 2022-06-08 18:22:16 UTC
Red Hat Issue Tracker RHV-46119 0 None None None 2022-05-25 14:40:03 UTC
Red Hat Knowledge Base (Solution) 6960747 0 None None None 2022-05-25 14:47:17 UTC
Red Hat Product Errata RHBA-2022:5584 0 None None None 2022-07-14 12:56:08 UTC

Description Juan Orti 2022-05-25 14:26:59 UTC
Description of problem:
When cloning a VM from a snapshot, if the snapshot indicated in 'snapshot_name' in the 'ovirt_vm' module doesn't exist, the task doesn't fail and the VM is cloned without disks.

IMO if the user is indicating snapshot_vm and snapshot_name, the task should fail if the snapshot is not found.

Version-Release number of selected component (if applicable):
ovirt-ansible-collection-1.6.6-1.el8ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. Run some tasks like these to make a snapshot and clone a VM from it. I've intentionally used an incorrect snapshot_name to reproduce the issue:

~~~
      - name: Create {{ vm_name }} snapshot
        redhat.rhv.ovirt_snapshot:
          auth: "{{ ovirt_auth }}"
          vm_name: "{{ vm_name }}"
          description: "{{ vm_name }}_snap"
          use_memory: no
        register: snapshot

      - name: Clone VM from snapshot
        redhat.rhv.ovirt_vm:
          auth: "{{ ovirt_auth }}"
          snapshot_vm: "{{ vm_name }}"
          snapshot_name: "{{ vm_name }}_NON_EXISTING" # <----
          name: "{{ vm_name }}_backup"
          state: present
~~~

Actual results:
VM is cloned but without disks. No errors running the playbook.

Expected results:
A failure in the ovirt_vm task indicating that the snapshot doesn't exist.

Additional info:

Comment 2 Barbora Dolezalova 2022-06-16 12:45:25 UTC
Verified in ovirt-ansible-collection-2.1.0-1.el8ev.noarch

Comment 7 errata-xmlrpc 2022-07-14 12:55:59 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 (RHV Engine and Host Common Packages 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/RHBA-2022:5584

Comment 8 meital avital 2022-08-07 10:42:45 UTC
Due to QE capacity, we are not going to cover this issue in our automation


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