Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Ignition not using guestinfo.coreos.config.data on ESXi #1627

Closed
UTAS-Nick-Howden opened this issue Oct 21, 2016 · 12 comments
Closed

Ignition not using guestinfo.coreos.config.data on ESXi #1627

UTAS-Nick-Howden opened this issue Oct 21, 2016 · 12 comments

Comments

@UTAS-Nick-Howden
Copy link

Issue Report

Using ovftool to deploy the coreos ova to an ESXi instance, it seems that passing an Ignition configuration via the guestinfo properties is not recognised by Ignition
--prop:guestinfo.coreos.config.data="${IGNITION}"
--prop:guestinfo.coreos.config.data.encoding=base64 \

Bug

CoreOS Version

NAME=CoreOS
ID=coreos
VERSION=1122.2.0
VERSION_ID=1122.2.0
BUILD_ID=2016-09-06-1449
PRETTY_NAME="CoreOS 1122.2.0 (MoreOS)"
ANSI_COLOR="1;32"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://github.com/coreos/bugs/issues"

Environment

ESXi
Version:1.4.0
Build number:3959074
ESXi version:6.0.0
ESXi build number:4192238

Expected Behavior

Ignition configures the network interface

Actual Behavior

Ignition reports
failed to fetch config: not a config (empty

Reproduction Steps

2 files attached that are used to deploy the ova
igntion_config
build_server.sh
coreos.zip

Other Information

A base64 encoded version of the ignition config is created by
IGNITION="base64 ignition_config"

The coreos image has been deployed using ovftool with the command ...
ovftool --X:injectOvfEnv --allowExtraConfig
--diskMode=thin
--datastore=${VM_DATASTORE}
--name=${VM_NAME}
--network="${VM_NETWORK}"
--viMemoryResource=${VM_MEMORY}
--prop:guestinfo.coreos.config.data="${IGNITION}"
--prop:guestinfo.coreos.config.data.encoding=base64
--X:waitForIp --powerOn
${DEPLOY_OVA} vi://${ESXI_USERNAME}:${ESXI_PASSWORD}@${ESXI_HOST}

Logging into the deployed coreos

journalctl --identifier=ignition

Oct 21 09:00:29 localhost ignition[238]: Ignition v0.8.0
Oct 21 09:00:29 localhost ignition[238]: config successfully fetched
Oct 21 09:00:29 localhost ignition[238]: failed to fetch config: not a config (empty)
Oct 21 09:00:29 localhost ignition[238]: not a config (empty): ignoring user-provided config
Oct 21 09:00:31 localhost ignition[403]: Ignition v0.8.0
Oct 21 09:00:31 localhost ignition[403]: config successfully fetched
Oct 21 09:00:31 localhost ignition[403]: failed to fetch config: not a config (empty)
Oct 21 09:00:31 localhost ignition[403]: not a config (empty): ignoring user-provided config

journalctl --identifier=coreos-cloudinit
Oct 21 09:00:39 localhost coreos-cloudinit[1038]: 2016/10/21 09:00:39 Read from "ovfenv": "\n<Environment\n xmlns="http://schemas.dmtf.org/ovf/envi
Oct 21 09:00:39 localhost coreos-cloudinit[1038]: 2016/10/21 09:00:39 Using OVF environment from guestinfo
Oct 21 09:00:39 localhost coreos-cloudinit[1038]: 2016/10/21 09:00:39 Checking availability of "vmware"
Oct 21 09:00:39 localhost coreos-cloudinit[1038]: 2016/10/21 09:00:39 Fetching user-data from datasource of type "vmware"
Oct 21 09:00:39 localhost coreos-cloudinit[1038]: 2016/10/21 09:00:39 Fetching meta-data from datasource of type "vmware"
Oct 21 09:00:39 localhost coreos-cloudinit[1038]: Detected an Ignition config. Exiting...

@crawford
Copy link
Contributor

Oct 21 09:00:31 localhost ignition[403]: not a config (empty): ignoring user-provided config
...
Oct 21 09:00:39 localhost coreos-cloudinit[1038]: Detected an Ignition config. Exiting...

Nice debugging. That is a strange result. My initial guess is that the guestinfo isn't available early enough for Ignition to read. We can test this by forcing Ignition to run a second time (this is going to break other things, but we'll do it just to test). After the first boot, run the following to reset the disk to the initial state and then reboot:

sudo sgdisk --disk-guid 00000000-0000-0000-0000-000000000001 /dev/sda

Ignition should then run a second time. If my theory is correct, it will work on this second pass.

@locca
Copy link

locca commented Nov 3, 2016

I am able to reproduce this issue on my ESXi environment too. And I tried the sgdisk command and reboot, it still didn't work.

@crawford
Copy link
Contributor

crawford commented Nov 3, 2016

Can you attach the logs for Ignition and coreos-cloudinit from that test?

@locca
Copy link

locca commented Nov 4, 2016

core@localhost ~ $ journalctl --identifier=ignition
-- Logs begin at Fri 2016-11-04 01:48:27 UTC, end at Fri 2016-11-04 02:29:45 UTC. --
Nov 04 01:48:29 localhost ignition[405]: Ignition v0.11.1
Nov 04 01:48:29 localhost ignition[405]: config successfully fetched
Nov 04 01:48:29 localhost ignition[405]: parsing config:
Nov 04 01:48:29 localhost ignition[405]: failed to fetch config: not a config (empty)
Nov 04 01:48:29 localhost ignition[405]: not a config (empty): ignoring user-provided config
Nov 04 01:48:29 localhost ignition[452]: Ignition v0.11.1
Nov 04 01:48:29 localhost ignition[452]: config successfully fetched
Nov 04 01:48:29 localhost ignition[452]: parsing config:
Nov 04 01:48:29 localhost ignition[452]: failed to fetch config: not a config (empty)
Nov 04 01:48:29 localhost ignition[452]: not a config (empty): ignoring user-provided config
core@localhost ~ $ journalctl --identifier=coreos-cloudinit
-- Logs begin at Fri 2016-11-04 01:48:27 UTC, end at Fri 2016-11-04 02:30:05 UTC. --
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Checking availability of "local-file"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Fetching user-data from datasource of type "local-file"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Fetching meta-data from datasource of type "local-file"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Parsing user-data as cloud-config
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Merging cloud-config from meta-data and user-data
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Writing file to "/etc/oem-release"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Wrote file to "/etc/oem-release"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Wrote file /etc/oem-release to filesystem
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Writing unit "vmtoolsd.service" to filesystem
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Writing file to "/etc/systemd/system/vmtoolsd.service"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Wrote file to "/etc/systemd/system/vmtoolsd.service"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Wrote unit "vmtoolsd.service"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Writing unit "oem-cloudinit.service" to filesystem
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Writing file to "/run/systemd/system/oem-cloudinit.service"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Wrote file to "/run/systemd/system/oem-cloudinit.service"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Wrote unit "oem-cloudinit.service"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Ensuring runtime unit file "oem-cloudinit.service" is unmasked
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 /run/systemd/system/oem-cloudinit.service is not null or empty, refusing to unmask
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Ensuring runtime unit file "etcd.service" is unmasked
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Ensuring runtime unit file "etcd2.service" is unmasked
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Ensuring runtime unit file "fleet.service" is unmasked
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Ensuring runtime unit file "locksmithd.service" is unmasked
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Calling unit command "start" on "vmtoolsd.service"'
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Result of "start" on "vmtoolsd.service": done
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Calling unit command "restart" on "oem-cloudinit.service"'
Nov 04 01:48:32 localhost coreos-cloudinit[1127]: 2016/11/04 01:48:32 Read from "ovfenv": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Environment\n     xmlns=\"http://schemas.dmtf.org/ovf/environment/1\"\n
Nov 04 01:48:32 localhost coreos-cloudinit[1127]:  oe:value=\"\"/>\n         <Property oe:key=\"guestinfo.interface.0.mac\" oe:value=\"\"/>\n         <Property oe:key=\"guestinfo.interface.0.name\" oe:value=
Nov 04 01:48:32 localhost coreos-cloudinit[1127]: 2016/11/04 01:48:32 Using OVF environment from guestinfo
Nov 04 01:48:32 localhost coreos-cloudinit[1127]: 2016/11/04 01:48:32 Checking availability of "vmware"
Nov 04 01:48:32 localhost coreos-cloudinit[1127]: 2016/11/04 01:48:32 Fetching user-data from datasource of type "vmware"
Nov 04 01:48:32 localhost coreos-cloudinit[1127]: 2016/11/04 01:48:32 Fetching meta-data from datasource of type "vmware"
Nov 04 01:48:32 localhost coreos-cloudinit[1127]: Detected an Ignition config. Exiting...
Nov 04 01:48:33 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Result of "restart" on "oem-cloudinit.service": done
core@localhost ~ $ journalctl --identifier=coreos-cloudinit
-- Logs begin at Fri 2016-11-04 01:48:27 UTC, end at Fri 2016-11-04 02:35:24 UTC. --
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Checking availability of "local-file"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Fetching user-data from datasource of type "local-file"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Fetching meta-data from datasource of type "local-file"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Parsing user-data as cloud-config
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Merging cloud-config from meta-data and user-data
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Writing file to "/etc/oem-release"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Wrote file to "/etc/oem-release"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Wrote file /etc/oem-release to filesystem
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Writing unit "vmtoolsd.service" to filesystem
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Writing file to "/etc/systemd/system/vmtoolsd.service"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Wrote file to "/etc/systemd/system/vmtoolsd.service"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Wrote unit "vmtoolsd.service"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Writing unit "oem-cloudinit.service" to filesystem
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Writing file to "/run/systemd/system/oem-cloudinit.service"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Wrote file to "/run/systemd/system/oem-cloudinit.service"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Wrote unit "oem-cloudinit.service"
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Ensuring runtime unit file "oem-cloudinit.service" is unmasked
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 /run/systemd/system/oem-cloudinit.service is not null or empty, refusing to unmask
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Ensuring runtime unit file "etcd.service" is unmasked
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Ensuring runtime unit file "etcd2.service" is unmasked
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Ensuring runtime unit file "fleet.service" is unmasked
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Ensuring runtime unit file "locksmithd.service" is unmasked
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Calling unit command "start" on "vmtoolsd.service"'
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Result of "start" on "vmtoolsd.service": done
Nov 04 01:48:32 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Calling unit command "restart" on "oem-cloudinit.service"'
Nov 04 01:48:32 localhost coreos-cloudinit[1127]: 2016/11/04 01:48:32 Read from "ovfenv": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Environment\n     xmlns=\"http://schemas.dmtf.org/ovf/environment/1\"\n
Nov 04 01:48:32 localhost coreos-cloudinit[1127]:  oe:value=\"\"/>\n         <Property oe:key=\"guestinfo.interface.0.mac\" oe:value=\"\"/>\n         <Property oe:key=\"guestinfo.interface.0.name\" oe:value=
Nov 04 01:48:32 localhost coreos-cloudinit[1127]: 2016/11/04 01:48:32 Using OVF environment from guestinfo
Nov 04 01:48:32 localhost coreos-cloudinit[1127]: 2016/11/04 01:48:32 Checking availability of "vmware"
Nov 04 01:48:32 localhost coreos-cloudinit[1127]: 2016/11/04 01:48:32 Fetching user-data from datasource of type "vmware"
Nov 04 01:48:32 localhost coreos-cloudinit[1127]: 2016/11/04 01:48:32 Fetching meta-data from datasource of type "vmware"
Nov 04 01:48:32 localhost coreos-cloudinit[1127]: Detected an Ignition config. Exiting...
Nov 04 01:48:33 localhost coreos-cloudinit[996]: 2016/11/04 01:48:32 Result of "restart" on "oem-cloudinit.service": done
-- Reboot --
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Checking availability of "local-file"
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Fetching user-data from datasource of type "local-file"
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Fetching meta-data from datasource of type "local-file"
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Parsing user-data as cloud-config
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Merging cloud-config from meta-data and user-data
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Writing file to "/etc/oem-release"
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Wrote file to "/etc/oem-release"
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Wrote file /etc/oem-release to filesystem
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Writing unit "vmtoolsd.service" to filesystem
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Writing file to "/etc/systemd/system/vmtoolsd.service"
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Wrote file to "/etc/systemd/system/vmtoolsd.service"
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Wrote unit "vmtoolsd.service"
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Writing unit "oem-cloudinit.service" to filesystem
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Writing file to "/run/systemd/system/oem-cloudinit.service"
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Wrote file to "/run/systemd/system/oem-cloudinit.service"
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Wrote unit "oem-cloudinit.service"
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Ensuring runtime unit file "oem-cloudinit.service" is unmasked
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 /run/systemd/system/oem-cloudinit.service is not null or empty, refusing to unmask
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Ensuring runtime unit file "etcd.service" is unmasked
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Ensuring runtime unit file "etcd2.service" is unmasked
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Ensuring runtime unit file "fleet.service" is unmasked
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Ensuring runtime unit file "locksmithd.service" is unmasked
Nov 04 02:11:36 localhost coreos-cloudinit[947]: 2016/11/04 02:11:36 Calling unit command "start" on "vmtoolsd.service"'
Nov 04 02:11:37 localhost coreos-cloudinit[947]: 2016/11/04 02:11:37 Result of "start" on "vmtoolsd.service": done
Nov 04 02:11:37 localhost coreos-cloudinit[947]: 2016/11/04 02:11:37 Calling unit command "restart" on "oem-cloudinit.service"'
Nov 04 02:11:37 localhost coreos-cloudinit[1074]: 2016/11/04 02:11:37 Read from "ovfenv": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Environment\n     xmlns=\"http://schemas.dmtf.org/ovf/environment/1\"\n
Nov 04 02:11:37 localhost coreos-cloudinit[1074]:  oe:value=\"\"/>\n         <Property oe:key=\"guestinfo.interface.0.mac\" oe:value=\"\"/>\n         <Property oe:key=\"guestinfo.interface.0.name\" oe:value=
Nov 04 02:11:37 localhost coreos-cloudinit[1074]: 2016/11/04 02:11:37 Using OVF environment from guestinfo
Nov 04 02:11:37 localhost coreos-cloudinit[1074]: 2016/11/04 02:11:37 Checking availability of "vmware"
Nov 04 02:11:37 localhost coreos-cloudinit[1074]: 2016/11/04 02:11:37 Fetching user-data from datasource of type "vmware"
Nov 04 02:11:37 localhost coreos-cloudinit[1074]: 2016/11/04 02:11:37 Fetching meta-data from datasource of type "vmware"
Nov 04 02:11:37 localhost coreos-cloudinit[1074]: Detected an Ignition config. Exiting...
Nov 04 02:11:37 localhost coreos-cloudinit[947]: 2016/11/04 02:11:37 Result of "restart" on "oem-cloudinit.service": done
-- Reboot --
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Checking availability of "local-file"
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Fetching user-data from datasource of type "local-file"
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Fetching meta-data from datasource of type "local-file"
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Parsing user-data as cloud-config
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Merging cloud-config from meta-data and user-data
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Writing file to "/etc/oem-release"
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Wrote file to "/etc/oem-release"
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Wrote file /etc/oem-release to filesystem
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Writing unit "vmtoolsd.service" to filesystem
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Writing file to "/etc/systemd/system/vmtoolsd.service"
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Wrote file to "/etc/systemd/system/vmtoolsd.service"
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Wrote unit "vmtoolsd.service"
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Writing unit "oem-cloudinit.service" to filesystem
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Writing file to "/run/systemd/system/oem-cloudinit.service"
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Wrote file to "/run/systemd/system/oem-cloudinit.service"
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Wrote unit "oem-cloudinit.service"
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Ensuring runtime unit file "oem-cloudinit.service" is unmasked
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 /run/systemd/system/oem-cloudinit.service is not null or empty, refusing to unmask
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Ensuring runtime unit file "etcd.service" is unmasked
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Ensuring runtime unit file "etcd2.service" is unmasked
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Ensuring runtime unit file "fleet.service" is unmasked
Nov 04 02:35:03 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:03 Ensuring runtime unit file "locksmithd.service" is unmasked
Nov 04 02:35:04 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:04 Calling unit command "start" on "vmtoolsd.service"'
Nov 04 02:35:04 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:04 Result of "start" on "vmtoolsd.service": done
Nov 04 02:35:04 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:04 Calling unit command "restart" on "oem-cloudinit.service"'
Nov 04 02:35:04 localhost coreos-cloudinit[1147]: 2016/11/04 02:35:04 Read from "ovfenv": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Environment\n     xmlns=\"http://schemas.dmtf.org/ovf/environment/1\"\n
Nov 04 02:35:04 localhost coreos-cloudinit[1147]:  oe:value=\"\"/>\n         <Property oe:key=\"guestinfo.interface.0.mac\" oe:value=\"\"/>\n         <Property oe:key=\"guestinfo.interface.0.name\" oe:value=
Nov 04 02:35:04 localhost coreos-cloudinit[1147]: 2016/11/04 02:35:04 Using OVF environment from guestinfo
Nov 04 02:35:04 localhost coreos-cloudinit[1147]: 2016/11/04 02:35:04 Checking availability of "vmware"
Nov 04 02:35:04 localhost coreos-cloudinit[1147]: 2016/11/04 02:35:04 Fetching user-data from datasource of type "vmware"
Nov 04 02:35:04 localhost coreos-cloudinit[1147]: 2016/11/04 02:35:04 Fetching meta-data from datasource of type "vmware"
Nov 04 02:35:04 localhost coreos-cloudinit[1022]: 2016/11/04 02:35:04 Result of "restart" on "oem-cloudinit.service": done
Nov 04 02:35:04 localhost coreos-cloudinit[1147]: Detected an Ignition config. Exiting...

@crawford
Copy link
Contributor

crawford commented Nov 4, 2016

I don't see Ignition's logs after the second boot. To be clear, what we are trying to test is whether or not the VMware hypervisor is taking so long to set the guestvariables that Ignition is unable to read them (since it runs first) but coreos-cloudinit is able (because it runs later).

The test sequence should be:

  1. Boot the machine
  2. Grab Ignition's logs and coreos-cloudinit's logs (journalctl --boot --identifier=coreos-cloudinit --identifier=ignition --no-pager). We should see Ignition warn about an empty config and coreos-cloudinit warn about an Ignition config.
  3. Reset the disk so that Ignition runs again (sudo sgdisk --disk-guid 00000000-0000-0000-0000-000000000001 /dev/sda)
  4. Reboot
  5. Grab Ignition's logs and coreos-cloudinit's logs (journalctl --boot --identifier=coreos-cloudinit --identifier=ignition --no-pager)

That last step is what I am most interested in seeing. If Ignition is able to read the config the second time around, it means that the hypervisor is to blame. If it's still unable to read the config, but coreos-cloudinit is able, then there is something wrong with Ignition.

@crawford
Copy link
Contributor

Closing due to inactivity.

@carlanton
Copy link

I have the exact same issue with esxi+ovftool+ignition, but it works as expected if I'm using cloud-config. I believe it's caused by the use of --X:injectOvfEnv to ovftool. When this flag is activated all guestinfo properties are located in guestinfo.ovfEnv and you need to parse XML to get the value of guestinfo.coreos.config.data. This is supported in https://github.com/coreos/coreos-cloudinit, but not in https://github.com/coreos/ignition which tries to read the property directly: https://github.com/coreos/ignition/blob/master/internal/providers/vmware/vmware_amd64.go#L38

InjectOvfEnv seems to be required when you are running ovftool without vCenter:

… you MUST use the ‘--X:injectOvfEnv’ debug option with the ‘--poweron’ option in the command line if you are deploying a virtual machine from ESXi

Source: https://www.vmware.com/support/developer/ovf/ovf400/ovftool-400-userguide.pdf

@carlanton
Copy link

Okay, so apparently there is another way of doing this with ovftool which works with Ignition. Instead of using --X:injectOvfEnv, you can set guestinfo properties directly with --X:guest. This works for me with ovftool 4.2 and ESXi 6.5:

ovftool \
        -ds="datastore1" \
        --name="${NAME}" \
        --net:"VM Network=vm-trunk" \
        --X:guest:"coreos.config.data=$(base64 -w0 ignition.json)" \
        --X:guest:"coreos.config.data.encoding=base64" \
        --powerOn \
        coreos_production_vmware_ova.ova \
        "vi://user:password@esxi"

@crawford crawford reopened this Feb 3, 2017
@crawford
Copy link
Contributor

crawford commented Feb 3, 2017

Awesome findings. I'll have to add this to our documentation.

@moserke
Copy link

moserke commented Mar 27, 2017

Has anyone done this with terraform? I am using the custom_configuration_parameters on the VM in terraform but on first boot ignition is not run. If I do the disk reset and reboot I see ignition getting run. Was just curious if anyone had been able to get ignition to work with terraform.

@carlanton
Copy link

I've documented how we use ignition with ovftool over here: http://anton.lindstrom.io/coreos-on-esxi/

@crawford
Copy link
Contributor

This was actually just fixed by coreos/ignition#384. Once we tag a new version of Ignition and include it in the OS, OVF guest variables will work out of the box.

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

No branches or pull requests

5 participants