openSUSE / combustion

Configure MicroOS on the first boot
GNU General Public License v2.0
14 stars 7 forks source link

Enable OVF datasource for VMware #24

Open zinstack625 opened 4 weeks ago

zinstack625 commented 4 weeks ago

This addresses #23

Some VMware hypervisors, such as ESXi 7, place user-provided parameters (e.g. user-data for cloud-init) in an XML property available at "guestinfo.ovfenv" key in vmware-rpctool. In that case, any user-provided key in "guestinfo.*" will remain unpopulated and trying to access it will result in a missing key. It is possible to handle such cases by additionally checking mentioned "guestinfo.ovfenv" if first method fails, and parsing the xml afterwards

Proposed change has been verified to work in my case of passing parameters in ovfenv. I don't know where the rpm spec for combustion resides, but it seems like a good idea to place libxml2-utils in dependencies there

Vogtinator commented 4 weeks ago

LGTM. I'd still like to know why this isn't set properly, might be a bug in whatever tool is responsible.

zinstack625 commented 4 weeks ago

Don't think it's a bug, they just do it differently on different hypervisors I guess. I just see the consequences to be honest and have no knowledge of the cause. But cloud-init does indeed have VMware and OVF as two different datasources: VMware and OVF. Also, looking a bit closer, ignition may just support OVF and not plain guestinfo.

To my knowledge, OVF is from VMware and AFAIK is only used by VMware. If there is a point at which and if they switched from one to another, I cannot find it neither in docs, nor in broader internet, Broadcom acquision does not help one bit here

Vogtinator commented 4 weeks ago

To my knowledge, OVF is from VMware and AFAIK is only used by VMware.

Some other hypervisor platforms like XenServer and libvirt support OVA/OVF import as well, but no idea about guestinfo.

If there is a point at which and if they switched from one to another, I cannot find it neither in docs, nor in broader internet, Broadcom acquision does not help one bit here

Yeah, I'm wondering if it's even worth it to add more VMware support if it's probably gone in the not so far future anyway...

zinstack625 commented 4 weeks ago

Some other hypervisor platforms like XenServer and libvirt support OVA/OVF import as well, but no idea about guestinfo.

I think xen uses qemu for firmware and host-guest communication, so probably the same as that, but haven't tried that

Yeah, I'm wondering if it's even worth it to add more VMware support if it's probably gone in the not so far future anyway...

Why not? I doubt it'll completely evaporate in a couple months or even a year. It's not like it requires active maintenance or influences any code besides VMware-related parts. If there will be any incentive to deprecate VMware, nothing will break. Besides, whatever Broadcom is doing to VMware, saying that it will disappear is still speculation

zinstack625 commented 4 weeks ago

Just found a syntax error, bash is not exactly my forte. Nothing significant, just that conditions need some body and I totally forgot that