Join us at engage.eucalyptus.com
I've downloaded the Ubuntu 9.10 64-bit VM from the store. I'm wanting to update the image and install OpenLDAP and persist the changes so I can boot this desired configuration. I'm not finding much help in documentation. If anyone could provide instructions or point me to a resource online I'd appreciate it.
1. Run an instance of the image.
2. SCP your Eucalyptus credential bundle (i.e., euca2-xxxxx-x509.zip) to the instance.
3. SSH into the instance.
4. Change to the super user: sudo su
5. apt-get update && apt-get -y install python-dev libssl-dev swig help2man unzip rsync make wget curl
6. Change to the /mnt device (it should have enough space to create new image bundle - I use 5GB for mine).
7. Unzip your Eucalyptus credentials zip file under /mnt, and delete the zip file from the login directory (so it doesn't get bundled in the new image).
8. Download Euca2ools 1.2 source code and dependencies source code from Eucalyptus' download page.
9. Follow the instructions to build Euc2ools. Make sure to uninstall the old Euca2ools before building the new one, if it is installed on the instance (i.e., apt-get remove euca2ools).
10. Install any other software you want on the instance.
11. Remove the udev rules: rm /etc/udev/rules.d/70*
12. Change to the /mnt directory and source your Eucalyptus script:
cd /mnt
. eucarc
12. Bundle the image:
euca-bundle-image -c ${EC2_CERT} -k ${EC2_PRIVATE_KEY} -u ${EC2_USER_ID} --ec2cert ${EUCALYPTUS_CERT} --no-inherit --kernel eki-KKKKKKKK --ramdisk eri-RRRRRRRR -d /mnt -r ARCH -p NEW_IMAGE_NAME -s SIZE_IN_MBs
eki-KKKKKKKK -> same as with running instance
eri-RRRRRRRR -> same as with running instance
Example:
euca-bundle-image -c ${EC2_CERT} -k ${EC2_PRIVATE_KEY} -u ${EC2_USER_ID} --ec2cert ${EUCALYPTUS_CERT} --no-inherit --kernel eki-0A104321 --ramdisk eri-1B031216 -d /mnt -r x86_64 -p myimage -s 5120
13. Upload bundle:
euca-upload-bundle -b BUCKET_NAME -m /mnt/NEW_IMAGE_NAME.manifest.xml
Example:
euca-upload-bundle -b test1 -m /mnt/myimage.manifest.xml
14. Register bundle:
euca-register BUCKET_NAME/NEW_IMAGE_NAME.manifest.xml
Example:
euca-register test1/myimage.manifest.xml
Hope that helps!
This is what I needed. Thank you.
However, my newly created bundle terminates instantly. Here's what I see in nc.log.
[Mon Mar 8 21:01:16 2010][013219][EUCAERROR ] ERROR: doTerminateInstance() failed error=101
euca-bundle-image requires "-i, --image Path to the image file to bundle."
I guess you mean you were using euca-bundle-vol.
I did use the euca-bundle-vol (not euca-bundle-image) and got error 101.
I'm looking through my other logs and not see anything. I'll keep looking.
Why is it necessary to uninstall the old euc2ools? Would it cause the 101 error I'm seeing if I don't do that?
Yes, that should be "euca-bundle-vol" and not "euca-bundle-image" ... my bad.
The reason for uninstalling euca2ools and building/installing the 1.2 version is that there was a bug in some releases before 1.2 that didn't recreate some needed /var directories when bundling. Thus, when the image was started up it would get some errors trying to do stuff in those dirs.
I'm not sure about the 101 error you are getting, but not being able to get out of the network from the instance (i.e., apt-get) is a definite issue. What type of network are you running? I'm using MANAGED-NOVLAN, so can only speak from that experience.
EDIT: BTW, check the console log for the instance to see if anything strange is occurring with your instance's network setup. Run an instance of the working image, save the console output of it, and then compare it with the output of the instance that isn't working to see if there are any big differences. This is how I found the udev problem (eventually).
I was able to get bundle a new VM image. I'm not sure what I was doing wrong. Thank you for your instructions.
Hello spride,
this is a question that comes up often: would you mind to create a wiki page describing what you did? This may help quite a few users.
thanks!
graziano
Hi Spride,
I downloaded euca2ools-1.2 from download UI page, but version still says old one:
/root/euca2ools-1.2-old/bin/euca-version
1.0-31337 2009-04-04
My co-worker checked with some developer who asked him to download 1.2 tools from:
apt-get install bzr
bzr co lp:eucalyptus/euca2ools-1.0
This time version shows 1.2:
root@192:/mnt# /root/euca2ools-1.0/bin/euca-version
1.2-31337 2009-04-04
Wonder where did you download euca tool 1.2?
Thanks.
Although, maybe it may warrant a sticky thread on this forum??? :-)
The 1.2 version from the Eucalyptus download page still has the version/etc values set to 1.0-xxxx. You can always edit the file in question and put your own values in there. That way, when it compiles it will show the updated values. :-)
Is it safe to say that version 1.0-31337 2009-04-04 is actually 1.2 and a new version doesn't need to be built?
Hi,
I am using UEC, 'Managed-Novlan' mode.
I am able to customize Ubuntu 9.10 image and bundle and upload it.
However the image doen't start. It remains in pending state.
The original ubuntu image has no problem running but it is the customized image that just remains pending!
Can anyone help?
Thanks in advance..
mithil
Hello,
we need more information: the console log of the instance may help for example. There are quite a few posts which explains how to do that, and some community wiki page too.
cheers
graziano
Did you erase the files in the /etc/udev/rules.d directory? My first attempt following the instructions in this thread failed because I did not. After I erased them, and did the whole process again it worked well. My customized instance is 2GB, and runs postgres plus apache2. I am using ubuntu 9.10 UEC Managed-Novlan, and the customized instance was derived from the 64-bit image provide by the Eucalyptus team.
Hi, firstly thanks for the detailed instructions. I've followed them successfully through to step 12 with no problems(also, a note for anyone else going through this, be sure to read the INSTALL file in the euca2ools source directory after extracting the source tgz file.)
My problem is that euca-bundle-image isn't accepting the parameters called for in the example for the following reasons:
a) it doesn't recognize the --no-inherit option
b) it requires a -i image parameter.
I was able to resolve this by using the euca-bundle-volume command with the same options as specified in your steps. Uploading/registering the resulting image was successful.
I'm running into SSH connectivity issues but I believe that is related to my continued attempts to get virtio working for disk/net access on the VMs.
Thanks again!
Tony
root@ubuntu:/mnt# euca-bundle-vol -c ${EC2_CERT} -k ${EC2_PRIVATE_KEY} -u ${EC2_USER_ID} --ec2cert ${EUCALYPTUS_CERT} --kernel eki-AE9417E0 --ramdisk eri-17291932 -d /mnt -r x86_64 -p ki_Ubunty_Jaunty_Backuppc.img -s 6120
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.0143658 s, 73.0 MB/s
mke2fs 1.41.4 (27-Jan-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
391680 inodes, 1566720 blocks
78336 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1606418432
48 block groups
32768 blocks per group, 32768 fragments per group
8160 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 33 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Checking image
Tarring image
Encrypting image
Splitting image...
Part: ki_Ubunty_Jaunty_Backuppc.img.part.0
Part: ki_Ubunty_Jaunty_Backuppc.img.part.1
Part: ki_Ubunty_Jaunty_Backuppc.img.part.2
Part: ki_Ubunty_Jaunty_Backuppc.img.part.3
Part: ki_Ubunty_Jaunty_Backuppc.img.part.4
Part: ki_Ubunty_Jaunty_Backuppc.img.part.5
Part: ki_Ubunty_Jaunty_Backuppc.img.part.6
Part: ki_Ubunty_Jaunty_Backuppc.img.part.7
Part: ki_Ubunty_Jaunty_Backuppc.img.part.8
Part: ki_Ubunty_Jaunty_Backuppc.img.part.9
Part: ki_Ubunty_Jaunty_Backuppc.img.part.10
Part: ki_Ubunty_Jaunty_Backuppc.img.part.11
Part: ki_Ubunty_Jaunty_Backuppc.img.part.12
Part: ki_Ubunty_Jaunty_Backuppc.img.part.13
Part: ki_Ubunty_Jaunty_Backuppc.img.part.14
Part: ki_Ubunty_Jaunty_Backuppc.img.part.15
Part: ki_Ubunty_Jaunty_Backuppc.img.part.16
Part: ki_Ubunty_Jaunty_Backuppc.img.part.17
Part: ki_Ubunty_Jaunty_Backuppc.img.part.18
Part: ki_Ubunty_Jaunty_Backuppc.img.part.19
Part: ki_Ubunty_Jaunty_Backuppc.img.part.20
Generating manifest /mnt/ki_Ubunty_Jaunty_Backuppc.img.manifest.xml
Traceback (most recent call last):
File "/usr/bin/euca-bundle-vol", line 451, in
main()
File "/usr/bin/euca-bundle-vol", line 430, in main
ancestor_ami_ids,
File "/usr/lib/python2.6/dist-packages/euca2ools/__init__.py", line 957, in generate_manifest
dname = device_names[vname_index]
IndexError: list index out of range
root@ubuntu:/mnt#
============================================
Running ver1.2 of Euca2ools on Ubuntu Jaunty server 9.04
One slippage in the command line, was the --no-inherit got missed out juggling between euca-bundle-image and euca-bundle-vol..But not sure if that caused this problem.
Can someone help understand what went wrong?
Made a few little changes:
1. Noticed that I was in the /mnt dir itself when I ran the command.. Not consequential IMHO.. but nevertheless changed to /
2. My attached volume was 5Gb. So I was creating a 5 GB image.. Thought that maybe the image was choking for want of space. So reduced the image size to 4Gb
3. Added the --no-inherit option also
It worked.. Dunno what exactly the error was.. My guess is that it was No.2 or No.3
========================================
root@ubuntu:/# euca-bundle-vol -c ${EC2_CERT} -k ${EC2_PRIVATE_KEY} -u ${EC2_USER_ID} --ec2cert ${EUCALYPTUS_CERT} --no-inherit --kernel eki-AE9417E0 --ramdisk eri-17291932 -d /mnt -r x86_64 -p ki_Ubunty_Jaunty_Backuppc.img -s 4096
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.00843495 s, 124 MB/s
mke2fs 1.41.4 (27-Jan-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
262144 inodes, 1048576 blocks
52428 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1073741824
32 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
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Checking image
Tarring image
Encrypting image
Splitting image...
Part: ki_Ubunty_Jaunty_Backuppc.img.part.0
Part: ki_Ubunty_Jaunty_Backuppc.img.part.1
Part: ki_Ubunty_Jaunty_Backuppc.img.part.2
Part: ki_Ubunty_Jaunty_Backuppc.img.part.3
Part: ki_Ubunty_Jaunty_Backuppc.img.part.4
Part: ki_Ubunty_Jaunty_Backuppc.img.part.5
Part: ki_Ubunty_Jaunty_Backuppc.img.part.6
Part: ki_Ubunty_Jaunty_Backuppc.img.part.7
Part: ki_Ubunty_Jaunty_Backuppc.img.part.8
Part: ki_Ubunty_Jaunty_Backuppc.img.part.9
Part: ki_Ubunty_Jaunty_Backuppc.img.part.10
Part: ki_Ubunty_Jaunty_Backuppc.img.part.11
Part: ki_Ubunty_Jaunty_Backuppc.img.part.12
Part: ki_Ubunty_Jaunty_Backuppc.img.part.13
Part: ki_Ubunty_Jaunty_Backuppc.img.part.14
Part: ki_Ubunty_Jaunty_Backuppc.img.part.15
Part: ki_Ubunty_Jaunty_Backuppc.img.part.16
Part: ki_Ubunty_Jaunty_Backuppc.img.part.17
Part: ki_Ubunty_Jaunty_Backuppc.img.part.18
Part: ki_Ubunty_Jaunty_Backuppc.img.part.19
Part: ki_Ubunty_Jaunty_Backuppc.img.part.20
Generating manifest /mnt/ki_Ubunty_Jaunty_Backuppc.img.manifest.xml
=========================
Hello,
thanks for reporting. I think that actually both 2 and 3 are needed, but I'm not 100% sure. I think the error that you had was due to the inherit options.
cheers
graziano
Hi, I used all these steps and it helped me to create a new image. But when I want to run a new instance using the image previously created, I observed that it switch directly from 'pending' state -> 'terminated' state. Do you have any suggestions to solve this issue?
Request to open a new thread with a pointer to this thread and also specify your eucalyptus version, operating system of the vm image, logs from the NC, CC?
Thanks!
Deependra