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:
Hi, create a patch on the ansible collection which adds the capability to migrate between clusters.
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)
logs?
Please specify also host and retry it.
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)
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
Due to QE capacity, we are not going to cover this issue in our automation