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

OVA doesn't get configured (e.g. no IP) with vSphere 8.0 U3 #35

Open
mhoshi-vm opened this issue Nov 15, 2024 · 2 comments
Open

OVA doesn't get configured (e.g. no IP) with vSphere 8.0 U3 #35

mhoshi-vm opened this issue Nov 15, 2024 · 2 comments

Comments

@mhoshi-vm
Copy link

Not so confident but I think this OVA doesn't work properly on later releases of vSphere (atm 8.0 u3)
It seems there is a problem with how it still (last update 2021 ... ) uses the VMwareGuestInfo cloud-init datasource, which I believe is deprecated.

The mechanism I have figured out is that this OVA first executes /var/lib/vmware/ovf-to-cloud-init.sh which is responsible of creating the userdata/metadata that is fed to cloud-init in the later phase (handled by systemd)
This script will evoke, ovf-rpctool set userdata "$encoded_userdata" and ovf-rpctool set userdata.encoding "base64" which I guess its suppose to configure the guestinfo.userdata and metadata.

However during startup cloud-init doesn't find that userdata, and thus fails to configure anything.
/var/log/cloud-init.log shows the following.

2024-11-14 20:57:18,725 - util.py[DEBUG]: Running command ['/usr/bin/vmware-rpctool', 'info-get guestinfo.metadata'] with allowed return codes [0] (shell=False, capture=True)
2024-11-14 20:57:18,729 - DataSourceVMwareGuestInfo.py[DEBUG]: No value found for key metadata
2024-11-14 20:57:18,729 - DataSourceVMwareGuestInfo.py[DEBUG]: loaded metadata {}
2024-11-14 20:57:18,729 - DataSourceVMwareGuestInfo.py[DEBUG]: Getting guestinfo value for key userdata
2024-11-14 20:57:18,729 - util.py[DEBUG]: Running command ['/usr/bin/vmware-rpctool', 'info-get guestinfo.userdata'] with allowed return codes [0] (shell=False, capture=True)
2024-11-14 20:57:18,731 - DataSourceVMwareGuestInfo.py[DEBUG]: No value found for key userdata
2024-11-14 20:57:18,731 - DataSourceVMwareGuestInfo.py[DEBUG]: Getting guestinfo value for key vendordata
2024-11-14 20:57:18,731 - util.py[DEBUG]: Running command ['/usr/bin/vmware-rpctool', 'info-get guestinfo.vendordata'] with allowed return codes [0] (shell=False, capture=True)
2024-11-14 20:57:18,733 - DataSourceVMwareGuestInfo.py[DEBUG]: No value found for key vendordata

Btw I get this permission error so it may be due to how no longer later vsphere versions don't allow to directly update this value.

root@localhost [ ~ ]# vmware-rpctool "info-set guestinfo.userdata aaa"
Permission denied
@mhoshi-vm
Copy link
Author

mhoshi-vm commented Nov 15, 2024

Not elegant, but the current only workaround I found

[ Current workaround ]

  • Deploy this OVA and start as guided and expect to fail (no IP, and no password configured)
  • Force into shell using https://vmware.github.io/photon/assets/files/html/3.0/photon_troubleshoot/resetting-a-lost-root-password.html. Somehow get the IP address configured with sshd started from there.
  • Save contents of /var/lib/vmware/encoded_metadata.txt , /var/lib/vmware/encoded_userdata.txt
  • Destroy VM
  • Redeploy OVA with the exact same values.
  • Before starting the VM, check each mac address and match it to the values in /var/lib/vmware/encoded_metadata.txt (by decoding it)
  • Before starting add the following from Advanced Config in the edit VM option. Use the save contents on the previous procedure.
image

@mhoshi-vm
Copy link
Author

maybe related to #34 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant