Skip to content

Upload OSv AMI from EC2 instance

Tzach Livyatan edited this page Aug 28, 2014 · 7 revisions

The following describe the steps require to set up a working OSv dev machine on EC2, including AWS related tools, and use it to create OSv AMIs. Uploading images from EC2 is much faster and cheaper than from a local machine.

Setting a OSv dev environment on EC2

1. Run a Linux instance on EC2. You can either launch a Fedora or CentOS and follow steps 2-4 below, or a launch a preset dev AMI with all the required installation, and jump to step 5.

2. connect to the instance

ssh -i key-pair.pem ec2-user@your-instance-ip

and run the following

sudo yum install git
sudo yum install ant autoconf automake boost-static gcc-c++ genromfs libvirt libtool flex bison 
sudo yum install qemu-system-x86 qemu-img maven maven-shade-plugin python-dpkt tcpdump gdb
git clone https://github.com/cloudius-systems/osv.git
git submodule update --init --recursive

source

install AWS CLI tool

$ wget https://s3.amazonaws.com/aws-cli/awscli-bundle.zip
$ unzip awscli-bundle.zip
$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

source

3. Install EC2 tools

$ wget http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip
$ sudo mkdir /usr/local/ec2
$ sudo unzip ec2-api-tools.zip -d /usr/local/ec2

source

4. set env vars export EC2_HOME=/usr/local/ec2/ec2-api-tools-1.6.14.1/ export JAVA_HOME="/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/"

5. set EC2 env vars

export AWS_ACCESS_KEY_ID=my key
export AWS_SECRET_ACCESS_KEY=my access key

source

6. create a text file ~/images.txt with the images you want to upload. For example, for release 0.09, I used the following:

v0.12-small
http://downloads.osv.io.s3.amazonaws.com/cloudius/osv/osv-v0.12.qemu.qcow2
small
v0.12
http://downloads.osv.io.s3.amazonaws.com/cloudius/osv/osv-v0.12.qemu.qcow2
large
v0.12-Cassandra
http://downloads.osv.io.s3.amazonaws.com/cloudius/osv-cassandra/osv-cassandra-v0.12.qemu.qcow2
large
v0.12-Memcached
http://downloads.osv.io.s3.amazonaws.com/cloudius/osv-memcached-opt/osv-memcached-opt-v0.12.qemu.qcow2
large
v0.12-Tomcat
http://downloads.osv.io.s3.amazonaws.com/cloudius/osv-tomcat/osv-tomcat-v0.12.qemu.qcow2
large
v0.12-IPerf
http://downloads.osv.io.s3.amazonaws.com/cloudius/osv-iperf/osv-iperf-v0.12.qemu.qcow2
large
v0.12-Redis-memonly
http://downloads.osv.io.s3.amazonaws.com/cloudius/osv-redis-memonly/osv-redis-memonly-v0.12.qemu.qcow2
large

7. Finally you are ready to upload the images

cd osv
./scripts/upload-ec2.sh < ~/images.txt

sit back and wait :)

Clone this wiki locally