From cc252605ce9e0e224fbc34f946b80e90d012dc42 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 18 Jan 2016 08:37:27 +0000 Subject: [build] Add named configuration for public cloud environments Add a named CONFIG=cloud configuration, which enables console types useful for obtaining output from virtual machines in public clouds such as AWS EC2. An image suitable for use in AWS EC2 can be built using make bin/ipxe.usb CONFIG=cloud EMBED=config/cloud/aws.ipxe The embedded script will direct iPXE to download and execute the EC2 "user-data" file, which is always available to an EC2 VM via the URI http://169.254.169.254/latest/user-data (regardless of the VPC networking settings). The boot can therefore be controlled by modifying the per-instance user data, without having to modify the boot disk image. Console output can be obtained via syslog (with a syslog server configured in the user-data script), via the AWS "System Log" (after the instance has been stopped), or as a last resort from the log partition on the boot disk. Signed-off-by: Michael Brown --- src/config/cloud/aws.ipxe | 7 +++++++ src/config/cloud/colour.h | 0 src/config/cloud/console.h | 31 +++++++++++++++++++++++++++++++ src/config/cloud/crypto.h | 0 src/config/cloud/general.h | 0 src/config/cloud/serial.h | 0 src/config/cloud/settings.h | 0 src/config/cloud/sideband.h | 0 src/config/cloud/usb.h | 0 9 files changed, 38 insertions(+) create mode 100644 src/config/cloud/aws.ipxe create mode 100644 src/config/cloud/colour.h create mode 100644 src/config/cloud/console.h create mode 100644 src/config/cloud/crypto.h create mode 100644 src/config/cloud/general.h create mode 100644 src/config/cloud/serial.h create mode 100644 src/config/cloud/settings.h create mode 100644 src/config/cloud/sideband.h create mode 100644 src/config/cloud/usb.h (limited to 'src/config') diff --git a/src/config/cloud/aws.ipxe b/src/config/cloud/aws.ipxe new file mode 100644 index 00000000..d857d71d --- /dev/null +++ b/src/config/cloud/aws.ipxe @@ -0,0 +1,7 @@ +#!ipxe + +echo Amazon EC2 - iPXE boot via user-data +ifstat || +dhcp || +route || +chain -ar http://169.254.169.254/latest/user-data diff --git a/src/config/cloud/colour.h b/src/config/cloud/colour.h new file mode 100644 index 00000000..e69de29b diff --git a/src/config/cloud/console.h b/src/config/cloud/console.h new file mode 100644 index 00000000..dae18e55 --- /dev/null +++ b/src/config/cloud/console.h @@ -0,0 +1,31 @@ +/* + * Console configuration suitable for use in public cloud + * environments, or any environment where direct console access is not + * available. + * + */ + +/* Log to syslog(s) server + * + * The syslog server to be used must be specified via e.g. + * "set syslog 192.168.0.1". + */ +#define CONSOLE_SYSLOG +#define CONSOLE_SYSLOGS + +/* Log to serial port + * + * Note that the serial port output from an AWS EC2 virtual machine is + * generally available (as the "System Log") only after the instance + * has been stopped. + */ +#define CONSOLE_SERIAL + +/* Log to partition on local disk + * + * If all other log mechanisms fail then the VM boot disk containing + * the iPXE image can be detached and attached to another machine in + * the same cloud, allowing the log to be retrieved from the log + * partition. + */ +#define CONSOLE_INT13 diff --git a/src/config/cloud/crypto.h b/src/config/cloud/crypto.h new file mode 100644 index 00000000..e69de29b diff --git a/src/config/cloud/general.h b/src/config/cloud/general.h new file mode 100644 index 00000000..e69de29b diff --git a/src/config/cloud/serial.h b/src/config/cloud/serial.h new file mode 100644 index 00000000..e69de29b diff --git a/src/config/cloud/settings.h b/src/config/cloud/settings.h new file mode 100644 index 00000000..e69de29b diff --git a/src/config/cloud/sideband.h b/src/config/cloud/sideband.h new file mode 100644 index 00000000..e69de29b diff --git a/src/config/cloud/usb.h b/src/config/cloud/usb.h new file mode 100644 index 00000000..e69de29b -- cgit v1.2.3-55-g7522