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

Make Cloudstack paging work for listVirtualMachines #40018

Merged
merged 1 commit into from May 12, 2018
Merged

Make Cloudstack paging work for listVirtualMachines #40018

merged 1 commit into from May 12, 2018

Conversation

pfarmer
Copy link
Contributor

@pfarmer pfarmer commented May 11, 2018

Cloudstack paging wasn't supported, so once a cs domain has over 500 (default page size) VMs, Ansible can no longer find newly created VM.

SUMMARY

Cloudstack paging wasn't supported, so once a cs domain has over 500 (default page size) VMs, Ansible can no longer find newly created VM.

Paging is supported in the cs module, the cs module abstracts away the pages, and returns a list of the VMs. The normal cloudstack response contains a "count" variable (the count of virtualmachines in the domain), and a list of the virtualmachines, when paging, the cs module just returns a list of virtualmachines, so some small changes needed to be made to remove the reference to the "virtualmachine" key.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

cloudstack

ANSIBLE VERSION
[root@173d518834c1 playbook]# ansible --version
ansible 2.6.0
  config file = None
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Apr 11 2018, 07:36:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
ADDITIONAL INFORMATION

Before this change, once 500 VMs exists in the domain, the following error is seen.

fatal: [server38]: FAILED! => {"api_http_method": "get", "api_key": "******", "api_region": "cloudstack", "api_timeout": "30", "api_url": "http://172.17.0.2:8080/client/api", "changed": false, "msg": "Virtual machine 'server38' not found", "zone": "Sandbox-simulator"}

Cloudstack paging wasn't supported, so once a cs domain has over 500 (default page size) VMs, Ansible can no longer find newly created VM.
Missed one file

Pass fetch_list to cs python module
@ansibot
Copy link
Contributor

ansibot commented May 11, 2018

@ansibot ansibot added bug This issue/PR relates to a bug. c:inventory/contrib_script cloud cloudstack core_review In order to be merged, this PR must follow the core review workflow. inventory Inventory category module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels May 11, 2018
@dj-wasabi
Copy link
Contributor

I'm all for this PR! 👍

@resmo
Copy link
Contributor

resmo commented May 11, 2018

LGTM

Makes things even easier. Let's work towards for full pagination support in all modules.

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label May 11, 2018
@resmo resmo merged commit 16994bb into ansible:devel May 12, 2018
@pfarmer
Copy link
Contributor Author

pfarmer commented May 12, 2018

@resmo I’ll have a look through the rest of the cloudstack related code next week to what else might need this change.

@resmo
Copy link
Contributor

resmo commented May 12, 2018

@pfarmer nice, looking forward and thanks for your contribution!

oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this pull request May 12, 2018
Paging wasn't implemented, so once a cs domain has over 500 (default page size) VMs, Ansible can no longer find newly created VM.
oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this pull request May 14, 2018
Paging wasn't implemented, so once a cs domain has over 500 (default page size) VMs, Ansible can no longer find newly created VM.
oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this pull request May 14, 2018
Paging wasn't implemented, so once a cs domain has over 500 (default page size) VMs, Ansible can no longer find newly created VM.
tonal pushed a commit to tonal/ansible that referenced this pull request May 15, 2018
Paging wasn't implemented, so once a cs domain has over 500 (default page size) VMs, Ansible can no longer find newly created VM.
oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this pull request May 15, 2018
Paging wasn't implemented, so once a cs domain has over 500 (default page size) VMs, Ansible can no longer find newly created VM.
oolongbrothers pushed a commit to oolongbrothers/ansible that referenced this pull request May 15, 2018
Paging wasn't implemented, so once a cs domain has over 500 (default page size) VMs, Ansible can no longer find newly created VM.
ilicmilan pushed a commit to ilicmilan/ansible that referenced this pull request Nov 7, 2018
Paging wasn't implemented, so once a cs domain has over 500 (default page size) VMs, Ansible can no longer find newly created VM.
@ansible ansible locked and limited conversation to collaborators May 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug. c:inventory/contrib_script cloud cloudstack core_review In order to be merged, this PR must follow the core review workflow. inventory Inventory category module This issue/PR relates to a module. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants