Resizing HVM Images for Instance Store-Backed HVM Eucalyptus Machine Images (EMIs)

Follow

Eucalyptus Versions:  3.4.1 and Greater

Resizing HVM Images for Instance Store-Backed HVM Eucalyptus Machine Images (EMIs)

With the release of Eucalyptus 4.0, there is a major focus on cloud users using Instance store-backed Hardware Virtual Machine (HVM) Eucalyptus Machine Images (EMIs) [1].  Due to this focus, there are situations where the cloud user would like to resize the image planned to be bundled, uploaded and registered as an instance store-backed HVM EMI - similar to what can be performed for images that plan to be registered as instance store-backed paravirtual EMIs [2].  

This article will cover steps on how to resize images that will be used for instance store-backed HVM EMIs.  At the time of this article, the following resources can be used to download images that can be used with article:

To provide a more hands-on example, this article will use the Ubuntu 14.04 LTS - Trusty Tahr image.  The only prerequisite is that the software package qemu-img be installed on the client machine that will be used to resize the image.  

1. Download the Ubuntu 14.04 LTS image:

# wget http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img

2. Use qemu-img to convert the image to a raw disk image:

# qemu-img convert -O raw trusty-server-cloudimg-amd64-disk1.img trusty-server-cloudimg-amd64-disk1.raw

3.  By default, Ubuntu Cloud Images are around 2.2 Gigs.  To increase the image size (for example, add 5 Gigs to the image), use qemu-img:

# qemu-img info trusty-server-cloudimg-amd64-disk1.raw
image: trusty-server-cloudimg-amd64-disk1.raw
file format: raw
virtual size: 2.2G (2361393152 bytes)
disk size: 794M
# qemu-img resize trusty-server-cloudimg-amd64-disk1.raw +5G
# qemu-img info trusty-server-cloudimg-amd64-disk1.raw
image: trusty-server-cloudimg-amd64-disk1.raw
file format: raw
virtual size: 7.2G (7730102272 bytes)
disk size: 794M

[Note] qemu-img can also be used to shrink an image as well, however there needs to be extreme caution when performing this task. Failure to update the file system and partitioning of the image itself (by mounting it and switching to a chroot environment) by reducing the allocated sizes of the filesystem and partitions can result in data loss [3]

Once thats completed, please refer to the section "Install an HVM Image" under the Eucalyptus Image Management Guide.

References

[1]   Eucalyptus Image Management - Install HVM Image 
[2]  KB Article - Resizing a Machine Image (EMI)
[3]  RedHat 6 Virtualization Administration Guide - Using qemu-img

 

 

Have more questions? Submit a request

Comments

Powered by Zendesk