Skip to content

Comments

Fix VMware guestinfo variable retrieval and add the missing *.config.url variable#11

Merged
pothos merged 1 commit intoflatcar-masterfrom
kai/fix-vmware-guestinfo
Apr 17, 2020
Merged

Fix VMware guestinfo variable retrieval and add the missing *.config.url variable#11
pothos merged 1 commit intoflatcar-masterfrom
kai/fix-vmware-guestinfo

Conversation

@pothos
Copy link
Member

@pothos pothos commented Apr 7, 2020

  • VMware: Fix guestinfo.*.config.data variable retrieval
    The decision whether to use ignition.config.data or coreos.config.data
    was based on their presence in ovfenv. If this was missing, coreos.config.data
    would always be used. Also, if the retrieval of the guestinfo would have an error,
    the value from ovfenv would not be used even though it was supposed to be a fallback.
    Refactor the logic to get variables from the ovfenv as fallback while preferring the
    direct guestinfo variables. With this new function, fix the logic of falling back to
    coreos.config.data but preferring ignition.config.data.
  • VMware: Add support for *.config.url which was missing
    The OVF metadata for CoreOS specified guestinfo.coreos.config.url but that was
    never used to fetch the Ignition config.
    Use guestinfo.*.config.url as fallback if no guestinfo.*.config.data variables are set.

How to use

Enter an SDK and point the Ignition ebuild to this commit.
Then build the image:

$ emerge-amd64-usr -1 ignition
$ emerge-amd64-usr -1 coreos-kernel
$ ./build_image
$ ./image_to_vm.sh … --format=vmware_ova

Create a VM from the image in, e.g., VMware ESXi via ovftool and via the web UI. Either specify the coreos.config.url or ignition.config.url variable to point to an Ignition file served via HTTP, or specify coreos.config.data and coreos.config.data.encoding or ignition.config.data and ignition.config.data.encoding (a valid encoding is, e.g., base64 with the data being converted via cat ignition.json | base64 --wrap=0).

Testing done

Tested locally and on ESXi.

I will also file an upstream PR if possible (but upstream master does not have fallback to coreos* variables).

@pothos pothos requested a review from a team April 7, 2020 16:13
@pothos pothos marked this pull request as ready for review April 8, 2020 14:59
The decision whether to use ignition.config.data or coreos.config.data
was based on their presence in ovfenv. If this was missing, coreos.config.data
would always be used. Also, if the retrieval of the guestinfo would have an error,
the value from ovfenv would not be used even though it was supposed to be a fallback.
Thus, refactor the logic to get variables from the ovfenv as fallback while preferring the
direct guestinfo variables. With this new function, fix the logic of falling back to
coreos.config.data but preferring ignition.config.data.

The OVF metadata for CoreOS specified guestinfo.coreos.config.url but that was
never used to fetch the Ignition config.
Thus, use guestinfo.*.config.url as fallback if no guestinfo.*.config.data variables are set.
@pothos pothos force-pushed the kai/fix-vmware-guestinfo branch from d334aab to 380801d Compare April 17, 2020 12:16
pothos added a commit to flatcar/scripts that referenced this pull request Apr 17, 2020
There was a logical mistake in Ignition that caused ignition.config.*
only to work when it was part of the ovfenv. Thus they were added but
the old CoreOS variables marked deprecated and kept. With both as OVF
variables each of them worked but directly specifying ignition.config.*
as guest variable still didn't because of the logical mistake.
Now there is a fix and both work well when specified directly as guest
variable (flatcar/ignition#11).
Delete the old CoreOS OVF variables because they just clutter the UI
and only the Ignition variables should be used in the UI.
pothos added a commit to flatcar/scripts that referenced this pull request Apr 17, 2020
There was a logical mistake in Ignition that caused ignition.config.*
only to work when it was part of the ovfenv. Thus they were added but
the old CoreOS variables marked deprecated and kept. With both as OVF
variables each of them worked but directly specifying ignition.config.*
as guest variable still didn't because of the logical mistake.
Now there is a fix and both work well when specified directly as guest
variable (flatcar/ignition#11).
Delete the old CoreOS OVF variables because they just clutter the UI
and only the Ignition variables should be used in the UI.
pothos added a commit to flatcar/scripts that referenced this pull request Apr 17, 2020
There was a logical mistake in Ignition that caused ignition.config.*
only to work when it was part of the ovfenv. Thus they were added but
the old CoreOS variables marked deprecated and kept. With both as OVF
variables each of them worked but directly specifying ignition.config.*
as guest variable still didn't because of the logical mistake.
Now there is a fix and both work well when specified directly as guest
variable (flatcar/ignition#11).
Delete the old CoreOS OVF variables because they just clutter the UI
and only the Ignition variables should be used in the UI.
pothos added a commit to flatcar/scripts that referenced this pull request Apr 17, 2020
There was a logical mistake in Ignition that caused ignition.config.*
only to work when it was part of the ovfenv. Thus they were added but
the old CoreOS variables marked deprecated and kept. With both as OVF
variables each of them worked but directly specifying ignition.config.*
as guest variable still didn't because of the logical mistake.
Now there is a fix and both work well when specified directly as guest
variable (flatcar/ignition#11).
Delete the old CoreOS OVF variables because they just clutter the UI
and only the Ignition variables should be used in the UI.
@pothos pothos merged commit fb5031b into flatcar-master Apr 17, 2020
@pothos pothos deleted the kai/fix-vmware-guestinfo branch April 17, 2020 15:07
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Apr 17, 2020
Pulls in flatcar/ignition#11 to fix VMware
guestinfo variable retrieval and add the missing *.config.url variable.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Apr 17, 2020
Pulls in flatcar/ignition#11 to fix VMware
guestinfo variable retrieval and add the missing *.config.url variable.
@neilmayhew
Copy link

Thank you!

pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Apr 17, 2020
Pulls in flatcar/ignition#11 to fix VMware
guestinfo variable retrieval and add the missing *.config.url variable.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Apr 17, 2020
Pulls in flatcar/ignition#11 to fix VMware
guestinfo variable retrieval and add the missing *.config.url variable.
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Apr 17, 2020
Pulls in flatcar/ignition#11 to fix VMware
guestinfo variable retrieval and add the missing *.config.url variable.
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

Successfully merging this pull request may close these issues.

3 participants