Difference between revisions of "Ubuntu Enterprise Cloud: Alternatif Cara Menjalankan Instance"

From OnnoWiki
Jump to navigation Jump to search
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
Alternatif cara menjalankan Instance adalah sebagai berikut, kita dapat membuat script file jika dibutuhkan.
+
Kita dapat menjalankan instance langsung dari release file Ubuntu
  
ubuntu@aussie:~$ TIMESTAMP=$(date +%Y%m%d%H%M%S)
+
* http://uec-images.ubuntu.com/releases/9.10/release/
ubuntu@aussie:~$ RELEASE=lucid
+
* http://uec-images.ubuntu.com/releases/10.04/release/
ubuntu@aussie:~$ ARCH=amd64 # Or this might be i386
+
* http://uec-images.ubuntu.com/releases/10.10/release/
ubuntu@aussie:~$ [ $ARCH = "amd64" ] && IARCH=x86_64 || IARCH=i386
+
* http://uec-images.ubuntu.com/releases/11.04/release/  
ubuntu@aussie:~$ UEC_IMG=$RELEASE-server-uec-$ARCH
 
ubuntu@aussie:~$ URL=http://uec-images.ubuntu.com/$RELEASE/current/
 
ubuntu@aussie:~$ [ ! -e $UEC_IMG.tar.gz ] && wget $URL/$UEC_IMG.tar.gz # This may take a bit, depending on your connectivity
 
ubuntu@aussie:~$ [ ! -e $UEC_IMG.img ] && tar -S -xzf $UEC_IMG.tar.gz
 
ubuntu@aussie:~$ BUCKET_KERNEL="k-$TIMESTAMP"
 
ubuntu@aussie:~$ UEC_KERNEL=$UEC_IMG-vmlinuz-virtual
 
ubuntu@aussie:~$ euca-bundle-image -i $UEC_KERNEL -r $IARCH --kernel true
 
x86_64
 
Checking image
 
Tarring image
 
Encrypting image
 
Splitting image...
 
Part: lucid-server-uec-amd64-vmlinuz-virtual.part.0
 
Generating manifest /tmp/lucid-server-uec-amd64-vmlinuz-virtual.manifest.xml
 
ubuntu@aussie:~$ euca-upload-bundle -b $BUCKET_KERNEL -m /tmp/$UEC_KERNEL.manifest.xml
 
Checking bucket: k-20100222135250
 
Creating bucket: k-20100222135250
 
Uploading manifest file
 
Uploading part: lucid-server-uec-amd64-vmlinuz-virtual.part.0
 
Uploaded image as k-20100222135250/lucid-server-uec-amd64-vmlinuz-virtual.manifest.xml
 
ubuntu@aussie:~$ EKI=$(euca-register $BUCKET_KERNEL/$UEC_KERNEL.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $EKI
 
eki-07D419B5
 
ubuntu@aussie:~$ ls -alF $UEC_KERNEL
 
-rw-r--r-- 1 ubuntu ubuntu 4182784 2010-02-21 20:03 lucid-server-uec-amd64-vmlinuz-virtual
 
ubuntu@aussie:~$ BUCKET_IMAGE="i-$TIMESTAMP"
 
ubuntu@aussie:~$ UEC_IMG=$RELEASE-server-uec-$ARCH
 
ubuntu@aussie:~$ euca-bundle-image -i $UEC_IMG.img -r $IARCH --kernel $EKI
 
x86_64
 
Checking image
 
Tarring image
 
Encrypting image
 
Splitting image...
 
Part: lucid-server-uec-amd64.img.part.0
 
Part: lucid-server-uec-amd64.img.part.1
 
Part: lucid-server-uec-amd64.img.part.2
 
Part: lucid-server-uec-amd64.img.part.3
 
Part: lucid-server-uec-amd64.img.part.4
 
Part: lucid-server-uec-amd64.img.part.5
 
Part: lucid-server-uec-amd64.img.part.6
 
Part: lucid-server-uec-amd64.img.part.7
 
Part: lucid-server-uec-amd64.img.part.8
 
Part: lucid-server-uec-amd64.img.part.9
 
Part: lucid-server-uec-amd64.img.part.10
 
Part: lucid-server-uec-amd64.img.part.11
 
Part: lucid-server-uec-amd64.img.part.12
 
Part: lucid-server-uec-amd64.img.part.13
 
Part: lucid-server-uec-amd64.img.part.14
 
Part: lucid-server-uec-amd64.img.part.15
 
Part: lucid-server-uec-amd64.img.part.16
 
Part: lucid-server-uec-amd64.img.part.17
 
Part: lucid-server-uec-amd64.img.part.18
 
Part: lucid-server-uec-amd64.img.part.19
 
Generating manifest /tmp/lucid-server-uec-amd64.img.manifest.xml
 
EMI=$(euca-register $BUCKET_IMAGE/$UEC_IMG.img.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $EMI
 
emi-C73F14A0
 
  
ubuntu@aussie:~$ euca-run-instances emi-C73F14A0 -k mykey -t c1.medium
+
Kita dapat menggunakan script berikut
RESERVATION r-30FF056D admin admin-default
 
INSTANCE i-3F8E0754 emi-C73F14A0 0.0.0.0 0.0.0.0 pending mykey 2010-02-22T20:20:14.956Z eki-07D419B5 eri-092119A6
 
  
ubuntu@aussie:~$ euca-describe-instances | grep i-3F8E0754
 
INSTANCE i-3F8E0754 emi-C73F14A0 10.1.1.106 172.19.1.8 pending mykey 0 c1.medium
 
2010-02-22T20:20:14.956Z cluster1 eki-07D419B5 eri-092119A6
 
...
 
INSTANCE i-3F8E0754 emi-C73F14A0 10.1.1.106 172.19.1.8 running mykey 0 c1.medium
 
2010-02-22T20:20:14.956Z cluster1 eki-07D419B5 eri-092119A6
 
  
 +
==Dalam Bentuk Shell Script untuk x86_64==
  
==Dalam Bentuk Shell Script==
+
cp ubuntu-10.10-server-uec-amd64.tar.gz maverick-server-uec-amd64.tar.gz
 
+
. ~/.euca/eucarc
 +
source ~/.euca/eucarc
 
  TIMESTAMP=$(date +%Y%m%d%H%M%S)
 
  TIMESTAMP=$(date +%Y%m%d%H%M%S)
 
  RELEASE=maverick
 
  RELEASE=maverick
  ARCH=i386
+
  ARCH=amd64
 
  [ $ARCH = "amd64" ] && IARCH=x86_64 || IARCH=i386
 
  [ $ARCH = "amd64" ] && IARCH=x86_64 || IARCH=i386
 
  UEC_IMG=$RELEASE-server-uec-$ARCH
 
  UEC_IMG=$RELEASE-server-uec-$ARCH
Line 87: Line 26:
 
  EKI=$(euca-register $BUCKET_KERNEL/$UEC_KERNEL.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $EKI
 
  EKI=$(euca-register $BUCKET_KERNEL/$UEC_KERNEL.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $EKI
 
  ls -alF $UEC_KERNEL
 
  ls -alF $UEC_KERNEL
 +
BUCKET_RAMDISK="r-$TIMESTAMP"
 +
UEC_RAMDISK=$UEC_IMG-loader
 +
euca-bundle-image -i  $UEC_RAMDISK -r $IARCH --ramdisk true
 +
euca-upload-bundle -b $BUCKET_RAMDISK -m /tmp/$UEC_RAMDISK.manifest.xml
 +
ERI=$(euca-register $BUCKET_RAMDISK/$UEC_RAMDISK.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $ERI
 
  BUCKET_IMAGE="i-$TIMESTAMP"
 
  BUCKET_IMAGE="i-$TIMESTAMP"
 
  UEC_IMG=$RELEASE-server-uec-$ARCH
 
  UEC_IMG=$RELEASE-server-uec-$ARCH
  euca-bundle-image -i $UEC_IMG.img -r $IARCH --kernel $EKI
+
  euca-bundle-image -i $UEC_IMG.img -r $IARCH --kernel $EKI --ramdisk $ERI
 +
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
 
  EMI=$(euca-register $BUCKET_IMAGE/$UEC_IMG.img.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $EMI
  
  euca-run-instances emi-C73F14A0 -k mykey -t c1.medium
+
  euca-run-instances $EMI -k mykey -t c1.medium
 
  euca-describe-instances | grep i-3F8E0754
 
  euca-describe-instances | grep i-3F8E0754
  
==Dalam Bentuk Shell Script==
+
==Dalam Bentuk Shell Script untuk Karmic i386==
 +
 
 +
cp ubuntu-9.10-server-uec-i386.tar.gz karmic-server-uec-i386.tar.gz
 +
. ~/.euca/eucarc
 +
source ~/.euca/eucarc
 +
TIMESTAMP=$(date +%Y%m%d%H%M%S)
 +
RELEASE=karmic
 +
ARCH=i386
 +
UEC_IMG=$RELEASE-server-uec-$ARCH
 +
[ ! -e $UEC_IMG.img ] && tar -S -xzf $UEC_IMG.tar.gz
 +
BUCKET_KERNEL="k-$TIMESTAMP"
 +
UEC_KERNEL=$UEC_IMG-vmlinuz-virtual
 +
euca-bundle-image -i $UEC_KERNEL -r $ARCH --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
 +
ls -alF $UEC_KERNEL
 +
BUCKET_RAMDISK="r-$TIMESTAMP"
 +
UEC_RAMDISK=$UEC_IMG-initrd-virtual
 +
euca-bundle-image -i  $UEC_RAMDISK -r $ARCH --ramdisk true
 +
euca-upload-bundle -b $BUCKET_RAMDISK -m /tmp/$UEC_RAMDISK.manifest.xml
 +
ERI=$(euca-register $BUCKET_RAMDISK/$UEC_RAMDISK.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $ERI
 +
BUCKET_IMAGE="i-$TIMESTAMP"
 +
UEC_IMG=$RELEASE-server-uec-$ARCH
 +
euca-bundle-image -i $UEC_IMG.img -r $ARCH --kernel $EKI --ramdisk $ERI
 +
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
 +
 
 +
euca-run-instances $EMI -k mykey -t c1.medium
 +
euca-describe-instances
  
 +
==Dalam Bentuk Shell Script untuk Maverick i386==
 +
 +
cp ubuntu-10.10-server-uec-i386.tar.gz maverick-server-uec-i386.tar.gz
 
  . ~/.euca/eucarc
 
  . ~/.euca/eucarc
 
  source ~/.euca/eucarc
 
  source ~/.euca/eucarc
 +
TIMESTAMP=$(date +%Y%m%d%H%M%S)
 
  RELEASE=maverick
 
  RELEASE=maverick
 
  ARCH=i386
 
  ARCH=i386
 
  UEC_IMG=$RELEASE-server-uec-$ARCH
 
  UEC_IMG=$RELEASE-server-uec-$ARCH
 
  [ ! -e $UEC_IMG.img ] && tar -S -xzf $UEC_IMG.tar.gz
 
  [ ! -e $UEC_IMG.img ] && tar -S -xzf $UEC_IMG.tar.gz
  BUCKET="mybucket"
+
  BUCKET_KERNEL="k-$TIMESTAMP"
 
  UEC_KERNEL=$UEC_IMG-vmlinuz-virtual
 
  UEC_KERNEL=$UEC_IMG-vmlinuz-virtual
 
  euca-bundle-image -i $UEC_KERNEL -r $ARCH --kernel true
 
  euca-bundle-image -i $UEC_KERNEL -r $ARCH --kernel true
  euca-upload-bundle -b $BUCKET -m /tmp/$UEC_KERNEL.manifest.xml
+
  euca-upload-bundle -b $BUCKET_KERNEL -m /tmp/$UEC_KERNEL.manifest.xml
  EKI=$(euca-register $BUCKET/$UEC_KERNEL.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $EKI
+
  EKI=$(euca-register $BUCKET_KERNEL/$UEC_KERNEL.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $EKI
 
  ls -alF $UEC_KERNEL
 
  ls -alF $UEC_KERNEL
 +
BUCKET_RAMDISK="r-$TIMESTAMP"
 +
UEC_RAMDISK=$UEC_IMG-loader
 +
euca-bundle-image -i  $UEC_RAMDISK -r $ARCH --ramdisk true
 +
euca-upload-bundle -b $BUCKET_RAMDISK -m /tmp/$UEC_RAMDISK.manifest.xml
 +
ERI=$(euca-register $BUCKET_RAMDISK/$UEC_RAMDISK.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $ERI
 +
BUCKET_IMAGE="i-$TIMESTAMP"
 
  UEC_IMG=$RELEASE-server-uec-$ARCH
 
  UEC_IMG=$RELEASE-server-uec-$ARCH
  euca-bundle-image -i $UEC_IMG.img -r $ARCH --kernel $EKI
+
  euca-bundle-image -i $UEC_IMG.img -r $ARCH --kernel $EKI --ramdisk $ERI
  EMI=$(euca-register $BUCKET/$UEC_IMG.img.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $EMI
+
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
  
  euca-run-instances emi-C73F14A0 -k mykey -t c1.medium
+
  euca-run-instances $EMI -k mykey -t c1.medium
  euca-describe-instances | grep i-3F8E0754
+
  euca-describe-instances
  
 
==Referensi==
 
==Referensi==
Line 124: Line 108:
  
 
* [[Ubuntu Enterprise Cloud]]
 
* [[Ubuntu Enterprise Cloud]]
 +
* [[Ubuntu Enterprise Cloud: Instalasi Ubuntu Enterprise Cloud Controller]]
 +
* [[Ubuntu Enterprise Cloud: Instalasi Ubuntu Enterprise Node Controller]]
 
* [[Ubuntu Enterprise Cloud: Troubleshooting]]
 
* [[Ubuntu Enterprise Cloud: Troubleshooting]]
* [[Ubuntu Enterprise Cloud: Eucalyptus Beginner’s Guide]] '''RECOMMENDED'''
+
* [[Ubuntu Enterprise Cloud: Panduan Untuk Pemula]] '''RECOMMENDED'''
 
* [[Ubuntu Enterprise Cloud: Catatan kecil Instalasi & Operasi]]
 
* [[Ubuntu Enterprise Cloud: Catatan kecil Instalasi & Operasi]]
 
* [[Ubuntu Enterprise Cloud: Instalasi UEC]]
 
* [[Ubuntu Enterprise Cloud: Instalasi UEC]]
 +
* [[Ubuntu Enterprise Cloud: Membuat Image Sendiri]]
 +
* [[Ubuntu Enterprise Cloud: Alternatif Cara Menjalankan Instance]]
 
* [[Cloud Computing]]
 
* [[Cloud Computing]]
 
* [[Linux Howto]]
 
* [[Linux Howto]]

Latest revision as of 10:32, 27 March 2011

Kita dapat menjalankan instance langsung dari release file Ubuntu

Kita dapat menggunakan script berikut


Dalam Bentuk Shell Script untuk x86_64

cp ubuntu-10.10-server-uec-amd64.tar.gz maverick-server-uec-amd64.tar.gz 
. ~/.euca/eucarc
source ~/.euca/eucarc
TIMESTAMP=$(date +%Y%m%d%H%M%S)
RELEASE=maverick
ARCH=amd64
[ $ARCH = "amd64" ] && IARCH=x86_64 || IARCH=i386
UEC_IMG=$RELEASE-server-uec-$ARCH
[ ! -e $UEC_IMG.img ] && tar -S -xzf $UEC_IMG.tar.gz
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
ls -alF $UEC_KERNEL
BUCKET_RAMDISK="r-$TIMESTAMP"
UEC_RAMDISK=$UEC_IMG-loader
euca-bundle-image -i  $UEC_RAMDISK -r $IARCH --ramdisk true
euca-upload-bundle -b $BUCKET_RAMDISK -m /tmp/$UEC_RAMDISK.manifest.xml
ERI=$(euca-register $BUCKET_RAMDISK/$UEC_RAMDISK.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $ERI
BUCKET_IMAGE="i-$TIMESTAMP"
UEC_IMG=$RELEASE-server-uec-$ARCH
euca-bundle-image -i $UEC_IMG.img -r $IARCH --kernel $EKI --ramdisk $ERI
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
euca-run-instances $EMI -k mykey -t c1.medium
euca-describe-instances | grep i-3F8E0754

Dalam Bentuk Shell Script untuk Karmic i386

cp ubuntu-9.10-server-uec-i386.tar.gz karmic-server-uec-i386.tar.gz 
. ~/.euca/eucarc
source ~/.euca/eucarc
TIMESTAMP=$(date +%Y%m%d%H%M%S)
RELEASE=karmic
ARCH=i386
UEC_IMG=$RELEASE-server-uec-$ARCH
[ ! -e $UEC_IMG.img ] && tar -S -xzf $UEC_IMG.tar.gz
BUCKET_KERNEL="k-$TIMESTAMP"
UEC_KERNEL=$UEC_IMG-vmlinuz-virtual
euca-bundle-image -i $UEC_KERNEL -r $ARCH --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
ls -alF $UEC_KERNEL
BUCKET_RAMDISK="r-$TIMESTAMP"
UEC_RAMDISK=$UEC_IMG-initrd-virtual
euca-bundle-image -i  $UEC_RAMDISK -r $ARCH --ramdisk true
euca-upload-bundle -b $BUCKET_RAMDISK -m /tmp/$UEC_RAMDISK.manifest.xml
ERI=$(euca-register $BUCKET_RAMDISK/$UEC_RAMDISK.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $ERI
BUCKET_IMAGE="i-$TIMESTAMP"
UEC_IMG=$RELEASE-server-uec-$ARCH
euca-bundle-image -i $UEC_IMG.img -r $ARCH --kernel $EKI --ramdisk $ERI
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
euca-run-instances $EMI -k mykey -t c1.medium
euca-describe-instances

Dalam Bentuk Shell Script untuk Maverick i386

cp ubuntu-10.10-server-uec-i386.tar.gz maverick-server-uec-i386.tar.gz 
. ~/.euca/eucarc
source ~/.euca/eucarc
TIMESTAMP=$(date +%Y%m%d%H%M%S)
RELEASE=maverick
ARCH=i386
UEC_IMG=$RELEASE-server-uec-$ARCH
[ ! -e $UEC_IMG.img ] && tar -S -xzf $UEC_IMG.tar.gz
BUCKET_KERNEL="k-$TIMESTAMP"
UEC_KERNEL=$UEC_IMG-vmlinuz-virtual
euca-bundle-image -i $UEC_KERNEL -r $ARCH --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
ls -alF $UEC_KERNEL
BUCKET_RAMDISK="r-$TIMESTAMP"
UEC_RAMDISK=$UEC_IMG-loader
euca-bundle-image -i  $UEC_RAMDISK -r $ARCH --ramdisk true
euca-upload-bundle -b $BUCKET_RAMDISK -m /tmp/$UEC_RAMDISK.manifest.xml
ERI=$(euca-register $BUCKET_RAMDISK/$UEC_RAMDISK.manifest.xml | grep "^IMAGE" | awk '{print $2}') && echo $ERI
BUCKET_IMAGE="i-$TIMESTAMP"
UEC_IMG=$RELEASE-server-uec-$ARCH
euca-bundle-image -i $UEC_IMG.img -r $ARCH --kernel $EKI --ramdisk $ERI
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
euca-run-instances $EMI -k mykey -t c1.medium
euca-describe-instances

Referensi

Pranala Menarik