Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1721222

Summary: ovirt_vm module does not migrate pinned VM when forced_migrate param is used
Product: Red Hat Enterprise Virtualization Manager Reporter: Jan Zmeskal <jzmeskal>
Component: ansibleAssignee: Martin Perina <mperina>
Status: CLOSED NOTABUG QA Contact: Lukas Svaty <lsvaty>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.3.4CC: akrejcir, omachace
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-27 11:12:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Zmeskal 2019-06-17 15:32:25 UTC
Description of problem:
When running ovirt_vm module with migrate=yes and force_migrate=yes, a VM should be migrated even though it is pinned. This however isn't the case.

Version-Release number of selected component (if applicable):
Ansible 2.8.1
rhvm-4.3.4.3-0.1.el7.noarch

How reproducible:
100 %

Steps to Reproduce:
1. Have a VM in your RHV engine
2. Edit this VM. Go to Host section and set Migration Mode to "Do not allow migration". 
3. Prepare this playbook (fill in values appropriate for your environment): http://pastebin.test.redhat.com/772414
4. Add force_migrate=yes to the ovirt_vm task
5. Run the playbook

Actual results:
This error is thrown: "Fault reason is \"Operation Failed\". Fault detail is \"[Cannot migrate VM. VM is pinned to Host.]\". HTTP response code is 409."

Expected results:
Pinned VM should be migrated when force_migrate is set to true.

Comment 2 Ondra Machacek 2019-06-27 07:59:02 UTC
Per code this is intended behaviour:

 https://github.com/oVirt/ovirt-engine/blob/127dc1537c31e644894a2ad3cd20c8711b7713b8/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/VmValidator.java#L391

Andrej, can you confirm that this is intended behaviour? Thanks.

Comment 3 Jan Zmeskal 2019-06-27 08:06:22 UTC
Hi Ondra, this is however in contradiction with documentation: https://docs.ansible.com/ansible/latest/modules/ovirt_vm_module.html

The doc say about force_migrate: If true, the VM will migrate even if it is defined as non-migratable.

Jan

Comment 4 Andrej Krejcir 2019-06-27 08:36:09 UTC
This is intended. There are 3 migration modes:
- Automatic migration allowed - It is possible to migrate the VM by a script with force_migrate=no
- Manual migration only - The force_migrate has to be 'yes'.
- Migration not allowed - This mode can be useful for example when the VM uses pass-through of host devices.

It looks like a documentation bug.

Comment 5 Jan Zmeskal 2019-06-27 08:53:27 UTC
(In reply to Andrej Krejcir from comment #4)
> This is intended. There are 3 migration modes:
> - Automatic migration allowed - It is possible to migrate the VM by a script
> with force_migrate=no
> - Manual migration only - The force_migrate has to be 'yes'.
> - Migration not allowed - This mode can be useful for example when the VM
> uses pass-through of host devices.
> 
> It looks like a documentation bug.

If this behaviour is indeed intended, I believe we can close this. I created a new docs bug here: https://bugzilla.redhat.com/show_bug.cgi?id=1724535

Comment 6 Martin Perina 2019-06-27 11:12:14 UTC
Closing as NOTABUG, Ansible module doc will be fixed by BZ1724535