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

[Bug] fail to get dynamic inventory for more > 50/90 VMs in module ntnx_prism_vms_inventory #483

Closed
nahsiy opened this issue Jun 14, 2024 · 5 comments
Assignees
Labels
1.9.3_triage Bug fixes & Improvements bug Something isn't working

Comments

@nahsiy
Copy link

nahsiy commented Jun 14, 2024

Following the migration of our central prism from pc.2022.6.7 to 2024.1, our ntnx_prism_vms_inventory plugin no longer works without an explicit error, as soon as we set a lenght of more than 50/90.

Via curl or postman, it works for 500 VMs, which seems to be the limit.

our inventory code :


plugin: nutanix.ncp.ntnx_prism_vm_inventory
strict: false
nutanix_hostname: "{{cluster}}""
nutanix_port: "" # Make sure the port is correct
validate_certs: false
data: {"offset": 0, "length": 1000}
groups:
  vm_OFF: "'OFF' in power_state"
  vm_NGT: "'INSTALLED' in guest_tools.nutanix_guest_tools.ngt_state"
keyed_groups:
  - prefix: "vm_ZONE"
    separator: ':'
    key: "ntnx_categories.ZONE"
  - prefix: "vm_SITE"
    separator: ':'
    key: "ntnx_categories.SITE"
  - prefix: "vm_OS"
    separator: ':'
    key: "ntnx_categories.OS"
  - prefix: "vm_MCO"
    separator: ':'
    key: "ntnx_categories.MCO"

before this migration, we had no problem recovering all the VMs in our cluster (554VMS) with this configuration

@bhati-pradeep
Copy link
Collaborator

bhati-pradeep commented Jul 15, 2024

@nahsiy Can you share error log which you are facing ?

@nahsiy
Copy link
Author

nahsiy commented Jul 17, 2024

Hello,

inventory

(For lengh = 1000)

ansible-inventory -i 00-nutanix.yaml --list

[WARNING]: * Failed to parse /home/cmassieu/Documents/gitlab/fr-ansible/00-nutanix.yaml with auto plugin: 'Mock_Module' object has no attribute 'fail_json' [WARNING]: * Failed to parse /home/cmassieu/Documents/gitlab/fr-ansible/00-nutanix.yaml with yaml plugin: Plugin configuration YAML file, not YAML inventory [WARNING]: * Failed to parse /home/cmassieu/Documents/gitlab/fr-ansible/00-nutanix.yaml with ini plugin: Invalid host pattern '---' supplied, '---' is normally a sign this is a YAML file. [WARNING]: Unable to parse /home/cmassieu/Documents/gitlab/fr-ansible/00-nutanix.yaml as an inventory source [WARNING]: No inventory was parsed, only implicit localhost is available { "_meta": { "hostvars": {} }, "all": { "children": [ "ungrouped" ] } }

Regards

Yishan

@stahnjones
Copy link

500 entities appears to be the internal hard-coded limit for a single API call in V3 API

@bhati-pradeep
Copy link
Collaborator

bhati-pradeep commented Jul 25, 2024

Hi @stahnjones, for length > 500 in vms, it internally takes care of it by doing multiple api calls to fetch give number of vms.

For this ticket, issue was pc slowness causing timeout while doing list calls.
We have a ticket open for override timeout : #409

@nahsiy can we close this ticket for now and track capability of increasing timeout in above mentioned ticket ?

@bhati-pradeep bhati-pradeep added the 1.9.3_triage Bug fixes & Improvements label Aug 5, 2024
@nahsiy
Copy link
Author

nahsiy commented Aug 26, 2024

Hello @bhati-pradeep,

Yes, thanks a lot !

@nahsiy nahsiy closed this as completed Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.9.3_triage Bug fixes & Improvements bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants