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

From OnnoWiki
Jump to navigation Jump to search
Line 1: Line 1:
Alternatif cara menjalankan Instance adalah sebagai berikut, kita dapat membuat script file jika dibutuhkan.
+
Alternatif cara menjalankan Instance secara batch langsung dari release file Ubuntu adalah sebagai berikut, kita dapat membuat script file jika dibutuhkan.
 +
 
  
 
==Dalam Bentuk Shell Script untuk x86_64==
 
==Dalam Bentuk Shell Script untuk x86_64==
Line 12: Line 13:
 
  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_KERNEL="k-$TIMESTAMP"
 
  BUCKET_KERNEL="k-$TIMESTAMP"
 
  UEC_KERNEL=$UEC_IMG-vmlinuz-virtual
 
  UEC_KERNEL=$UEC_IMG-vmlinuz-virtual
Line 19: Line 19:
 
  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"
 
  BUCKET_RAMDISK="r-$TIMESTAMP"
 
  UEC_RAMDISK=$UEC_IMG-loader
 
  UEC_RAMDISK=$UEC_IMG-loader
Line 25: Line 24:
 
  euca-upload-bundle -b $BUCKET_RAMDISK -m /tmp/$UEC_RAMDISK.manifest.xml
 
  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
 
  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
Line 45: Line 43:
 
  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_KERNEL="k-$TIMESTAMP"
 
  BUCKET_KERNEL="k-$TIMESTAMP"
 
  UEC_KERNEL=$UEC_IMG-vmlinuz-virtual
 
  UEC_KERNEL=$UEC_IMG-vmlinuz-virtual
Line 52: Line 49:
 
  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"
 
  BUCKET_RAMDISK="r-$TIMESTAMP"
 
  UEC_RAMDISK=$UEC_IMG-initrd-virtual
 
  UEC_RAMDISK=$UEC_IMG-initrd-virtual
Line 58: Line 54:
 
  euca-upload-bundle -b $BUCKET_RAMDISK -m /tmp/$UEC_RAMDISK.manifest.xml
 
  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
 
  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
Line 78: Line 73:
 
  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_KERNEL="k-$TIMESTAMP"
 
  BUCKET_KERNEL="k-$TIMESTAMP"
 
  UEC_KERNEL=$UEC_IMG-vmlinuz-virtual
 
  UEC_KERNEL=$UEC_IMG-vmlinuz-virtual
Line 85: Line 79:
 
  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"
 
  BUCKET_RAMDISK="r-$TIMESTAMP"
 
  UEC_RAMDISK=$UEC_IMG-loader
 
  UEC_RAMDISK=$UEC_IMG-loader
Line 91: Line 84:
 
  euca-upload-bundle -b $BUCKET_RAMDISK -m /tmp/$UEC_RAMDISK.manifest.xml
 
  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
 
  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

Revision as of 10:41, 28 December 2010

Alternatif cara menjalankan Instance secara batch langsung dari release file Ubuntu adalah sebagai berikut, kita dapat membuat script file jika dibutuhkan.


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