- 
                Notifications
    You must be signed in to change notification settings 
- Fork 164
add the vmware guestinfo service #20
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution: a small nit to be taken care of -- the hardcoded rpctool path.
In the commit message, can you put more information on this service and what are the requirements to be installed on the image?
| from cloudbaseinit.metadata.services import base | ||
| from cloudbaseinit.osutils import factory as osutils_factory | ||
|  | ||
| RPCTOOL_PATH = 'C:/Program Files/VMware/VMware Tools/rpctool.exe' | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this path needs to be made configurable, you can set its default value to this path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
18d4a60    to
    cd926ca      
    Compare
  
    | I've added more details about the dependencies inside the VMwareGuestInfoService class documentation. Is that OK or should that also be included in the commit message? | 
395053f    to
    6cbbf52      
    Compare
  
    | @rgl This is great! One recommendation though. There is currently an official vmware cloud-init datasource https://github.com/vmware/cloud-init-vmware-guestinfo#configuration that reads guestinfo properties for how the meta and userdata are encoded. In quick overview of the example comment on your commit it looks like the input is expected to be base64+gzip but does not mention this in the info https://github.com/cloudbase/cloudbase-init/pull/20/files#diff-79a52948a1c2159908ab0bec485abdeaR39-R40 | 
5388c51    to
    e7b6f40      
    Compare
  
    | this is now ready, can you please review it? | 
e7b6f40    to
    bceee0a      
    Compare
  
    bceee0a    to
    9155c75      
    Compare
  
    | @bhoriuchi I've updated the docstring to mention the gzip+base64 | 
| | | scripts as described at doc/source/userdata.rst | | ||
| +--------------------+------------------------------------------------------+ | ||
| Each property value should be gzip compressed and must be base64 encoded. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify - the should here is intentional, correct? In that https://github.com/cloudbase/cloudbase-init/pull/20/files#diff-79a52948a1c2159908ab0bec485abdeaR130-R132 suggest that gzipping is not required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, correct.
| self._options = [ | ||
| cfg.StrOpt( | ||
| 'rpctool_path', | ||
| default='C:/Program Files/VMware/VMware Tools/rpctool.exe', | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this tool get installed when the vmware tools is installed on windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rgl I have updated my review with the main points being: do not add this service as a default, move docs to correct place and remove the username patch from this patch).
On the actual usability of this code, are you actively using this feature? Or do you know people using / require it? the main problem with this feature is testing / maintaining it, as it requires proprietary software (rpctool) and proprietary underlying cloud service.
| 'cloudbaseinit.metadata.services.httpservice.HttpService', | ||
| 'cloudbaseinit.metadata.services' | ||
| '.vmwareguestinfoservice.VMwareGuestInfoService', | ||
| 'cloudbaseinit.metadata.services' | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this metadata service should not be put as a default service, as it will degrade the performance (cloudbase-init runs mostly on openstack).
|  | ||
| class VMwareGuestInfoService(base.BaseMetadataService): | ||
| """ | ||
| This uses the VMware Guest Info interface to obtain the cloud init data | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this information should go into the docs, in the services page.
| LOG.debug('Public keys not found in metadata') | ||
| return base.PLUGIN_EXECUTION_DONE, False | ||
|  | ||
| username = CONF.username | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change should be removed from this patch, I will add another patch to have this fix merged asap.
| I'm the only user. Maybe others would start to use it if they known about it in the cloudbase-init documentation. I will understand if you are not comfortable to include this upstream, I can always maintain a fork of it or have a way to easily include this over the upstream version Will do the requested changes when possible. Thanks for the review! | 
| I would also like to use this feature. | 
| I think that for testing purposes we can use a precompiled binary from this source: https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/rpctool/rpctool.c I need to investigate how much effort would be to actually translate the used features in native python code too. | 
| Sorry for another +1, but me and several others are extremely excited to see this and try it out! | 
| @bhoriuchi @codyja great to hear that :) @rgl to include this feature, we need unit tests too :) | 
| Any updates on this? @rgl | 
| Not yet. Will look into it soonish. | 
| @rgl @rhockenbury I will rewrite the implementation and post it on launchpad soon. Will notify when it's in a working state. | 
| Here is a working implementation based, tested using a dummy rpctool.exe that returns basic info: Here is a functional test: I need to add the unit tests and documentation, let me know if you have any comments. | 
| @ader1990 Is there a build available with the vmware service? Preferably with the runcmd and jinja templating work. | 
| @rhockenbury you can use the github actions to build the cloudbase-init msi for you. Then fork this repo: https://github.com/ader1990/cloudbase-init-installer-1, update these two lines with the first step repo/branch and then push the installer commit on GitHub: You ll then go to the actions tab on your installer repo on Github, then wait and after a while, the action will finish and you can download the zipped msi from the artifacts tab. example: | 
| @ader1990 I saw that the VMwareGuestInfoService made it to master - Do you know what's the timeline for cutting a new release? | 
| @rhockenbury @rgl @codyja @bhoriuchi The feature has been merged to master: Please check the docs for more information: | 
| 
 A new release should come soon. It would be very helpful If you can test the VMware guest service in your environment, to make sure your requirements are met. | 
| Thanks. I have been using the vmware service without issue, but that was an older build I had put together. I'll test out what's currently on master. If others need a build - https://github.com/rhockenbury/cloudbase-init-installer-1/suites/429131013/artifacts/1450680 | 
| No issues on my end with the vmware guest service. | 
| 
 I was trying to build the msi but the build https://github.com/rgl/cloudbase-init-installer/runs/423797759#step:4:809 is failed with: This is because of the hardcoded path at CloudbaseInitSetup/CloudbaseInitSetup.wixproj. I've fixed that to use a relative path at rgl/cloudbase-init-installer@8d0fa1c tomorrow I will try the generated msi in VMware. | 
| Finally had a chance to try it out, and it works nicely! :-) Just have one suggestion. In 
 | 
| 
 Great to hear that, @rgl For the YAML parser, there is the need to be compatible with vmware extension of cloud-init's implementation: https://github.com/vmware/cloud-init-vmware-guestinfo/blob/master/DataSourceVMwareGuestInfo.py#L401 Thank you, | 
| I was trying to say that when we are using the yaml parser we are being compatible with json and yaml. | 
| 
 In theory, yes, but in the real world, this does not happen. A valid JSON is not a valid YAML if you use spaces / tabs or newlines in the "wrong" YAML way. And I cannot make any assumptions about the actual implementations in Python. But to give you a small example that a valid JSON is not a valid YAML: {
"test": 
"test"
}If all is in order, can you please close this PR? | 
| 
 I see. The used Python version does not have a yaml 1.2 compatible parser? 
 That is valid yaml 1.2 (a version from 2009). 
 Will do! Thank You! PS: For easier reference this was closed at a77477e | 
| Does anyone have an MSI handy or have anymore ideas when that new release will come? Thanks | 
| @codyja the version that I've tried is at https://github.com/rgl/cloudbase-init-installer/actions/runs/34335168 | 
| 
 The beta installers have the vmwareguestinfo support: https://www.cloudbase.it/downloads/CloudbaseInitSetup_x64.msi | 
This is the initial draft for getting the userdata from the vmware guestinfo interface from the same guestinfo properties as https://github.com/vmware/cloud-init-vmware-guestinfo#configuration.
What do you think of including this in this repo? Is in an acceptable state?