Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1513831

Summary: Stopping stateless VMs will timeout and task will fail when using ovirt_vms module
Product: Red Hat Enterprise Virtualization Manager Reporter: nijin ashok <nashok>
Component: ansibleAssignee: Ondra Machacek <omachace>
Status: CLOSED UPSTREAM QA Contact: Lucie Leistnerova <lleistne>
Severity: medium Docs Contact:
Priority: high    
Version: 4.1.7CC: eedri, lsvaty, mgoldboi, mperina, richard_bywater
Target Milestone: ovirt-4.2.3   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ansible-2.5.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-28 07:05:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description nijin ashok 2017-11-16 04:40:27 UTC
Description of problem:

Currently, the module is waiting for the stateless snapshot to go none while stopping a stateless VM. However, this condition will never happen as the stateless snapshot id will become active when the stateless snapshot is removed. So it will be in this loop indefinitely and finally will timeout after the timeout period.

For example, 354db0cf is the active snapshot before starting the VM.

engine=# select snapshot_id,description from snapshots where vm_id = 'd47d6843-a2d4-4ed7-80cf-493f9c3b0288';
             snapshot_id              | description 
--------------------------------------+-------------
 354db0cf-fbbf-4c2c-9273-1d0fa1bc5b2b | Active VM

After starting the VM, 354db0cf, will be the stateless snapshot.

engine=# select snapshot_id,description from snapshots where vm_id = 'd47d6843-a2d4-4ed7-80cf-493f9c3b0288';
             snapshot_id              |    description     
--------------------------------------+--------------------
 59e7f639-07c3-41f4-889a-aaa79ffd21ee | Active VM
 354db0cf-fbbf-4c2c-9273-1d0fa1bc5b2b | stateless snapshot

Then if we shut down the VM, 354db0cf will become active again.

engine=# select snapshot_id,description from snapshots where vm_id = 'd47d6843-a2d4-4ed7-80cf-493f9c3b0288';
             snapshot_id              | description 
--------------------------------------+-------------
 354db0cf-fbbf-4c2c-9273-1d0fa1bc5b2b | Active VM
(1 row)

As per the current code, it will wait for 354db0cf to go none which will never happen.



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

rhevm-4.1.7.6-0.1.el7.noarch
ansible-2.3.2.0-2.el7.noarch.rpm

How reproducible:

100%

Steps to Reproduce:

1. Start a stateless VM.

2. Try to stop using ovirt_vms module.

      - name: Shutting down VM
        ovirt_vms:
           auth: "{{ ovirt_auth }}"
           name: testvm
           state: stopped


3. It will fail with a timeout error.

Actual results:

Stopping stateless VM is not working.

Expected results:

Stopping stateless VM should work.

Additional info:

Comment 1 nijin ashok 2017-11-16 04:41:17 UTC
I have sent a PR here https://github.com/ansible/ansible/pull/32955

Comment 2 Martin Perina 2018-01-03 12:01:28 UTC
Will be part of Ansible 2.5.0

Comment 3 Martin Perina 2018-04-13 11:58:29 UTC
Moving to ON_QA, Ansible 2.5 is required by engine 4.2.3

Comment 4 Eyal Edri 2018-04-18 09:32:18 UTC
Should this be part of an ET if we ended up dropping Ansible ET from RHV?

Comment 5 Martin Perina 2018-04-19 12:08:20 UTC
(In reply to Eyal Edri from comment #4)
> Should this be part of an ET if we ended up dropping Ansible ET from RHV?

Ansible Engine 2.5 is already out, so we don't have any errata to attach them to. I started a thread with Ansible team how to deal with 2.5.1 and future versions

Comment 6 Lucie Leistnerova 2018-04-20 11:58:29 UTC
Stateless VM stopped successfully.

verified in ansible 2.5.0 with ovirt-engine-4.2.3.2-0.1.el7.noarch