Bug 1488526

Summary: [ovirt-ansible-roles] ovirt-cluster-upgrade: stop_pinned_to_host_vms parameter doesn't work when VM has set two specific host and migration mode to not allow
Product: Red Hat Enterprise Virtualization Manager Reporter: Petr Kubica <pkubica>
Component: ovirt-ansible-rolesAssignee: Ondra Machacek <omachace>
Status: CLOSED ERRATA QA Contact: Petr Kubica <pkubica>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.1.5CC: mgoldboi, mperina, pkubica, pstehlik, ylavi
Target Milestone: ovirt-4.2.0Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-ansible-roles-1.1.1-0.el7ev Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of:
: 1492486 (view as bug list) Environment:
Last Closed: 2018-05-15 17:59:47 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:
Bug Depends On:    
Bug Blocks: 1492486    

Description Petr Kubica 2017-09-05 15:35:00 UTC
Description of problem:
stop_pinned_to_host_vms parameter doesn't work when VM has set two specific host and migration mode to not allow migration

Version-Release number of selected component (if applicable):
ansible-2.3.1.0-3.el7.noarch
ovirt-ansible-roles-1.0.1-1.el7ev.noarch

Environment:
vars:
  stop_pinned_to_host_vms: true

- two host
- VM with specified both hosts and migration mode to do not allow any migration

Actual results:
role will not stop VM
failed upgrade of that host

Expected results:
should stop VM in any time when VM is pinned or migration mode is allow manual migration (and when stop_pinned_to_host_vms: true)

The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_aCFv8D/ansible_module_ovirt_hosts.py", line 390, in main
    fail_condition=failed_state,
  File "/tmp/ansible_aCFv8D/ansible_modlib.zip/ansible/module_utils/ovirt.py", line 723, in action
    getattr(entity_service, action)(**kwargs)
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/services.py", line 30263, in upgrade
    return self._internal_action(action, 'upgrade', None, headers, query, wait)
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 290, in _internal_action
    return future.wait() if wait else future
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 53, in wait
    return self._code(response)
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 287, in callback
    self._check_fault(response)
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 125, in _check_fault
    self._raise_error(response, body.fault)
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 109, in _raise_error
    raise error
Error: Fault reason is "Operation Failed". Fault detail is "[Cannot switch the following Hosts to Maintenance mode: a-host-01.
One or more running VMs are indicated as non-migratable. The non-migratable VMs are: vm-01.]". HTTP response code is 409.

fatal: [**FILTERED**]: FAILED! => {
    "changed": false, 
    "failed": true, 
    "invocation": {
        "module_args": {
            "address": null, 
            "cluster": null, 
            "comment": null, 
            "fetch_nested": false, 
            "force": false, 
            "hosted_engine": null, 
            "kdump_integration": null, 
            "kernel_params": null, 
            "name": "a-host-01", 
            "nested_attributes": [], 
            "override_display": null, 
            "override_iptables": null, 
            "password": null, 
            "poll_interval": 3, 
            "public_key": false, 
            "spm_priority": null, 
            "state": "upgraded", 
            "timeout": 1200, 
            "wait": true
        }
    }, 
    "msg": "Fault reason is \"Operation Failed\". Fault detail is \"[Cannot switch the following Hosts to Maintenance mode: a-host-01.\nOne or more running VMs are indicated as non-migratable. The non-migratable VMs are: vm-01.]\". HTTP response code is 409."
}

Comment 1 Ondra Machacek 2017-09-13 10:34:25 UTC
There is introduced new parameter called stop_non_migratable_vms. The old stop_pinned_to_host_vms, is an alias to stop_non_migratable_vms variable.

Comment 2 Yaniv Lavi 2017-09-14 14:20:40 UTC
Please move this to oVirt

Comment 4 Petr Kubica 2018-01-02 13:44:56 UTC
Verified
ovirt-ansible-infra-1.1.2-1.el7ev.noarch
ovirt-ansible-cluster-upgrade-1.1.3-1.el7ev.noarch
ovirt-ansible-vm-infra-1.1.3-1.el7ev.noarch
ansible-2.4.1.0-1.el7ae.noarch
ovirt-ansible-image-template-1.1.4-1.el7ev.noarch
ovirt-ansible-roles-1.1.2-1.el7ev.noarch
ovirt-ansible-manageiq-1.1.4-1.el7ev.noarch

Comment 9 errata-xmlrpc 2018-05-15 17:59:47 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, 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/RHEA-2018:1534

Comment 10 Franta Kust 2019-05-16 13:08:55 UTC
BZ<2>Jira Resync