Skip to content

Commit

Permalink
[build] Add named configuration for public cloud environments
Browse files Browse the repository at this point in the history
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 <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Jan 18, 2016
1 parent 8af8886 commit cc25260
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 0 deletions.
7 changes: 7 additions & 0 deletions 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
Empty file added src/config/cloud/colour.h
Empty file.
31 changes: 31 additions & 0 deletions 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
Empty file added src/config/cloud/crypto.h
Empty file.
Empty file added src/config/cloud/general.h
Empty file.
Empty file added src/config/cloud/serial.h
Empty file.
Empty file added src/config/cloud/settings.h
Empty file.
Empty file added src/config/cloud/sideband.h
Empty file.
Empty file added src/config/cloud/usb.h
Empty file.

0 comments on commit cc25260

Please sign in to comment.