AWS: Python環境を作ってBundleをS3に保存する
domU-12-31-39-03-44-94:~# aptitude update
domU-12-31-39-03-44-94:~# aptitude safe-upgrade
udev upgrade は
domU-12-31-39-03-44-94:~# aptitude install curl subversion
domU-12-31-39-03-44-94:~/bin# dpkg-reconfigure locales
デフォルトはja_JP.UTF-8
domU-12-31-39-03-44-94:~/bin# aptitude install sudo
domU-12-31-39-03-44-94:~/bin# aptitude install wget curl -y
domU-12-31-39-03-44-94:~/bin# aptitude install build-essential make gcc
g++ bison -y
domU-12-31-39-03-44-94:~/bin# aptitude install lsof locate ntpdate unzip
screen dnsutils openssh-client openssh-server -y
domU-12-31-39-03-44-94:~/bin# sudo aptitude install python2.5
python2.5-dbg python2.5-dev python-setuptools vim-python -y
domU-12-31-39-03-44-94:~/bin# easy_install-2.5
virtualenvdomU-12-31-39-03-44-94:~/bin# easy_install-2.5 virtualenvwrapper
#!/bin/bash
#
MANIFEST_FOLDER=/mnt/`date +"%Y%m%d"`
USER=XXXXXXXXX
KEY=$HOME/.ec2/pk-**********************.pem
CERT=$HOME/.ec2/cert-**********************..pem
BACKET=hdknr
ACCESS_KEY=KKKKKKKKKKKKKKKKK
SECRET_KEY=SSSSSSSSSSSSSSSSSSSSSSSSSSS
ARCHITECTURE=i386
#
echo "Making $MANIFEST_FOLDER for directory"
mkdir -p $MANIFEST_FOLDER
#
echo "Creating bundle of this instance....."
#ec2-bundle-vol -d $MANIFEST_FOLDER -k $KEY -c $CERT -u $USER -r
$ARCHITECTURE
#
echo "Transfering bundle to the backet...."
ec2-upload-bundle -b $BACKET -d $MANIFEST_FOLDER -m
$MANIFEST_FOLDER/image.manifest.xml -a $ACCESS_KEY -s $SECRET_KEY 実行。 domU-12-31-39-03-44-94:~/bin/Aws# ./create_image.sh
Making /mnt/20091205 for directory
Creating bundle of this instance.....
Copying / into the image file /mnt/20091205/image...
Excluding:
/selinux
/sys
/proc
/dev/pts
/dev
/media
/mnt
/proc
/sys
/etc/udev/rules.d/70-persistent-net.rules
/etc/udev/rules.d/z25_persistent-net.rules
/mnt/20091205/image
/mnt/img-mnt
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.002583 s, 406 MB/s
mke2fs 1.41.9 (22-Aug-2009)
Bundling image file...
Splitting /mnt/20091205/image.tar.gz.enc...
Created image.part.00
Created image.part.01
Created image.part.02
Created image.part.03
Created image.part.04
Created image.part.05
Created image.part.06
Created image.part.07
Created image.part.08
Created image.part.09
Created image.part.10
Created image.part.11
Created image.part.12
Created image.part.13
Created image.part.14
Created image.part.15
Created image.part.16
Created image.part.17
Created image.part.18
Created image.part.19
Created image.part.20
Created image.part.21
Created image.part.22
Created image.part.23
Created image.part.24
Generating digests for each part...
Digests generated.
Unable to read instance meta-data for product-codes
Creating bundle manifest...
ec2-bundle-vol complete.
Transfering bundle to the backet.... Transfering bundle to the backet....
Uploading bundled image parts to the S3 bucket hdknr ...
Uploaded image.part.00
Uploaded image.part.01
Uploaded image.part.02
Uploaded image.part.03
Uploaded image.part.04
Uploaded image.part.05
Uploaded image.part.06
Uploaded image.part.07
Uploaded image.part.08
Uploaded image.part.09
Uploaded image.part.10
Uploaded image.part.11
Uploaded image.part.12
Uploaded image.part.13
Uploaded image.part.14
Uploaded image.part.15
Uploaded image.part.16
Uploaded image.part.17
Uploaded image.part.18
Uploaded image.part.19
Uploaded image.part.20
Uploaded image.part.21
Uploaded image.part.22
Uploaded image.part.23
Uploaded image.part.24
Uploading manifest ...
Uploaded manifest.
Bundle upload completed.


Stumble It!
:: 

