coreos / ignition

First boot installer and configuration tool
https://coreos.github.io/ignition/
Apache License 2.0
835 stars 245 forks source link

Ignition on Windows VirtualBox failed #1849

Open polachz-nxp opened 5 months ago

polachz-nxp commented 5 months ago

test.ign.gz

Bug

Operating System Version

fedora-coreos-39.20240309.3.0

Ignition Version

2.17.0

Environment

Running CoreOS as .ova VM template on Windows VirtualBox 7.0.14

Expected Behavior

Correct VM deployment

Actual Behavior

Ignition failed:

Displaying logs from failed units: sysroot.mount
ignition-fetch-offline.service
Apr 08 13:05:36 systemd[1]: sysroot.mount: Failed to load environment files: No such file or directory
Apr 08 13:05:36 systemd[1]: sysroot.mount: Failed to run 'mount' task: No such file or directory
Apr 08 13:05:36 systemd[1]: sysroot.mount: Failed with result 'resources'.
Apr 08 13:05:36 systemd[1]: Failed to mount sysroot.mount - /sysroot.
Apr 08 13:05:36 ignition[646]: no config at "/usr/lib/ignition/user.ign"
Apr 08 13:05:36 systemd[1]: ignition-fetch-offline.service: Failed with result 'exit-code'.
Apr 08 13:05:36 ignition[646]: reading Ignition config from VirtualBox guest property
Apr 08 13:05:36 systemd[1]: Failed to start ignition-fetch-offline.service - Ignition (fetch-offline).
Apr 08 13:05:36 ignition[646]: parsing config with SHA512: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Apr 08 13:05:36 ignition[646]: error at line 1 col 3: invalid character 'i' looking for beginning of object key string
Apr 08 13:05:36 ignition[646]: failed to fetch config: config is not valid
Apr 08 13:05:36 ignition[646]: failed to acquire config: config is not valid
Apr 08 13:05:36 ignition[646]: Ignition failed: config is not valid
Apr 08 13:05:36 systemd[1]: ignition-fetch-offline.service: Triggering OnFailure= dependencies.

Reproduction Steps

  1. Use ignition file (attached as test.ign)
  2. Dump it to cmd.exe variable: set /p ignit=<c:\test.ign
  3. Set property: VBoxManage guestproperty set fcos /Ignition/Config %ignit%
  4. Run VM. VM ignition failed

Other Information

Here is output of guestproperty get for verification:

''' C:\Users\xxxx>VBoxManage guestproperty get fcos /Ignition/Config Value: {ignition:{version:3.4.0},passwd:{users:[{name:core,sshAuthorizedKeys:[ecdsa-sha2-nistp384 XXXXE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBEpNUIlPBZW6HWAPaN7EnQ4i/91kIP4GRd+GctJqWIHB/3nFNhTcFb+9zTgzlcXfQhgd8S0XXXXXt3QXAHF+H4RUt0/TTcGyIlv0Mp69bRwLC0PnqfdeZZ/nix+xw6+bmw== main-ssh]}]},storage:{files:[{path:/etc/hostname,contents:{compression:,source:data:,fcos-test%0A},mode:420},{path:/etc/profile.d/systemd-pager.sh,contents:{compression:,source:data:,%23%20Tell%20systemd%20to%20not%20use%20a%20pager%20when%20printing%20information%0Aexport%20SYSTEMD_PAGER%3Dcat%0A},mode:420}]}} '''

I'm not able to verify how the ignition reads config inside the VM, because seems that it's not cached everywhere, just memory stream is used (analyzed source code). But seems that the ignition is corrupted by some way.

I have tried also to set the property value directly:

''' VBoxManage guestproperty set fcos /Ignition/Config "{ignition:{version:3.4.0},passwd:{users:[{name:core,sshAuthorizedKeys:[ecdsa-sha2-nistp384 XXXXE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBEpNUIlPBZW6HWAPaN7EnQ4i/91kIP4GRd+GctJqWIHB/3nFNhTcFb+9zTgzlcXfQhgd8S0XXXXXt3QXAHF+H4RUt0/TTcGyIlv0Mp69bRwLC0PnqfdeZZ/nix+xw6+bmw== main-ssh]}]},storage:{files:[{path:/etc/hostname,contents:{compression:,source:data:,fcos-test%0A},mode:420},{path:/etc/profile.d/systemd-pager.sh,contents:{compression:,source:data:,%23%20Tell%20systemd%20to%20not%20use%20a%20pager%20when%20printing%20information%0Aexport%20SYSTEMD_PAGER%3Dcat%0A},mode:420}]}}" '''

but result is completely same