[Openstack] Metadata and File Injection

Scott Moser smoser at ubuntu.com
Fri Dec 16 15:14:29 UTC 2011

On Fri, 16 Dec 2011, John Garbutt wrote:

> One use case is providing metadata to an instance before that instance
> starts their network stack. A bit of an edge case, but I guess one
> instance of this use case is the network injection logic used for Flat
> networking.
> Would injected files cover the above case? Would it still work after the
> proposed changes?
> I guess it should work, assuming nova injects the files in the same way
> it does for injecting network configuration, rather than relying on the
> agent to write the files once the system has booted by getting data from
> the metadata service.
> Maybe this is what the configuration drive could be used for (assuming
> either the agent isn't responsible for correctly mounting the
> configuration drive, or it can mount the disk before it has access to
> any network)?

I think it is reasonable to inject static networking configuration via
configuration drive.  It could even be re-named
"network-configuration-drive" if there is seen to be no other use for it.

I'd add code to cloud-init for ubuntu configuration based on that. I've
been meaning to get around to it anyway, I just haven't done it.  I think
it would be quite clean to do logic on boot like:
 * if a scan of block devices shows one labeled "netconfig"
 * mount that (iso9660 or vfat) filesystem, read /config file in its root
 * modify /etc/network/interfaces accordingly
 * continue on with boot.

The only issue above that there is nothing that guarantees that the config
drive volume is going to be present at the instant in boot when I start
looking (it may just not have shown up yet on the scsi bus or whatever).
If its not there, and cloud-init goes on with life it may expose a race.
I'd have to think about that more.

More information about the Openstack mailing list