# Issue uploading disk image with ovirt\_disk module

**URL:** <https://forum.ansible.com/t/issue-uploading-disk-image-with-ovirt-disk-module/36992>\
**Category:** Ansible Project\
**Tags:** awx, ee\
**Created:** [August 16, 2022, 12:20pm UTC](https://forum.ansible.com/t/issue-uploading-disk-image-with-ovirt-disk-module/36992 "2022-08-16T12:20:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rob\_B](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rob_b/32/4803_2.png) [@Rob\_B](https://forum.ansible.com/u/Rob_B)\
**Post date:** [August 16, 2022, 12:20pm UTC](https://forum.ansible.com/t/issue-uploading-disk-image-with-ovirt-disk-module/36992/1 "2022-08-16T12:20:42Z")

</div>

Hi,

I hope this is the correct group to ask this, it’s not entirely clear where the issue lies.

I’m using the ovirt.ovirt.ovirt\_disk module to upload a disk image to our ovirt system and attach to a VM.  
This works when I run the playbook locally (on a test Alma8 host), but when I try to run it in AWX the task fails with the following error.

“exception”: “Traceback (most recent call last):\n File "/tmp/ansible\_ovirt.ovirt.ovirt\_disk\_payload\_qoy8tx2r/ansible\_ovirt.ovirt.ovirt\_disk\_payload.zip/ansible\_collections/ovirt/ovirt/plugins/modules/ovirt\_disk.py", line 899, in main\n File "/tmp/ansible\_ovirt.ovirt.ovirt\_disk\_payload\_qoy8tx2r/ansible\_ovirt.ovirt.ovirt\_disk\_payload.zip/ansible\_collections/ovirt/ovirt/plugins/modules/ovirt\_disk.py", line 598, in upload\_disk\_image\n File "/tmp/ansible\_ovirt.ovirt.ovirt\_disk\_payload\_qoy8tx2r/ansible\_ovirt.ovirt.ovirt\_disk\_payload.zip/ansible\_collections/ovirt/ovirt/plugins/modules/ovirt\_disk.py", line 583, in upload\_disk\_image\nNameError: name ‘client’ is not defined\n”,  
“msg”: “name ‘client’ is not defined”,

I also get the same error when I try to run the playbook from my test host against another remote test host.

I have the same version of the python3-ovirt-engine-sdk4 RPM (4.4.15-1) on the local test host (where the upload works) as I do on the AWX EE (and the other remote host) and also the latest ovirt collection on all hosts/EE.

The task looks like…

- name: Upload KS config disk  
ovirt.ovirt.ovirt\_disk:  
name: new\_host\_ks\_config  
vm\_id: “{{ new\_vm\_info.id }}”  
interface: virtio\_scsi  
size: 10MiB  
format: cow  
image\_path: “/var/build/disk\_image.qcow2”  
storage\_domain: “my\_domain”  
auth: “{{ ovirt\_auth }}”

All other tasks that use the ovirt modules work ok.  
The /var/build/ path is being shared with the AWX EE, so it can ‘see’ the disk image to upload.  
As a test, I can upload the disk image to ovirt manually - if I then re-run the job in AWX, the upload task completes successfully, but obviously with no change as the disk image is already uploaded. The following tasks (including using ovirt modules) then continue as expected.

Any ideas as to why this upload task only works when running the playbook locally would be much appreciated. Please let me know if you need any more info.

Thanks  
Rob

---

<div class="post-metadata">

**Author:** ![Rob\_B](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/rob_b/32/4803_2.png) [@Rob\_B](https://forum.ansible.com/u/Rob_B)\
**Post date:** [October 12, 2022, 1:59pm UTC](https://forum.ansible.com/t/issue-uploading-disk-image-with-ovirt-disk-module/36992/2 "2022-10-12T13:59:52Z")

</div>

Fyi, this was resolved by install ovirt\_imageio.

pip install ovirt\_imageio --user
