ideadevice / ansible-ahv-provider-plugin

Ansible plugins to interact with AHV APIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage of nutanix_vm_info and nutanix_image_info should be consistent

yannickstruyf3 opened this issue · comments

Retrieving info for a vm requires following structure:

    - name: "Getting info for image {{ vm_image_name }}"
      nutanix_image_info:
        image_name: "{{vm_image_name}}"
        validate_certs: no

For a VM this is required:

   nutanix_vm_info:
     validate_certs: no
     data:
       filter: "vm_name=={{ item }}"
       offset: 0
       length: 100
       sort_attribute: ASCENDING
       sort_order: ASCENDING

There is not option to specific a vm_name while it is possible to pass image_name in the nutanix_image_info task

FIQL filters aren't supported by images API. nutanix_image_info module is filtering the image name internally using the value of image_name to bypass this. Addition of vm_name to nutanix_vm_info module will force us to give precedence to either the filed value or the one from data filter(when both are present)