← Back to team overview

yellow team mailing list archive

How to use EC2 and EBS snapshots to get LP running quickly

 

Gary is going to put this into the LEP.


How to mount an EBS volume on an EC2 instance

create both, make sure they are in the same availability zone
sudo mke2fs -F -j /dev/xvdf
sudo mkdir /mnt/ebs
sudo mount /dev/xvdf /mnt/ebs

To set up an EBS volume so LXC data will go there instead of the normal mount:

sudo mkdir -p /mnt/ebs/home/ubuntu
sudo cp -Rp . /mnt/ebs/home/ubuntu/
sudo mount --bind /mnt/ebs/home/ubuntu /home/ubuntu

sudo mkdir -p /mnt/ebs/var/lib/lxc
sudo mkdir /var/lib/lxc
sudo mount --bind /mnt/ebs/var/lib/lxc /var/lib/lxc

To install Launchpad in an lxc container:

cd

sudo add-apt-repository ppa:yellow/ppa
sudo add-apt-repository ppa:yellow/experimental
sudo apt-get update
sudo apt-get install lpsetup
lp-setup lxc-install --testing --full-name="Benji York"
--email="benji.york@xxxxxxxxxxxxx"

Then make a snapshot of the volume, make a new volume from the snapshot, make a
new instance and attach the new volume to the instance.

sudo apt-get install lxc
sudo mkdir /mnt/ebs
sudo mount /dev/xvdf /mnt/ebs
sudo mkdir -p /mnt/ebs/home/ubuntu
sudo mount --bind /mnt/ebs/home/ubuntu /home/ubuntu
sudo mkdir -p /mnt/ebs/var/lib/lxc
sudo mount --bind /mnt/ebs/var/lib/lxc /var/lib/lxc

-- 
Benji York