UEC: Zusammenstellen von Images für Ubuntu 9.10

[ 0 ] Juni 7, 2010 |

Dieser Artikel beschreibt das Vorgehen (Bundling) für das Erstellen und die Registrierung von VM Images mit dem UEC Cloud Controller für Ubuntu 9.10. Dazu benötigen wir ein Image, dass von den Daily Builds heruntergeladen werden kann, verknüpfen alles miteinander und laden es in unsere Ubuntu Cloud.

1. Um den Vorgang von der Kommandozeile aus zu starten nutzen wird die folgenden Befehle. Hierbei wird automatisch ein UEC Image heruntergeladen.

TIMESTAMP=$(date +%Y%m%d%H%M%S)
RELEASE=karmic
ARCH=amd64 # Or this might be i386
[ $ARCH = "amd64" ] && IARCH=x86_64 || IARCH=i386
UEC_IMG=$RELEASE-server-uec-$ARCH
URL=http://uec-images.ubuntu.com/$RELEASE/current/
[ ! -e $UEC_IMG.tar.gz ] && wget $URL/$UEC_IMG.tar.gz # This may take a bit, depending on your connectivity

2. Als nächstes muss alles verpackt, hochgeladen und registriert werden. In dem Package cloud-utils befindet sich das Tool uec-publish-tarball. Mit diesem können die oben genannten Aktionen in einem Schritt durchgeführt werden. Weiterhin ist in den cloud-utils das Tool uec-publish-image vorhanden. Mit diesem kann direkt mit einem ungepackten Image gearbeitet werden.

uec-publish-tarball ${UEC_IMG}.tar.gz "${RELEASE}-${TIMESTAMP}" "${ARCH}"

Diese Schritte sind nur dann notwendig, wenn nicht das Tool uec-publish-tarball verwendet wird!

1. Entpacken des UEC Image Tarball

[ ! -e $UEC_IMG.img ] && tar -S -xzf $UEC_IMG.tar.gz

2. Zusammenstellen des Kernels

BUCKET_KERNEL="k-$TIMESTAMP"
UEC_KERNEL=$UEC_IMG-vmlinuz-virtual
euca-bundle-image -i $UEC_KERNEL -r $IARCH --kernel true
euca-upload-bundle -b $BUCKET_KERNEL -m /tmp/$UEC_KERNEL.manifest.xml
EKI=$(euca-register $BUCKET_KERNEL/$UEC_KERNEL.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $EKI

3. Zusammenstellen der initrd (Wird nur benötigt, wenn keine Ramdisk vorhanden ist)

BUCKET_INITRD="r-$TIMESTAMP"
UEC_INITRD=$UEC_IMG-initrd-virtual
euca-bundle-image -i $UEC_INITRD -r $IARCH --ramdisk true
euca-upload-bundle -b $BUCKET_INITRD -m /tmp/$UEC_INITRD.manifest.xml
ERI=$(euca-register $BUCKET_INITRD/$UEC_INITRD.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $ERI

4. Zusammenstellen des Images

BUCKET_IMAGE="i-$TIMESTAMP"
UEC_IMG=$RELEASE-server-uec-$ARCH
euca-bundle-image -i $UEC_IMG.img -r $IARCH --kernel $EKI ${ERI:+--ramdisk ${ERI}} # This will take a long time (~10m)
euca-upload-bundle -b $BUCKET_IMAGE -m /tmp/$UEC_IMG.img.manifest.xml
EMI=$(euca-register $BUCKET_IMAGE/$UEC_IMG.img.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $EMI

3. Damit ist der Kernel und das Image in unsere Ubuntu Cloud (Eucalyptus) hochgeladen worden und kann nun genutzt werden.

euca-describe-images

Wir sollten einen registrierten Kernel sowie ein Image sehen, die als “available” markiert sind.

Mit dem anschließenden Befehl können wir das überprüfen.

Quelle

Tags: , , , , , , , , , , , , ,

Category: Tutorials

About the Author ()

Rene Buest is Principal Analyst and Senior Advisor at renebuest research, covering cloud computing, business technology and collaboration. He is member of the GigaOm Pro Analyst Network and top cloud computing blogger in Germany. Worldwide he is one of the top 50 bloggers in this area. For more than 16 years he is focused on the strategic use of information technology in businesses and the IT impact on our society as well as disruptive technologies. Rene Buest is the author of numerous professional cloud computing and technology articles, speaker and participant of experts rounds. On CloudUser.de he writes about topics from the fields of cloud computing, it-infrastructures, technologies, management and strategies and is moving on Twitter via his account @ReneBuest. Rene Buest is organizer of numerous cloud computing and technology events. Covering the CloudCamp Hamburg 2010, CloudCamp Frankfurt 2012, CloudOps Summit 2012 and the Amazon Web Services and Windows Azure User Groups in Germany. Rene Buest is a fully qualified specialist for system integration und holds a diploma in computer engineering from the Hochschule Bremen (Dipl.-Informatiker (FH)) as well as a M.Sc. in IT-Management and Information Systems from the FHDW Paderborn. Detailed curriculum vitaes are hosted on XING and LinkedIn.

Leave a Reply

You must be logged in to post a comment.