Skip to content
This repository has been archived by the owner on Aug 23, 2021. It is now read-only.

SUCCESS: found local data from DataSourceVMwareGuestInfo when no data is provided #33

Closed
mitchellmaler opened this issue Feb 10, 2020 · 5 comments

Comments

@mitchellmaler
Copy link

mitchellmaler commented Feb 10, 2020

We have installed VMwareGuestInfo and updated the datasource_list to allow more than the override provided. One issue is even if we don't provide any guestinfo data it still counts the datasource as success and doesn't move onto the others.

I would expect it to move onto the next datasource since each returned nothing. I know I can fix this by moving the VMwareGuestInfo to be checked last but that seems like just a workaround.

2020-02-10 15:27:57,631 - DataSourceVMwareGuestInfo.py[DEBUG]: Getting guestinfo value for key metadata
2020-02-10 15:27:57,631 - util.py[DEBUG]: Running command ['/usr/bin/vmtoolsd', '--cmd', 'info-get guestinfo.metadata'] with allowed return codes [0] (shell=False, capture=True)
2020-02-10 15:27:57,664 - DataSourceVMwareGuestInfo.py[DEBUG]: No value found for key metadata
2020-02-10 15:27:57,665 - DataSourceVMwareGuestInfo.py[DEBUG]: Getting guestinfo value for key userdata
2020-02-10 15:27:57,665 - util.py[DEBUG]: Running command ['/usr/bin/vmtoolsd', '--cmd', 'info-get guestinfo.userdata'] with allowed return codes [0] (shell=False, capture=True)
2020-02-10 15:27:57,677 - DataSourceVMwareGuestInfo.py[DEBUG]: No value found for key userdata
2020-02-10 15:27:57,677 - DataSourceVMwareGuestInfo.py[DEBUG]: Getting guestinfo value for key vendordata
2020-02-10 15:27:57,677 - util.py[DEBUG]: Running command ['/usr/bin/vmtoolsd', '--cmd', 'info-get guestinfo.vendordata'] with allowed return codes [0] (shell=False, capture=True)
2020-02-10 15:27:57,687 - DataSourceVMwareGuestInfo.py[DEBUG]: No value found for key vendordata
2020-02-10 15:27:57,687 - handlers.py[DEBUG]: finish: init-local/search-VMwareGuestInfo: SUCCESS: found local data from DataSourceVMwareGuestInfo
2020-02-10 15:27:57,688 - stages.py[INFO]: Loaded datasource DataSourceVMwareGuestInfo - DataSourceVMwareGuestInfo
@foxalfabravo
Copy link

foxalfabravo commented Mar 31, 2020

Same result when vmtoolsd are not installed (or removed by AWS import) - Extract of cloud-init-output.log

2020-03-31 15:17:04,458 - util.py[DEBUG]: Failed to get guestinfo value for key vendordata: Unexpected error while running command.
Command: ['/usr/bin/vmtoolsd', '--cmd', 'info-get guestinfo.vendordata']
Exit code: 1
Reason: -
Stdout:
Stderr: Unable to send command to VMware hypervisor.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceVMwareGuestInfo.py", line 171, in _get_guestinfo_value
    (stdout, stderr) = util.subp([self.vmtoolsd, "--cmd", "info-get guestinfo." + key])
  File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 2068, in subp
    cmd=args)
ProcessExecutionError: Unexpected error while running command.
Command: ['/usr/bin/vmtoolsd', '--cmd', 'info-get guestinfo.vendordata']
Exit code: 1
Reason: -
Stdout:
Stderr: Unable to send command to VMware hypervisor.
2020-03-31 15:17:04,458 - handlers.py[DEBUG]: finish: init-local/search-VMwareGuestInfo: SUCCESS: found local data from DataSourceVMwareGuestInfo
`

@foxalfabravo
Copy link

foxalfabravo commented May 5, 2020

Not reproducible using tag v1.3.1

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceVMwareGuestInfo.py", line 320, in get_guestinfo_value
    [VMWARE_RPCTOOL, "info-get guestinfo." + key])
  File "/usr/lib/python2.7/site-packages/cloudinit/util.py", line 2068, in subp
    cmd=args)
ProcessExecutionError: Unexpected error while running command.
Command: ['/usr/bin/vmware-rpctool', 'info-get guestinfo.vendordata']
Exit code: 1
Reason: -
Stdout:
Stderr: Failed sending message to VMware.
2020-05-05 01:15:18,172 - __init__.py[DEBUG]: Datasource DataSourceVMwareGuestInfo not updated for events: New instance first boot
2020-05-05 01:15:18,173 - handlers.py[DEBUG]: finish: init-local/search-VMwareGuestInfo: SUCCESS: no local data found from DataSourceVMwareGuestInfo
2020-05-05 01:15:18,173 - handlers.py[DEBUG]: start: init-local/search-NoCloud: searching for local ```

@mitchellmaler
Copy link
Author

@foxalfabravo Good to hear!
Is there an RPM for the latest release so I can give it a try?

@foxalfabravo
Copy link

foxalfabravo commented May 5, 2020

Here is mine, but you could have rebuild easily, except that you need to change the release nr in the spec file

cloud-init-vmware-guestinfo-1.3.2-1.el7.noarch.rpm.zip

@akutz
Copy link
Contributor

akutz commented Aug 11, 2021

This issue is being closed because this datasource has been merged into cloud-init (canonical/cloud-init#953):

Component Source Tests
Datasource DataSourceVMware.py test_vmware.py
Identification ds-identify test_ds_identify.py
Documentation vmware.rst

In order to participate in the growth of this datasource moving forward, please:

Once again, many thanks to the wonderful community that has grown around this datasource, and I look forward to seeing everyone in the new cloud-init forums!

@akutz akutz closed this as completed Aug 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants