coreos / bugs

Issue tracker for CoreOS Container Linux
https://coreos.com/os/eol/
147 stars 30 forks source link

Ignition is broken on coreos-vagrant (VirtualBox) #2264

Open cl-ment opened 6 years ago

cl-ment commented 6 years ago

Issue Report

Bug

Container Linux Version

$ cat /etc/os-release
NAME="Container Linux by CoreOS"
ID=coreos
VERSION=1590.0.0
VERSION_ID=1590.0.0
BUILD_ID=2017-11-08-0831
PRETTY_NAME="Container Linux by CoreOS 1590.0.0 (Ladybug)"
ANSI_COLOR="38;5;75"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://issues.coreos.com"
COREOS_BOARD="amd64-usr"

Environment

Vagrant on Virtualbox

Expected Behavior

Ignition must do something according to the configuration file config.ign found in the vagrant directory.

Actual Behavior

Ignition fails to fetch the startup configuration on coreos-vagrant

core@core-01 ~ $ journalctl --all
-- Logs begin at Thu 2017-11-23 08:16:02 UTC, end at Thu 2017-11-23 08:17:06 UTC. --
Nov 23 08:16:02 localhost kernel: Linux version 4.14.0-rc8-coreos (jenkins@jenkins-worker-2) (gcc version 4.9.4 (Gentoo Hardened 4.9.4 p1.0, pie-0.6.4)) #1 SMP Wed Nov 8 08:09:32 UTC 2017
Nov 23 08:16:02 localhost kernel: Command line: BOOT_IMAGE=/coreos/vmlinuz-a mount.usr=/dev/mapper/usr verity.usr=PARTUUID=7130c94a-213a-4e5a-8e26-6cce9662f132 rootflags=rw mount.usrflags=ro consoleblank=0 root=LABEL=ROOT console=ttyS0,115200n8 console=tty0 coreos.first_boot=detected coreos.randomize_disk_guid=00000000-0000-0000-0000-000000000001 coreos.oem.id=vagrant verity.usrhash=fdbfb3605c256bc41f7270fe4b688d2cfbbe2f12c1729ddcb3f7517b9749bf48
[...]
Nov 23 08:16:04 localhost ignition[363]: Ignition v0.19.0
Nov 23 08:16:04 localhost ignition[363]: parsed url from cmdline: ""
Nov 23 08:16:04 localhost ignition[363]: no config URL provided
Nov 23 08:16:04 localhost ignition[363]: noop provider fetching empty config
Nov 23 08:16:04 localhost ignition[363]: failed to fetch config: not a config (empty)
Nov 23 08:16:04 localhost ignition[363]: not a config (empty): ignoring user-provided config
Nov 23 08:16:04 localhost ignition[363]: disks: op(1): [started]  waiting for udev to settle
Nov 23 08:16:04 localhost ignition[363]: disks: op(1): executing: "/bin/udevadm" "settle"
Nov 23 08:16:04 localhost ignition[363]: disks: op(1): [finished] waiting for udev to settle

Reproduction Steps

  1. git clone https://github.com/coreos/coreos-vagrant.git
  2. cp config.ign.sample config.ign
  3. vagrant up

Other Information

It looks like Ignition expects coreos.oem.id=vagrant-virtualbox or coreos.oem.id=virtualbox instead of coreos.oem.id=vagrant on the kernel commad line in order to fetch the configuration properly.

We can see this in https://github.com/coreos/ignition/blob/master/internal/oem/oem.go

    configs.Register(Config{
        name:  "vagrant",
        fetch: noop.FetchConfig,
    })
    configs.Register(Config{
        name:  "vagrant-virtualbox",
        fetch: virtualbox.FetchConfig,
    })
    configs.Register(Config{
        name:  "virtualbox",
        fetch: virtualbox.FetchConfig,
    })

You might want to change the parameter oem_id in /usr/share/oem/grub.cfg on the box to one of those mentioned above:

core@core-01 /usr/share/oem $ cat grub.cfg
# CoreOS GRUB settings

set oem_id="vagrant"
lucab commented 6 years ago

Thanks for the report. I think this was initially done via https://github.com/coreos/ignition/pull/402, but the overall migration is currently on hold as described in https://github.com/coreos/ignition/pull/460#issuecomment-332311647. I don't have more details at hand right now, but perhaps @bgilbert will chime in later.

lucab commented 6 years ago

Also related to https://github.com/coreos/bugs/issues/2238.

damianoneill commented 6 years ago

@lucab when you say 'overall migration is currently on hold' is there a target for when this will be fixed?

Thanks.

bgilbert commented 6 years ago

@damianoneill I'd like it to happen soon, but can't make any promises at the moment.

damianoneill commented 6 years ago

Thanks @bgilbert appreciate the update.

apeteri commented 6 years ago

Any news on this issue? Setting the box URL to .../coreos_production_vagrant_virtualbox.json per the latest version of Vagrantfile seems to work; the OEM ID is set to vagrant-virtualbox in the kernel command line.

webhive commented 6 years ago

+1

wernerb commented 6 years ago

@apeteri When I look at the referenced Vagrantfile, the box url you mention is the same? What exactly did you change to the Vagrantfile?

collinkrawll commented 6 years ago

This seems to be fixed on the alpha channel. I was running on stable (currently version 1800.5.0) and my config failed to load. I switched my Vagrantfile to use the alpha channel (currently version 1855.0.0) and it started working.

While on the stable channel, the oem_id variable in my /usr/share/oem/grub.cfg was set to "vagrant" (this failed). After switching to the alpha channel, it is now set to "vagrant-virtualbox" and everything works.

karmux commented 6 years ago

I can confirm that Ignition works with 1855.0.0 version of coreos_production_vagrant_virtualbox.json box that https://github.com/coreos/coreos-vagrant.git is using.

Doesn't work with 1855.0.0 version of coreos_production_vagrant.json box.

apeteri commented 6 years ago

@wernerb I had an old Vagrantfile around at the time; it still pointed to a box URL without the _virtualbox suffix.