Eucalyptus Affected Versions: 3.1.0 and Greater
(Note: There are some bugs that are in the process of being fixed for 4.0 and beyond .)
Eucalyptus EBS-backed Instances and Block Device Mapping
Eucalyptus supports block device mapping concepts  per Amazon EC2. EBS-backed instances these become particularly useful for users. Namely support for the delete-on-terminate flag and growing the volume size. This article explains how to use these two attributes with Eucalyptus EBS-backed instances.
Block device mapping attributes take the following form:
Delete On Termination
When a EBS-backed instance is launched, an EBS volume is created from the registered snapshot. This volume typically exists for the lifetime of the instance, until the instance is terminated. A user wanting to run another instance based on the same image would get a fresh copy from the snapshot. It is possible, through block device attribute, to set the behavior of a EBS-backed instance so that the volume is not deleted on termination. This provides the practical benefit of saving changes to the instance and providing a failsafe, which is particularly useful when an instance must be terminated for cloud maintenance periods (such as platform upgrades). Typically a user would use the euca-stop-instances and euca-start-instances commands against EBS-backed instances to ensure the instance state is saved.
To set the instance attribute to ensure the volume of the EBS-backed instance root filesystem is not deleted if the instance is terminate, use the following command when launching the instance:
euca-run-instances -k admin -g default -t m1.xlarge emi-6EBD3D78 -b /dev/sda1=::false
Changing Root Volume Size
Through another block device mapping attribute it is possible to alter the EBS volume size. This can be useful for dynamically increasing the root volume based on application requirements. To do this, pass the volume size to the mapping:
# euca-run-instances -k admin -g default -t m1.xlarge emi-6EBD3D78 -b /dev/sda1=:30:
The root volume will be set to 30GB when the instance is launched.
- Attributes can be combined, thus it is possible to increase the root volume and set the delete-on-terminate flag.
- Block device mappings can be specified with euca-register commands, this will serve the purpose of setting the attributes as default on the select EMI. For example:
# euca-register -n myimage --kernel windows --root-device-name /dev/sda1 -b /dev/sda1=snap-C35240BB:50:false
- AWS EC2 User Guide - Creating an Amazon EBS-backed AMI
- Eucalyptus 3.4 Image Management Guide - Create a New Image from an Existing EBS-backed EMI
- Eucalyptus 3.4 Image Management Guide - Create an EBS-backed EMI
- 12 Steps to EBS-backed EMI Bliss on Eucalyptus
- Eucalyptus Github Wiki - Block Device Mapping Training
- Eucalyptus Github Wiki - Boot from EBS Changes in Eucalyptus 3.3.0
- Eucalyptus Github Wiki - EBS backed EMI