Bug 1933238 - Allow migration of vms in between the clusters using ansible
Summary: Allow migration of vms in between the clusters using ansible
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-ansible-collection
Version: 4.4.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.4.6
: ---
Assignee: Martin Necas
QA Contact: Guilherme Santos
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-26 08:47 UTC by Marian Jankular
Modified: 2024-10-01 17:34 UTC (History)
6 users (show)

Fixed In Version: ovirt-ansible-collection-1.5.0
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-01 13:23:43 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 236 0 None open ovirt_vm: allow cluster migration 2021-03-18 15:46:09 UTC
Red Hat Product Errata RHSA-2021:2180 0 None None None 2021-06-01 13:24:08 UTC

Description Marian Jankular 2021-02-26 08:47:38 UTC
Description of problem:
[RFE] allow migration of vms in between the cluster via rest api

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

How reproducible:
everytime

Steps to Reproduce:
1. try to migrate vm from cluster A to cluster B with restapi
2.
3.

Actual results:
ansible all -c localhost -m ovirt_vm -a "name=test cluster=cl2 name=test state=running migrate=true"

Vm is called test and it should be migrated to cluster cl2.

The message is
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! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/libexec/platform-python"
    },
    "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."

Expected results:
vm will be migrated to the the different cluster 

Additional info:

Comment 7 Martin Necas 2021-03-18 15:46:11 UTC
Hi,
create a patch on the ansible collection which adds the capability to migrate between clusters.

Comment 10 Guilherme Santos 2021-05-05 13:39:06 UTC
Failed on:
ovirt-engine-4.4.6.6-0.10.el8ev.noarch
ovirt-ansible-collection-1.4.2-1.el8ev.noarch

Steps:
1. Have 2 hosts in two different clusters and a vm running in one of them
2. # 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."
}

Results:
Fails on ansible (also tried with setting force_migrate as true), but it succeeds on API (also tried)

Comment 11 Michal Skrivanek 2021-05-11 07:07:37 UTC
logs?

Comment 12 Martin Necas 2021-05-12 12:11:57 UTC
Please specify also host and retry it.

Comment 13 Guilherme Santos 2021-05-17 18:35:52 UTC
Verified as it works when specifying the host.
Open another bug (BZ1961353) though as imho I think it should work also not specifying the host (when the VM is running, if the VM is stopped, the host don't need to be specified)

Comment 17 errata-xmlrpc 2021-06-01 13:23:43 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 Engine and Host Common Packages security update [ovirt-4.4.6]), 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-2021:2180

Comment 18 meital avital 2022-08-14 13:50:26 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.