Open zinstack625 opened 5 months ago
As stated, some VMware hypervisors provide guestinfo in OVF as a part of an xml, and they leave expected keys (guestinfo.combustion.script specifically, and others) empty.
That's strange, why do they use the guestinfo key names in the same format as vmware-rpctool accepts them then? Shouldn't be hard to set them as guestinfo values directly...
Specifically which hypervisors resp. tools do it like this?
I guess it's not that hard to just add support for vmware-rpctool "info-get guestinfo.ovfenv" | xmllint --xpath /...
in addition to the direct guestinfo query.
That's strange, why do they use the guestinfo key names in the same format as vmware-rpctool accepts them then?
Beats me, but it's pretty easy to work around, as guestinfo.combustion.script
key is definitely empty at first boot
Shouldn't be hard to set them as guestinfo values directly...
Well, it's out of my reach to make stuff happen as expected, and considering both ignition and cloud-init have special providers for that specific format, maybe it's more of a commodity than expected
Specifically which hypervisors resp. tools do it like this?
I noticed ESXI does it like this, which should probably include vSphere and the whole family. Honestly, I don't even have access to the hypervisor, and not sure if it's some toggle on the admin side or a deliberate decision from VMware
I guess it's not that hard to just add support for
vmware-rpctool "info-get guestinfo.ovfenv" | xmllint --xpath /...
in addition to the direct guestinfo query.
It's certainly a way to do it. If it doesn't bring as much megabytes into the initrd, seems like the way to go
Looks ugly, but xmllint --xpath "string(/*[local-name()='Environment']/*[local-name()='PropertySection']/*[local-name()='Property' and @*[local-name()='key']='guestinfo.combustion.script']/@*[local-name()='value'])" -
seems to do the job
Bug
Combustion does not pick up the passed script in some VMware hypervisors, and skips OS initialization as a result
Environment
VMware ESXI 7.0.3
Version
1.3+git9-1.2
Expected behavior
Combustion picks up the passed script and executes it
Actual behavior
As stated, some VMware hypervisors provide guestinfo in OVF as a part of an xml, and they leave expected keys (guestinfo.combustion.script specifically, and others) empty. Thus, combustion does not pick up the scripts and skips passed configuration. The xml in question can be reliably acquired with
vmware-rpctool "info-get guestinfo.ovfenv"
(in fact, that's what ignition and cloud-init do).Reproduction
On VMware ESXI enroll a VM with terraform and specify guest_params. They will appear as such
Additional information
Here's an example of one such xml:
I guess it's important to mention, that I snipped a gzipped and base64 file content right there. Just the way it is currently performed, only in a different place
Honestly, I don't know if trying to parse an xml in pure bash is remotely a good idea. I guess it isn't tough to make and maintain a statically-linked binary xml-parser. Anyway, I'll be glad to assist in any way possible