Building a plivo AMI

I’ve been experimenting with Amazon’s web services recently. I’ve also been playing with voice apps on both Twilio and Tropo. Then I found plivo. Happy days.

Plivo is an open source service that offers functionality comparable to the hosted services. The authors have also made it outrageously easy to install by packaging the whole thing into two easy to run scripts. There was no EC2 AMI so I set out to create one. It turns out to be fairly straightforward, and all possible through the web console.

Choose a base AMI

The first step is to choose a base AMI. I used the Ubuntu 10.04 amd64 standard AMI in the eu-west-1 region (ami-4290a636). Then I logged in, ran the plivo install commands, waited, waited some more, waited a little longer, and all was done.

Now, to secure the AMI before publishing it, I removed the ssh keys, authorized_keys, and the bash history. This is not as simple as it sounds. I also logged in from a host that I knew would show up in the “last logged in from” section.

I logged in and ran the following commands:

sudo shred -u /etc/ssh/ssh_host_*
shred -u ~/.ssh/authorized_keys
shred -u ~/.bash_history

Now I went into the web console, selected the instance, chose the Instance Actions menu and selected Create Image (EBS AMI). Then under AMIs, I selected my new image, and changed the permissions to public.

Note that in order to take a snapshot, the instance pauses for a second. During that pause, I lose my SSH connection, and having just destroyed SSH on the machine, I cannot get back in. So I have to terminate (kill) the instance and boot it a fresh from the new AMI. This creates new SSH host keys and puts my SSH key back into authorized_keys.

Elegance

I’m sure there’s a more elegant (and potentially elaborate) way of doing this. But it worked for me. It was quick and painless. Now there’s a public plivo AMI in the eu-west-1 region. I’ll look into how I get it into other regions, and if I need to pay for the storage to have it publicly available.

Result

The result is the new public ami-acd0e1d8 in the eu-west-1 region. If you choose to test the AMI, please let me know how you get on in the comments here.

4 thoughts on “Building a plivo AMI”

  1. Hey, thanks for the post. I have been testing Plivo for a few weeks on CentOS base instance. Can you comment if you could get media transmission working and XMPP setup?

    Thanks
    Digvijay

    1. I wasn’t aware that plivo worked with XMPP and I’m not sure what media transmission is. I can successfully make and receive calls through my plivo install. I’m intrigued by XMPP though, how does it relate to plivo?

  2. Callum,

    XMPP is supported on FreeSWITCH with lib dingaling. Google talk users can call the same external context (as with a DID routed over port 5080) and Plivo answers. I have tested all components on your AMI and found everything working great.

    Regards
    DigVJ

Leave a Reply

Your email address will not be published. Required fields are marked *