nutanix / nutanix.ansible

Official Nutanix Ansible collections
GNU General Public License v3.0
66 stars 36 forks source link

[Bug] Results of VMs is not more then 500 by default in module inventory #354

Open peshay opened 1 year ago

peshay commented 1 year ago

Describe the bug By default the inventory plugin does not return more then 500 entries. I reviewed this together with Nutanix Support. As a workaround the setting can be used:

        data:
            description:
                - Pagination support for listing VMs
                - Default length(number of records to retrieve) has been set to 500
            default: {"offset": 0, "length": 500}
            type: dict

The understanding from the support technician was different on how this setting for pagination actually should work. Defining '"length": 500' limits the total results. But in case someone has more then 500 VMs, how could we know whats included in the results and what is not? Instead length should define the length for pagination. So if it's set to 200 I should not get just 200 VMs, I should get 200 + 200 + 136 in my case where I have 536 VMs.

To Reproduce Have 501 VMs in your cluster, run the inventory plugin at your cluster and you will not get more then 500 back by default.

Expected behavior In case I have more then 500 VMs I should get them all in the resulting inventory call

Additional context Nutanix CASE 01433800

bhati-pradeep commented 1 year ago

hi @peshay , from API and inventory code, order of VMs in inventory remains constant. So it is used to apply ansible scripts on batch of hosts when run multiple times with certain number of vms (using length and offset). Let me check with prism engineering and support team as well.