On Wed, Mar 29, 2017 at 10:18:36AM -0700, Zach Marano wrote:
>    Yeah I guess I'm asking what the official Debian cloud image build process
>    is looking like (or if its been started at all).

The current FAI config has at least some support for GCE, but
unfortunately I don't think anybody has done any meaningful work on the
it since November. I've done a fair bit of work on generic image content
and some AWS details, and am currently working on more complete
automation around the build process. This same work will need to be
adapted to GCE/Azure/etc, but that really shouldn't be very difficult
for somebody familiar with the services and their APIs. 

I've attached a short writup of the tool that I'm currently thinking
about. My intent is to build it in such a way that support for
additional platforms can be added relatively easily, but if nobody else
is working on these platforms I may cut some corners initially.

Alternatively, if someone want to start hacking on GCE support in the
FAI configs without waiting for that whole tool to exist, you can start
by reading my blog post on using FAI to generate AWS images and adapting
it for GCE. Simply replacing occurrances of EC2 with GCE in the FAI
class lists will likely get you a long way toward generating basic
images. 

https://noah.meyerhans.us/blog/2017/02/10/using-fai-to-customize-and-build-your-own-cloud-images/

You'll likely want to implement a GCE version of the AMI registration
script if you do that:

https://anonscm.debian.org/cgit/cloud/fai-cloud-images.git/tree/volume-to-ami.sh

noah

# Debian FAI Cloud Image Builder

## Synopsis

./generate-image CONFIGFILE

## Description

This tool is intended to be used to generate official and unofficial
(Derivative, Custom, etc) Debian AMIs for use on AWS.

In order to accomplish this, the tool performs the following steps:

1. Launch an EC2 instance with the following properties:
  * Instance has a public IP mapped to it.
  * Instance's security group permits ssh access.
  * Instance is configured with a cloud-init userdata script (see below).
  * Instance has a secondary EBS volume attached.
2. Run FAI to generate a disk image.
3. 'dd' the disk image to the attached EBS volume.
4. Snapshot the EBS volume.
5. Register the snapshot as an AMI.
6. Perform validation steps on the AMI.
7. Publish the AMI to supported AWS regions.
8. Mark the AMI as public.

The workflow may split AMI creation, validation, and publication into
discrete steps if we want to require manual confirmation before proceding.

## Configuration

Configuration of this tool is performed via configuration files; there are
no command-line options. Configuration files use the YAML syntax and
consist of three sections:

1. AWS Global configuration:
  * What AWS profile to use?
  * What region to run it?
2. Instance configuration:
  * Security group and subnet.
  * ssh keypair name
  * Instance type
  * AMI ID
3. Image configuration:
  * Git repository and commit ID for FAI configuration.
  * FAI class list.

## See also

## Author

## Copyright

Reply via email to