Repository navigation
Description
Ignition currently supports a virtualbox provider, which reads straight JSON bytes from a well-known GPT partition: https://github.com/coreos/ignition/blob/v0.28.0/internal/providers/virtualbox/virtualbox.go
This means that at the injection site (e.g. vagrant-virtualbox) we have a bunch of logic to handcraft a raw GPT disk: https://github.com/coreos/vagrant-ignition/blob/v0.0.1/lib/vagrant-ignition/action/IgnitionDiskGenerator.rb
However, virtualbox already provides an HostService to exchange node properties between host<->guest, which can be used from the guest to consume host-provided userdata: https://www.virtualbox.org/browser/vbox/trunk/src/VBox/HostServices/GuestProperties/service.cpp
Those can be directly managed via VBoxManage guestproperty: http://underpop.online.fr/v/virtualbox/vboxmanage-guestproperty-virtualbox.html
At the same time, another point is that the guest-property can also be used to report back provisioning status (outside the scope of this ticket, but nice).
The main problem I see is that property values are currently limited to 128 bytes: https://www.virtualbox.org/browser/vbox/trunk/include/VBox/HostServices/GuestPropertySvc.h?rev=71010#L40
It would be good to investigate:
- whether vbox upstream would be ok taking a patch to enlarge that size to something slightly larger (e.g. 16KiB like the AWS limit)
- whether there is already a good away to consume this from userspace or if we need additional features in kernel guest drivers (i.e. recent Linux
VBOXGUEST) - whether it makes sense to implement and use this in ignition (e.g. to get rid of udev settling races)
Activity
ajeddeloh commentedon Sep 11, 2018
I fully agree this is worth investigating.
lucab commentedon Feb 12, 2019
Late followup with a datapoint provided by @crawford: a typical Ignition config for a self-bootstrapping kubernetes node is >100KiB. A larger
guestpropertywould work initially but probably won't solve all usecases.A different path to explore could be custom DMI OEM content, similar to #656.
VirtualBox seems to support this via the
setextradataverb: https://www.virtualbox.org/manual/ch09.html#changedmi.In this specific case, VirtualBox only supports x86 guests, so the lack of portability to other platforms isn't a concern. I don't know if there are other key-naming or value-size limitations, though.
bgilbert commentedon Feb 12, 2019
The DMI approach is worth exploring. It's unfortunate that there are separate extradata keys for BIOS and UEFI, though.
jlebon commentedon Jun 8, 2020
Possibly relevant here: #928 (comment). Haven't checked yet though whether VirtualBox supports specifying the disk serial to
ignition.bgilbert commentedon Oct 9, 2021
A custom OEM string doesn't help much here, since VirtualBox limits DMI tables to 768 bytes (
VBOX_DMI_TABLE_SIZE). Also, thesetextradatacommands in the docs are not examples; they're a complete list of the supported fields. It's true that we could encourage users to setVBoxInternal/Devices/pcbios/0/Config/DmiOEMVBoxVeror.../DmiOEMVBoxRev, since API strings aren't key-value pairs anyway, but it doesn't feel like a clean use of the API.Guest properties are the official VirtualBox mechanism for host-guest communication, so it'd be nice to use them if possible — and it seems there's no longer a 128-byte limit on property values. The original implementation used fixed-size 128-byte buffers, and a couple call sites still do, but the guest property service no longer imposes that limit and I think it hasn't since r21629 in 2009. #1269 implements Ignition config access via a guest property.