Image management in Eucalyptus

Managing images in Eucalyptus is generally done by Euca2ools distributed by Eucalyptus team.

All users may upload and register images (depending on access granted to them by the Eucalyptus administrator), but only the admin user may ever upload/register kernels or ramdisks.

Now source the ‘eucarc’ from you ~/.euca directory if you haven’t.

Registering kernel image Execute the following commands to bundle and register the kernel image (vmlinuz-2.6.35-22-server)

shaon@client:~$ euca-bundle-image -i vmlinuz-2.6.32-28-generic --kernel true
shoan@client:~$ euca-upload-bundle -b mybucket -m /tmp/vmlinuz-2.6.32-28-generic.manifest.xml
shaon@client:~$ euca-register mybucket/vmlinuz-2.6.32-28 generic.manifest.xml

Save the output produced by the last command above (eki-XXXXXXXX), which will be needed while registering the disk image.

Registering ramdisk image Execute the following commands to bundle and register the ramdisk image (initrd.img-2.6.35-22-server)

shaon@client:~$ euca-bundle-image -i initrd.img-2.6.32-28-generic --ramdisk true
shaon@client:~$ euca-upload-bundle -b mybucket -m /tmp/initrd.img-2.6.32-28-generic.manifest.xml
shaon@client:~$ euca−register mybucket/initrd.img−2.6.35−22−server.manifest.xml

Save the output produced by the last command above (eri-XXXXXXXX), which will be needed while registering the disk image.

Registering disk image Execute the following commands to bundle and register the ramdisk image ( imagefinal .img)

shaon@client:~$ euca-bundle-image -i imagefinal.img --kernel eki-XXXXXXXX --ramdisk eri-XXXXXXXX
shaon@client:~$ euca-upload-bundle -b mybucket -m /tmp/imagefinal.img.manifest.xml
shaon@client:~$ euca-register mybucket/imagefinal.img.manifest.xml

Replace eki-XXXXXXXX and eri-XXXXXXXX with the exact values you have saved earlier.

To see the the uploaded images

shaon@client:~$ euca-describe-images
IMAGE    eki-7A8D1340    mybucket/vmlinuz-2.6.32-28-generic.manifest.xml    admin    available    public   	 x86_64kernel              instance-store
IMAGE    eri-B603142C    mybucket/initrd.img-2.6.32-28-generic.manifest.xml    admin    available    public   	 x86_64    ramdisk              instance-store
IMAGE    emi-CF6C10B0    mybucket/imagefinal.img.manifest.xml    admin    available    public   	 x86_64    machine    eki-7A8D1340    eri-B603142C    instance-store

Running a custom image

Add a new key-pair to run a new instance with the key.

shaon@client:~$ cd ~/.euca/
shaon@client:~/.euca$ euca-add-keypair jssecacerts > jssecacerts.priv
shaon@client:~/.euca$ chmod 600 jssecacerts.priv
shaon@client:~/.euca$ euca-describe-keypairs

Now run instance with the following command

shaon@client:~/.euca$ euca-run-instances emi-CF6C10B0 -k jssecacerts -t c1.medium

Instance Security

# Check group detail
shaon@client:~/.euca$ euca-describe-groups

# Add new group
shaon@client:~/.euca$ euca-add-group -d "Web Servers" webservers

# Add tcp and icmp permission to the webservers group
shaon@client:~/.euca$ euca-authorize -P tcp -s 0.0.0.0/0 webservers
shaon@client:~/.euca$ euca-authorize -P icmp -s 0.0.0.0/0 webservers
shaon@client:~/.euca$ euca-authorize -P tcp -s 0.0.0.0/0 default
shaon@client:~/.euca$ euca-authorize -P icmp -s 0.0.0.0/0 default
shaon@client:~/.euca$ euca-authorize -P tcp -p 80 default

Tadaa!!

About these ads

13 Responses to Image management in Eucalyptus

  1. Hi,

    I followed you instruction an succesfully uploaded the image, the kernel and the ramdisk on my Eucalyptus Cloud. Only when I try to start an instance with the new image it stays for some time in “pending” mode and then terminates.

    Is there a place where I can debug and see what is gonging wrong?

    Bye,
    martin

  2. which networking mode are you using? are you getting any associated IP for the instance? check the log files, it tells you what exactly is going on.

    • I use STATIC, since the others are not supported. Yes the instance get an IP assigned but stays in “pending”.

      Which log files? Since in the Eucalyptus log files (/var/log/eucalyptus) I can’t see much.

  3. well, there should be nc.log in the NC. long pending state usually means, difficulties in talking with the walrus. you may also try the libvirt log.
    and for everything, log in as root.

  4. Ok, found error. Stupid me there was not enough disk space. Did not catch that when looking into nc.log the first time. Sorry for bordering.

  5. Hi,

    When I try to run my instance in Eucalyptus, I’m not able to SSH to it or ping it. But when I run an instance of image provided by Eucalyptus, I’m able to SSH and ping the instance. Can you help me out here?

  6. did you remove the 70-persistent-net.rules? that might create problem with networking

  7. Yes removing 70-persistent-net.rules worked. Thanks.

  8. Felipe Gutierrez

    can you access the instance that you just created? I mean “ssh -i key root@your-ip-address”

  9. Felipe Gutierrez

    Hi Shaon,

    Did you already install Eucalyptus with Xen as Hypervisor? I got everything with KVM, but with Xen my instances don’t get IP. https://engage.eucalyptus.com/customer/en/portal/questions/752553-xen-doesn-t-get-ip-address?new=752553
    If you have some clue, please share to me.

    Thanks, Felipe

  10. hi shaon
    its a great blog abt creating a custom vm after a long time am seeing my vm getting ip but still i had a problem am using SYSTEM mode in eucalyptus so i have to get ip from dhcp server and am getting so . i started a vm and i got 192.168.3.5 where 192.168.3.0 is my network . but am not able to ssh my instance
    i tried
    ssh -i test.private user@192.168.3.5
    ssh user@192.168.3.5
    ssh -i test.private ubuntu@192.168.3.5
    iam getting ssh :connection to host 192.168.3.2 port 22 connection refused
    since am using system mode there is no need of instance security right ??

    • Sorry for late reply. Can you please check the console log if the instance has been booted properly? Also, another good way of debugging instance would be installing VNC server on your NC and check the VMs.

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 )

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