Create the volume and assign it to your instance

Attach it to your Centos 5.2 instance

yum install xfsprogs

according to Thread: Debian Lenny and XFS causes kernel panic: Suggested Workaround

mkfs.xfs -l version=1 /dev/sdh

insert into /etc/fstab

/dev/sdh /vol/shared xfs noatime 0 0

mount the volume

mount /vol/shared

Setup ec2-extra-tools

copy over your EC2_CERT and EC2_PRIVATE_KEY

setup /etc/profile.d/ec2.sh

export EC2_HOME=/home/ec2 
export EC2_CERT=/root/.ec2/cert-xxx.pem
export EC2_PRIVATE_KEY=/root/.ec2/pk-xxx.pem
export AWS_ACCOUNT_NUMBER=
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export PATH=$PATH:/home/ec2/bin/

install http://github.com/cmer/ec2-extra-tools/tree/master

add the binaries to e.g. /home/ec2/bin/

test the setup with:

ec2-xfs-snapshot /dev/sdh

sample output:

[root@domU-XX-XX-XX-XX-XX-XX:~/] ec2-xfs-snapshot /dev/sdh
device: /dev/sdh
mount point: /vol/shared
ec2-volume-id: vol-67890a

Freezing XFS volume...

Creating snapshot...
SNAPSHOT        snap-b99bh1d8   vol-67890a    pending 2009-03-06T14:56:17+0000
Unfreezing XFS volume...

Done!

Setup cron


crontab -e
SHELL=/bin/bash
PATH=/usr/bin:/bin:/usr/sbin
5 20 * * * source /etc/profile.d/java.sh; source /etc/profile.d/ec2.sh ; \ 
ec2-xfs-snapshot /dev/sdh >> /var/log/ebs_snapshots  2>> /var/log/ebs_snapshots

you need both: java.sh and ec2.sh for the amazon tools.

Interested in Cloud or Chef Trainings? Have a look at our Commandemy Trainings page. Need help migrating to the cloud? Check out Infralovers.

comments powered by Disqus
Blog Tags