Bug 1961353 - Allow migration of vms in between clusters not specifying host
Summary: Allow migration of vms in between clusters not specifying host
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: ovirt-ansible-collection
Classification: oVirt
Component: General
Version: 1.4.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Martin Necas
QA Contact: Guilherme Santos
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-17 18:33 UTC by Guilherme Santos
Modified: 2021-05-24 20:57 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-05-18 06:28:35 UTC
oVirt Team: Infra
Embargoed:


Attachments (Terms of Use)

Description Guilherme Santos 2021-05-17 18:33:57 UTC
Description of problem:
BZ1933238 adds the functionality of migrate between clusters through the ovirt_vm ansible collection, however the destination host needs to be specified for the migration to work. 
# ansible localhost -c localhost -m ovirt.ovirt.ovirt_vm -a "name=vm_1 cluster=cl_2 state=running migrate=true auth='url=https://<engine-fqdn>/ovirt-engine/api username=admin@internal password=<pass> insecure=true'" -v
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 update a VM in this status. Try stopping the VM first.]". HTTP response code is 409.
localhost | FAILED! => {
    "changed": false,
    "msg": "Fault reason is \"Operation Failed\". Fault detail is \"[Cannot update a VM in this status. Try stopping the VM first.]\". HTTP response code is 409."
}

If you stop the vm and then run it, it works (the host is automatically chosen)
I think that, for consistence, it should be possible to migrate not specifying the host and with the vm running.

Version-Release number of selected component (if applicable):
ovirt-engine-4.4.6.6-0.10.el8ev.noarch
ovirt-ansible-collection-1.4.2-1.el8ev.noarch

How reproducible:
always

Steps to Reproduce:
1. Have a running VM and try to migrate it to another cluster
# ansible localhost -c localhost -m ovirt.ovirt.ovirt_vm -a "name=vm_1 cluster=cl_2 state=running migrate=true auth='url=https://<engine-fqdn>/ovirt-engine/api username=admin@internal password=<pass> insecure=true'" -v
2. Try again specifying the host and not specifying the host but with the vm stopped 
3.

Actual results:
Error when trying to migrate with VM on and not host specified. 

Expected results:
running VM successfully migrated with and without specifying the host (like when is not running) 

Additional info:

Comment 1 Michal Skrivanek 2021-05-18 06:28:35 UTC
nack on any improvement in this area. If anything we should add a clear documentation to the ansible role warning that a cross cluster migration is unsupported and dangerous. See bug 1441632 for details.


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