Bundling Euca Instance into an EMI: euca-bundle-vol[UNSOLVED]

The urge to do this was more than the need to do it. I am kinda a stuck with too many things at moment, so I could not get hands to this earlier. I am suprised that there are not many who are bundling a running instance into an EMI. But things are not really rosy at the moment.

The first step was to get the certs, and unzip to certain directory, ‘euca’ in my case. And went the following way.

I bundled the instance excluding the home directory

$ sudo euca-bundle-vol --kernel eki-F69610EE --ramdisk eri-0B3A116D --ec2cert ./euca/cloud-cert.pem -k ./euca/euca2-admin-XXXXXXX-pk.pem -d /mnt/bundle/ -p euca-bun --user nnnnnnnnnnnn -c ./euca/euca2-admin-XXXXXXX-cert.pem --exclude /home/ubuntu

1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.00665631 s, 158 MB/s
mke2fs 1.41.9 (22-Aug-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
655360 inodes, 2621440 blocks
131072 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2684354560
80 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
Checking image
Tarring image
Encrypting image
Splitting image...
Part: euca-bun.part.0
Part: euca-bun.part.1
Part: euca-bun.part.2
Part: euca-bun.part.3
Part: euca-bun.part.4
Part: euca-bun.part.5
Part: euca-bun.part.6
Part: euca-bun.part.7
Part: euca-bun.part.8
Part: euca-bun.part.9
Part: euca-bun.part.10
Part: euca-bun.part.11
Part: euca-bun.part.12
Part: euca-bun.part.13
Part: euca-bun.part.14
Part: euca-bun.part.15
Part: euca-bun.part.16
Part: euca-bun.part.17
Generating manifest

Then, I upload these parts to the Walrus’ samkibukkit, which will eventually hold all the part files.

$ sudo euca-upload-bundle -b samkibukkit -m /mnt/bundle/euca-bun.manifest.xml -a $EC2_ACCESS_KEY -s $EC2_SECRET_KEY
Checking bucket: samkibukkit
Creating bucket: samkibukkit
Uploading manifest file
Uploading part: euca-bun.part.0
Uploading part: euca-bun.part.1
Uploading part: euca-bun.part.2
Uploading part: euca-bun.part.3
Uploading part: euca-bun.part.4
Uploading part: euca-bun.part.5
Uploading part: euca-bun.part.6
Uploading part: euca-bun.part.7
Uploading part: euca-bun.part.8
Uploading part: euca-bun.part.9
Uploading part: euca-bun.part.10
Uploading part: euca-bun.part.11
Uploading part: euca-bun.part.12
Uploading part: euca-bun.part.13
Uploading part: euca-bun.part.14
Uploading part: euca-bun.part.15
Uploading part: euca-bun.part.16
Uploading part: euca-bun.part.17
Uploaded image as samkibukkit/euca-bun.manifest.xml

The upload happened successfully. And then i register the instance.

$ sudo euca-register -a $EC2_ACCESS_KEY -s $EC2_SECRET_KEY samkibukkit/euca-bun.manifest.xml
IMAGE    emi-97000F96

Well now for the real test. When I tried to raise raise the EMI as an instance, i realized that default size of the image was 10G, which I will keep in mind while bundling it next time. So I ended up raising an xlarge instance, which was the smallest one that supported this EMI.

This what is the blogs are meant for; the instance came up but it would not setup the filesystem correctly. And the whole process went boink!

Well, there should be a way out, but I will scratch that itch a little later, but be sure I will scratch it.  Please wait.


One thought on “Bundling Euca Instance into an EMI: euca-bundle-vol[UNSOLVED]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s