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

"Follow" parameter in various oVirt modules returns html text instead of XML #714

Open
IOMadness opened this issue Jul 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@IOMadness
Copy link

SUMMARY

When running an Ansible playbook against an oVirt cluster, and I use, for example, the ovirt.ovirt.ovirt_vm_info module, w/ the follow parameter w/ one of the appropriate struct values (i.e. nic.Nics https://ovirt.github.io/ovirt-engine-api-model/master/#types/vm/links_summary), I receive the following result:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ovirtsdk4.Error: The response content type 'text/html;charset=UTF-8' isn't the expected XML
fatal: [localhost]: FAILED! => changed=false
msg: The response content type 'text/html;charset=UTF-8' isn't the expected XML

COMPONENT NAME

This has occurred with the following modules that I've tested:
ovirt.ovirt.ovirt_vm_info
ovirt.ovirt.ovirt_nic_info
ovirt.ovirt.ovirt_disk_info

STEPS TO REPRODUCE
Set up an oVirt cluster.

Set up a playbook in Ansible to get oVirt auth:
  - name: Obtain SSO token with using username/password credentials
    ovirt.ovirt.ovirt_auth:
      url: 'https://my-host.com/ovirt-engine/api'
      hostname: 'borg.arcc.uwyo.edu'
      username: "{{ ovirt_username }}"
      ca_file: "./conf/my-host.pem"
      password: "{{ ovirt_password }}"
      
Set up another play to pull and print VM info w/ ovirt_vm_info:
  - name: "Get a List of VMs on the Cluster"
    ovirt.ovirt.ovirt_vm_info:
      auth: "{{ ovirt_auth }}"
      pattern: name=my-vm
      next_run: true
      follow: ['nics.Nic', 'disk_attachments.DiskAttachment']
    register: vm_info

  - name: "Print VM Details"
    ansible.builtin.debug:
      msg: "{{ vm_info.ovirt_vms[0] }}"
      
 Create a ovirt_login.yml file w/ oVirt credentials
 
 Run playbooks from a master playbook:
- name: "Get Current VMs"
  hosts: localhost 
  tasks:
          - block:
                  - ansible.builtin.include_vars: ovirt_login.yml
                  - import_tasks: auth_gnt.yml
                  - import_tasks: get_vm_info.yml
                  #loop: "{{ exp_target }}"
            always:
                  - import_tasks: auth_rvk.yml
      
 Get error:
 An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ovirtsdk4.Error: The response content type 'text/html;charset=UTF-8' isn't the expected XML
fatal: [localhost]: FAILED! => changed=false 
  msg: The response content type 'text/html;charset=UTF-8' isn't the expected XML
  
  This ONLY happens when I put in the "follow" parameter. Ironically, the 'deprecated' "fetch_nested" parameter actually DOES work... so uh... that's nice.
      
EXPECTED RESULTS

The playbook should run the ovirt_vm_info module and pull all the nested attributes so I can see what disks and what nics are attached to what VM.

ACTUAL RESULTS
Again, only happens when including the "follow" parameter. Otherwise the module connects just fine to oVirt and pulls data just fine.

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ovirtsdk4.Error: The response content type 'text/html;charset=UTF-8' isn't the expected XML
fatal: [localhost]: FAILED! => changed=false 
  msg: The response content type 'text/html;charset=UTF-8' isn't the expected XML
@IOMadness IOMadness added the bug Something isn't working label Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant