Cloud Image Management on Eucalyptus: Creating a CentOS 6.6 EMI With ZFS Support

ZFS is a filesystem designed by Sun Microsystems that focuses on data integrity. What makes this such an attractive filesystem to use in the cloud is that a cloud user can easily do the following:

set up an LVM + RAID filesystem for storing large amounts of data (e.g. database information)

expand the filesystem by adding more storage (i.e. EBS volumes)

backup the filesystem without taking the filesystem offline/unmounting

restore the filesystem

This blog entry will focus on how a cloud user can create their own Eucalyptus Machine Image (EMI) that has ZFS support. The CentOS 6.5 EMI on the Eucalyptus Machine Image Catalog will be used as the base image.

Before Starting…

Before following the steps in this blog, make sure the following is in place:

Once these requirements have been met, everything should be ready to go.

Set Up Base Image/Instance

To begin, follow the ‘Quick Start’ instructions mentioned on the Eucalyptus Machine Image Catalog page. This will install all the images provided by the catalog. When the process has finished, list the CentOS 6.5 EMI. For example:

Create the CentOS 6.6 EMI with ZFS Support

The instance is now ready to be bundled. Bundle the instance using the euca-bundle-instance command. This command is used to bundle Windows instances, however Eucalyptus extended this command to work with Linux instances as well. Use euca-describe-bundle-tasks to monitor the bundling status:

Thats it! Notice how this only required 2 commands to set up a LVM + RAID filesystem, compared to around 7 commands using mdadm, pvcreate, vgcreate, mkfs, mkdir and mount. The instance is now ready to utilize the ZFS filesystem for the MySQL server.