-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
VMware: vmware_guest_facts: add the ability to get guest facts and specific properties using the vSphere schema #47446
Conversation
Hi @jeking3, thank you for submitting this pull-request! |
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
|
@jeking3, just so you are aware we have a dedicated Working Group for vmware. |
This comment has been minimized.
This comment has been minimized.
This is also blocked on an upstream pyVmomi PR: vmware/pyvmomi#732 |
@jeking3 Thanks for the PR, do you think we should add a version check for Pyvmomi as this version will land up in 6.7.* or something ? Thanks |
@Akasurde I'd say we need to wait for the upstream merge to determine what that will end up being. It would probably be a good idea to roll this out across all the fact gathering modules, or what I will likely eventually do is make a vmware_facts module that can extract any or all properties of any type supported by the property collector. That way one only needs a single facts module for all of vmware and it returns a well-documented schema in the vSphere API. |
Something like |
Perhaps it would be best to leave all the individual |
34d98fa
to
b0e837a
Compare
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
|
b0e837a
to
23808f6
Compare
The test
|
One other thought, if we're updating the constraint, is that we only run the integration tests on Python 2.7 and 3.6 currently. To make sure the code still works under Python 2.6 with an older version of pyvmomi we probably need at least a small unit test to check that. Alternatively we could enable the integration tests for Python 2.6. |
Perhaps I wasn't clear before, but continuing to support Python 2.6 is a waste of energy. |
8be7cbd
to
5f53f03
Compare
5f53f03
to
75b13d7
Compare
75b13d7
to
7c06fb2
Compare
This is now passing along with an integration test. |
@jeking3 While Ansible has dropped official support for Python 2.6 on the controller, management of systems with Python 2.6 is still officially supported. Although the Python Software Foundation no longer supports Python 2.6, there are currently supported Linux distributions which include Python 2.6. Testing is an important part of support, which is why we're concerned about testing modules on Python 2.6. |
@Akasurde this is ready for final review. |
@mattclay Are you OK in merging this ? or do you have any comment which are unanswered ? Thanks. |
rebuild_merge |
@jeking3 Thanks for the contribution. @pdellaert @mattclay Thanks for the review. |
SUMMARY
The module
vmware_guest_facts
mutates the vSphere results into a form that appears to align with the result from the libvirt guest facts. This output is a subset of the total information available about the guest, and the output format is not documented (see results -> instance).This pull request adds the ability to optionally specify the output format of the fact gathering to be in one of the following two formats:
summary
is the existing format in the module, and the defaultvsphere
is the vSphere API documented format, in JSON formThe properties are an optional list of dotted property names, identical to the format the property collector would normally take. When a property list is given, those properties are extracted from the vim object that results from the standard
get_vm
lookup that was already there. (The property list is not passed into the property collector - that would have required modifying the vm lookup code paths which are already complex).An example configuration file for the module is:
Example result:
Advantages of vSphere API access are:
ISSUE TYPE
COMPONENT NAME
vmware_guest_facts
ANSIBLE VERSION
ADDITIONAL INFORMATION