On 03/15/11 - 05:05:24PM, David Lutterkort wrote:
On Tue, 2011-03-15 at 14:46 -0400, Chris Lalancette wrote:
On 03/15/11 - 01:35:53PM, Ian Main wrote:
- We believe we can arrange to pass a small snippet of config data
in at launch time, to point a booting instance at some source of further config.
Kernel boot params, yes.
Note that this won't work. In general, you can't add kernel boot params to a guest, because we don't direct-boot the kernel. We boot the emulated BIOS, which calls grub, which calls the kernel.
Luckily there is a workaround. We can stuff some data into the SMBIOS tables during launch time, and use that as our injection mechanism instead.
There's also door #3, which would be hugely preferrable from an API POV: using kpartx^W libguestfs to directly inject files into the image. This is the approach Rackspace takes; IOW, we wouldn't introduce yet another paradigm of how to inject user data into an instance.
Not to go too far off into the weeds, but I was under the impression that Rackspace does it by passing kargs while booting (presumably they are doing Xen PV direct-kernel boot, so this should be possible for them).
Regardless, I actually think that "crack open image, insert file" is a tactic that works, but should only be used if there is no other way to inject data. That is, I don't see why it would be preferable to modify the image rather than use something like SMBIOS (as John points out elsewhere, we'll only need some number of bytes to be passed along).