You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the examples provided for ntnx_images_info, I encounter runtime issues when applying a filter to the images_info query
We use cloud-init isos to customize the VM on deploys
We have a playbook that leaves ${hostname}-cloud-init isos on VM deploy failure.
It appears we can upload multiple instances of the same ISO with the same name. This causes issues on new VM deploys using nutanix.ncp.ntnx_vms ( 500 Internal Server Error )
To address this issue, I am attempting to sanity check for existing cloud-init isos and make a list to purge if duplicates are found.
To Reproduce
Steps to reproduce the behavior:
Create 12 images named "some-host-cloud-init.iso" using the same ISO file.
- name: Create VM If It Does Not Exist
when: does_nutanix_vm_exist.response.metadata.total_matches == 0
block:
- name: Sanity Check for Existing Cloud Init ISOs
delegate_to: localhost
register: existing_cloud_init_isos
nutanix.ncp.ntnx_images_info:
nutanix_host: '{{ nutanix_hostname }}'
filter:
- name: '{{ inventory_hostname_short }}-cloud-init.iso'
length: -1
offset: 0
sort_order: 'ASCENDING'
sort_attribute: 'name'
Stack trace
TASK [Sanity Check for Existing Cloud Init ISOs] *********************************************************
Friday 18 August 2023 18:41:53 -0700 (0:00:01.208) 0:00:02.107 *********
Friday 18 August 2023 18:41:53 -0700 (0:00:01.208) 0:00:02.106 *********
fatal: [${FQDN} -> localhost]: FAILED! => {"changed": false, "msg": "argument 'filter' is of type <class 'list'> and we were unable to convert to dict: <class 'list'> cannot be converted to a dict"}
Expected behavior
Filtering on '{{ inventory_hostname_short }}-cloud-init.iso' should result in a json list containing the 12 instances of this file that I can parse to gather a list of UUIDs to queue for deletion.
Additional context
I tested using a known single instance of an image name and got the same error ( 'CENTOS_78' )
Please let me know if you need additional information.
Thanks
The text was updated successfully, but these errors were encountered:
Dear @jhowe-uw,
Unfortunately, there is a typo in the example, and as you can see, the error message says that the filter must be a dictionary.
So it should look like this.
Describe the bug
Following the examples provided for ntnx_images_info, I encounter runtime issues when applying a filter to the images_info query
We use cloud-init isos to customize the VM on deploys
We have a playbook that leaves ${hostname}-cloud-init isos on VM deploy failure.
It appears we can upload multiple instances of the same ISO with the same name. This causes issues on new VM deploys using nutanix.ncp.ntnx_vms ( 500 Internal Server Error )
To address this issue, I am attempting to sanity check for existing cloud-init isos and make a list to purge if duplicates are found.
To Reproduce
Steps to reproduce the behavior:
Create 12 images named "some-host-cloud-init.iso" using the same ISO file.
Relevant vars
Playbook
Stack trace
Expected behavior
Filtering on '{{ inventory_hostname_short }}-cloud-init.iso' should result in a json list containing the 12 instances of this file that I can parse to gather a list of UUIDs to queue for deletion.
Additional context
I tested using a known single instance of an image name and got the same error ( 'CENTOS_78' )
Please let me know if you need additional information.
Thanks
The text was updated successfully, but these errors were encountered: