Skip to content

Upload OSv AMI from EC2 instance

amnonh edited this page Jun 23, 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

  • Run a Linux instance on EC2. Amazon Linux AMI is missing a few dependencies, so Fedora or CentOS are preferred. I tested the following on RHEL ami-5b697332
  • 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 qemu-system-x86 qemu-img maven maven-shade-plugin python-dpkt tcpdump gdb
git clone https://github.com/cloudius-systems/osv.git

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

  • 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

  • set env vars
export AWS_ACCESS_KEY_ID=my key
export AWS_SECRET_ACCESS_KEY=my access key
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/"

source

  • create a text file with the images you want to upload. For example, for release 0.09, I used the following:
v0.09-small
http://downloads.osv.io.s3.amazonaws.com/cloudius/osv/osv-v0.09.qemu.qcow2
small
v0.09
http://downloads.osv.io.s3.amazonaws.com/cloudius/osv/osv-v0.09.qemu.qcow2
large
v0.09-Cassandra
http://downloads.osv.io.s3.amazonaws.com/cloudius/osv-cassandra/osv-cassandra-v0.09.qemu.qcow2
large
v0.09-Memcached
http://downloads.osv.io.s3.amazonaws.com/cloudius/osv-memcached-opt/osv-memcached-opt-v0.09.qemu.qcow2
large
v0.09-Tomcat
http://downloads.osv.io.s3.amazonaws.com/cloudius/osv-tomcat/osv-tomcat-v0.09.qemu.qcow2
large
v0.09-IPerf
http://downloads.osv.io.s3.amazonaws.com/cloudius/osv-iperf/osv-iperf-v0.09.qemu.qcow2
large
  • Finally you are ready to upload the images
cd osv
./scripts/upload-ec2.sh < ~/images_0.09.txt

sit back and wait :)

Clone this wiki locally