Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when removing VM with ovirt_vms #19801

Closed
atgreen opened this issue Jan 3, 2017 · 9 comments
Closed

Error when removing VM with ovirt_vms #19801

atgreen opened this issue Jan 3, 2017 · 9 comments
Labels
affects_2.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. ovirt oVirt and RHV community support:community This issue/PR relates to code supported by the Ansible community.

Comments

@atgreen
Copy link

atgreen commented Jan 3, 2017

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ovirt_vms

ANSIBLE VERSION
ansible 2.3.0 (devel 9f2d8c2409) last updated 2017/01/02 07:45:34 (GMT -400)
  config file = 
  configured module search path = Default w/o overrides
CONFIGURATION
OS / ENVIRONMENT

Fedora 25

SUMMARY

When I try to remove a VM like so...

  • name: Remove the base VM from which we just created our template
    delegate_to: localhost
    ovirt_vms:
    auth:
    username: admin@internal
    password: XXXXX
    url: https://10.0.0.3/ovirt-engine/api
    insecure: true
    state: absent
    name: rhel7-base-vm
    wait: true

I get...

An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_oqYJc_/ansible_module_ovirt_vms.py", line 891, in main
ret = vms_module.remove()
File "/tmp/ansible_oqYJc_/ansible_modlib.zip/ansible/module_utils/ovirt.py", line 540, in remove
poll_interval=self.module.params['poll_interval'],
File "/tmp/ansible_oqYJc
/ansible_modlib.zip/ansible/module_utils/ovirt.py", line 273, in wait
entity = service.get()
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/services.py", line 18259, in get
self._check_fault(response)
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 89, in _check_fault
xmlreader = xml.XmlReader(buf)
Exception: Can't read first node

fatal: [10.0.0.3 -> localhost]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"boot_devices": null,
"cd_iso": null,
"clone": false,
"clone_permissions": false,
"cloud_init": null,
"cloud_init_nics": null,
"cluster": null,
"cpu_cores": null,
"cpu_shares": null,
"cpu_sockets": null,
"delete_protected": null,
"disks": [],
"fetch_nested": false,
"force": false,
"high_availability": null,
"host": null,
"id": null,
"memory": null,
"memory_guaranteed": null,
"name": "rhel7-base-vm",
"nested_attributes": null,
"nics": [],
"operating_system": null,
"poll_interval": 3,
"state": "absent",
"stateless": null,
"sysprep": null,
"template": null,
"template_version": null,
"timeout": 180,
"type": null,
"use_latest_template_version": null,
"wait": true
},
"module_name": "ovirt_vms"
},
"msg": "Can't read first node"
}

The VM is deleted, but I get this error.

STEPS TO REPRODUCE

Run the task above

EXPECTED RESULTS

The VM should be deleted without error

ACTUAL RESULTS

See above.

@ansibot
Copy link
Contributor

ansibot commented Jan 3, 2017

@ansibot ansibot added affects_2.3 This issue/PR affects Ansible v2.3 bug_report cloud module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. labels Jan 3, 2017
@machacekondra
Copy link
Contributor

The problem is that oVirt Python SDK doesn't check the HTTP return code. In this case it will get 404, with no body, so the XmlReader will fail. Actually this is bug in both oVirt Python SDK and the ovirt.py module in module_utils. Thanks for the report, I will fix it ASAP.

@machacekondra
Copy link
Contributor

So I've checked and you are using Python SDK version 4.0.0 or lower, right? Please update to latest 4.0 version, which is 4.0.4, and it will work right:

https://pypi.python.org/pypi/ovirt-engine-sdk-python

@jimi-c jimi-c removed the plugin label Jan 4, 2017
@machacekondra
Copy link
Contributor

Please close if oVirt Python SDK update solves the issue for you.

@nitzmahone nitzmahone removed the needs_triage Needs a first human triage before being processed. label Jan 5, 2017
@mwperina
Copy link
Contributor

mwperina commented Feb 8, 2017

@atgreen Any news?

@ansibot ansibot added the virt Virt community (incl. QEMU, KVM, libvirt, ovirt, RHV and Proxmox) label Feb 8, 2017
@ganto
Copy link
Contributor

ganto commented Apr 5, 2017

I know it's just remotely related, but I just experienced a similar error when playing around with ansible 2.3.0.0 (detached HEAD f15e1f25ae) last updated 2017/04/05 22:32:14 (GMT +200) and ovirt-engine-sdk-python-4.1.3.

When trying to run the ovirt_hosts_facts module the task aborted with:

TASK [Obtain oVirt hosts facts] ******************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Exception: Can't read first node
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Can't read first node"}

The reason was, that I forgot to specify the ovirt-engine/api context in the url parameter. Thanks to your hint about the 404, I found my typo. Still I wouldn't say that the error message became any clearer with the recent versions of Ansible and the oVirt Python SDK.

Maybe this should be discussed in a different issue?

@machacekondra
Copy link
Contributor

This is something we should fix in Python SDK for oVirt. Can you please open an issue here, requesting to do a URL check, whether it's in correct format? THanks!

@ganto
Copy link
Contributor

ganto commented Apr 7, 2017

Thanks for your reply. Just for reference, I opened https://bugzilla.redhat.com/show_bug.cgi?id=1440292

@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Jun 29, 2017
@machacekondra
Copy link
Contributor

notabug

@ansibot ansibot closed this as completed Aug 3, 2017
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@dagwieers dagwieers added ovirt oVirt and RHV community and removed virt Virt community (incl. QEMU, KVM, libvirt, ovirt, RHV and Proxmox) labels Feb 21, 2019
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. ovirt oVirt and RHV community support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

No branches or pull requests

8 participants