Channels ▼
RSS

Open Source

The Linode Virtual Hosting Solution


The Linode API

Perhaps the most exciting capability for developers is the recent 2.0 release of the Linode API. Due to Linode's adoption of Cold Fusion-powered middleware, the API transmits messages via both JSON and the less frequently used WDDX response formats.

In addition to the 30+ methods that can be called remotely, the Linode user community has already created API bindings for Perl, PHP, Python and Ruby. For my examination, I used TJ Fontaine's (with Ryan Tucker and other contributors) Python bindings which included a I employed its useful shell.py script to interrogate the test VM's I created:

# avail.datacenters
$ python ./shell.py --avail_datacenters
[
{
"DATACENTERID": 2,
"LOCATION": "Dallas, TX, USA"
},
{
"DATACENTERID": 3,
"LOCATION": "Fremont, CA, USA"
},
{
"DATACENTERID": 4,
"LOCATION": "Atlanta, GA, USA"
},
{
"DATACENTERID": 6,
"LOCATION": "Newark, NJ, USA"
}
]

# avail.distributions
$ python ./shell.py --avail_distributions
[
{
"IS64BIT": 0,
"CREATE_DT": "2007-10-24 00:00:00.0",
"DISTRIBUTIONID": 38,
"MINIMAGESIZE": 436,
"LABEL": "Arch Linux 2007.08"
},
{
"IS64BIT": 0,
"CREATE_DT": "2007-04-27 00:00:00.0",
"DISTRIBUTIONID": 32,
"MINIMAGESIZE": 594,
"LABEL": "Centos 5.0"
},
{
"IS64BIT": 0,
"CREATE_DT": "2008-11-30 00:00:00.0",
"DISTRIBUTIONID": 46,
"MINIMAGESIZE": 950,
"LABEL": "Centos 5.2"
},
{
"IS64BIT": 1,
"CREATE_DT": "2008-11-30 00:00:00.0",
"DISTRIBUTIONID": 47,
"MINIMAGESIZE": 980,
"LABEL": "Centos 5.2 64bit"
},
{
"IS64BIT": 0,
"CREATE_DT": "2007-04-18 00:00:00.0",
"DISTRIBUTIONID": 28,
"MINIMAGESIZE": 200,
"LABEL": "Debian 4.0"
},
{
"IS64BIT": 1,
"CREATE_DT": "2008-12-02 00:00:00.0",
"DISTRIBUTIONID": 48,
"MINIMAGESIZE": 220,
"LABEL": "Debian 4.0 64bit"
},
{
"IS64BIT": 0,
"CREATE_DT": "2009-02-19 00:00:00.0",
"DISTRIBUTIONID": 50,
"MINIMAGESIZE": 200,
"LABEL": "Debian 5.0"
},
{
"IS64BIT": 1,
"CREATE_DT": "2009-02-19 00:00:00.0",
"DISTRIBUTIONID": 51,
"MINIMAGESIZE": 300,
"LABEL": "Debian 5.0 64bit"
},
{
"IS64BIT": 0,
"CREATE_DT": "2007-11-09 00:00:00.0",
"DISTRIBUTIONID": 40,
"MINIMAGESIZE": 740,
"LABEL": "Fedora 8"
},
{
"IS64BIT": 0,
"CREATE_DT": "2008-06-09 15:15:21.0",
"DISTRIBUTIONID": 43,
"MINIMAGESIZE": 1175,
"LABEL": "Fedora 9"
},
{
"IS64BIT": 0,
"CREATE_DT": "2007-08-29 00:00:00.0",
"DISTRIBUTIONID": 35,
"MINIMAGESIZE": 1800,
"LABEL": "Gentoo 2007.0"
},
{
"IS64BIT": 0,
"CREATE_DT": "2009-03-20 00:00:00.0",
"DISTRIBUTIONID": 52,
"MINIMAGESIZE": 1500,
"LABEL": "Gentoo 2008.0"
},
{
"IS64BIT": 1,
"CREATE_DT": "2009-04-04 00:00:00.0",
"DISTRIBUTIONID": 53,
"MINIMAGESIZE": 2500,
"LABEL": "Gentoo 2008.0 64bit"
},
{
"IS64BIT": 0,
"CREATE_DT": "2008-08-21 08:32:16.0",
"DISTRIBUTIONID": 44,
"MINIMAGESIZE": 850,
"LABEL": "OpenSUSE 11.0"
},
{
"IS64BIT": 0,
"CREATE_DT": "2007-07-16 00:00:00.0",
"DISTRIBUTIONID": 34,
"MINIMAGESIZE": 315,
"LABEL": "Slackware 12.0"
},
{
"IS64BIT": 0,
"CREATE_DT": "2009-04-04 00:00:00.0",
"DISTRIBUTIONID": 54,
"MINIMAGESIZE": 500,
"LABEL": "Slackware 12.2"
},
{
"IS64BIT": 0,
"CREATE_DT": "2008-04-23 15:11:29.0",
"DISTRIBUTIONID": 41,
"MINIMAGESIZE": 400,
"LABEL": "Ubuntu 8.04 LTS"
},
{
"IS64BIT": 1,
"CREATE_DT": "2008-06-03 12:51:11.0",
"DISTRIBUTIONID": 42,
"MINIMAGESIZE": 350,
"LABEL": "Ubuntu 8.04 LTS 64bit"
},
{
"IS64BIT": 0,
"CREATE_DT": "2008-10-30 23:23:03.0",
"DISTRIBUTIONID": 45,
"MINIMAGESIZE": 220,
"LABEL": "Ubuntu 8.10"
},
{
"IS64BIT": 1,
"CREATE_DT": "2008-12-02 00:00:00.0",
"DISTRIBUTIONID": 49,
"MINIMAGESIZE": 230,
"LABEL": "Ubuntu 8.10 64bit"
},
{
"IS64BIT": 0,
"CREATE_DT": "2009-04-23 00:00:00.0",
"DISTRIBUTIONID": 55,
"MINIMAGESIZE": 350,
"LABEL": "Ubuntu 9.04"
},
{
"IS64BIT": 1,
"CREATE_DT": "2009-04-23 00:00:00.0",
"DISTRIBUTIONID": 56,
"MINIMAGESIZE": 350,
"LABEL": "Ubuntu 9.04 64bit"
}
]

# linode.list
$ python ./shell.py --linode_list
[
{
"ALERT_DISKIO_ENABLED": 1,
"BACKUPWEEKLYDAY": 0,
"LABEL": "DDJTEST",
"DATACENTERID": 2,
"ALERT_BWOUT_ENABLED": 1,
"ALERT_CPU_THRESHOLD": 90,
"TOTALHD": 16384,
"ALERT_BWQUOTA_THRESHOLD": 80,
"ALERT_BWQUOTA_ENABLED": 1,
"TOTALXFER": 200,
"STATUS": 1,
"ALERT_BWIN_ENABLED": 1,
"ALERT_BWIN_THRESHOLD": 5,
"ALERT_DISKIO_THRESHOLD": 500,
"WATCHDOG": 1,
"LINODEID": 25920,
"BACKUPWINDOW": 0,
"TOTALRAM": 360,
"LPM_DISPLAYGROUP": "",
"ALERT_BWOUT_THRESHOLD": 5,
"BACKUPSENABLED": 0,
"ALERT_CPU_ENABLED": 1
}
]

# linode.job.list
$ python ./shell.py --linode_job_list --linodeid 25920[
{
"HOST_FINISH_DT": "2009-08-09 09:23:46.0",
"LINODEID": 25920,
"JOBID": 1289221,
"ENTERED_DT": "2009-08-09 09:23:25.0",
"HOST_MESSAGE": "",
"HOST_START_DT": "2009-08-09 09:23:33.0",
"DURATION": 13,
"HOST_SUCCESS": 1,
"ACTION": "linode.boot",
"LABEL": "System Boot - My Ubuntu 9.04 64bit Profile"
},
{
"HOST_FINISH_DT": "2009-08-09 09:23:33.0",
"LINODEID": 25920,
"JOBID": 1289220,
"ENTERED_DT": "2009-08-09 09:23:11.0",
"HOST_MESSAGE": "",
"HOST_START_DT": "2009-08-09 09:23:33.0",
"DURATION": 0,
"HOST_SUCCESS": 1,
"ACTION": "fs.create",
"LABEL": "Create Filesystem - 256MB Swap Image"
},
{
"HOST_FINISH_DT": "2009-08-09 09:23:33.0",
"LINODEID": 25920,
"JOBID": 1289219,
"ENTERED_DT": "2009-08-09 09:23:11.0",
"HOST_MESSAGE": "Setting password for root... done",
"HOST_START_DT": "2009-08-09 09:23:23.0",
"DURATION": 10,
"HOST_SUCCESS": 1,
"ACTION": "fs.create.from.distro",
"LABEL": "Disk Create From Distribution - Ubuntu 9.04 64bit"
},
{
"HOST_FINISH_DT": "2009-08-08 01:34:18.0",
"LINODEID": 25920,
"JOBID": 1287547,
"ENTERED_DT": "2009-08-08 01:33:36.0",
"HOST_MESSAGE": "",
"HOST_START_DT": "2009-08-08 01:34:18.0",
"DURATION": 0,
"HOST_SUCCESS": 1,
"ACTION": "linode.create",
"LABEL": "Linode Initial Configuration"
},
{
"HOST_FINISH_DT": "2009-08-08 01:34:18.0",
"LINODEID": 25920,
"JOBID": 1287546,
"ENTERED_DT": "2009-08-08 01:33:36.0",
"HOST_MESSAGE": "",
"HOST_START_DT": "2009-08-08 01:34:18.0",
"DURATION": 0,
"HOST_SUCCESS": 1,
"ACTION": "linode.shutdown",
"LABEL": "System Shutdown"
}
]

The VM automation potential using Linode's simple, uncluttered API is huge. VM's can easily and quickly come into and out of existence based on customer demand, client configuration and application variations, testing needs and more. API keys can be generated per user, with access controls to account administrator defined objects. Compared to other VM automation interfaces, Linode's is one of the cleanest and easiest I've used, incorporating just enough of the methods necessary to automate just the right amount of VM management flexibility. Depending on the space allocated in an account, multiple VM's can be created to test variations of middleware libraries, frameworks or version changes. In fact, a good strategy when rolling out a new version would be to decouple the database into one VM instance, the static content into another and the dynamic business logic into a third. When the business logic changes, create a new VM with those changes while maintaining the older business logic VM during the testing and production transition phases. Should anything unexpected happen during the migration, rolling back to the previous state is as simple as a DNS change. Depending on the frequency of these updates, automation scripts can be wired up via API calls to accelerate the change management process. And if things should ever go haywire, Linode's 'Finnix Recovery Distro' can restore virtual machine snapshots to help ensure that no mistake is your last.

A Conversation with Linode Founder Christopher Aker

Christopher Aker founded Linode in 2003, well before the apex of the terms cloud computing and virtualization hit their respective hype curves. In this conversation, Chris talks about his insights and experiences with building a sustainable, profitable business around these 21st century computing concepts.

Dr. Dobb's: What was it about the technology that gave you the idea to build a new business around this idea?

Aker: In 2002, there were two choices for hosting: shared or dedicated. Back then, shared hosting was pricey compared to today's commoditized prices, but still a cheaper alternative to very expensive dedicated servers. However, shared hosting was limiting -- an end user did not have administrative control over the environment and was forced to use the software and tools of the provider. On the other hand, dedicated servers provided good flexibility, however were: expensive, remained grossly under-utilized, and required special hardware to perform remote reboots and out of band console access.

Virtualization enabled the power and flexibility of dedicated servers, the efficient use of hardware resources, and at shared hosting prices - the best from both worlds. Server virtualization is the natural evolution of the hosting platform, but its implications extend far beyond an alternative to shared or dedicated hardware. These are exciting times.

Dr. Dobb's: Your web-based tools are quite impressive, especially the secure AJAX-powered terminal application. What were some of the primary design drivers that helped you focus on such a functional, intuitive management interface?

Aker: One word: automation. We wanted to put the power into the user's hands, and get us (the administrators) out of the loop completely. The initial incarnations of the UI were very much derived from many iterations of trial and error. Unfortunately, I do not have a designer's eye, but I do have a talent for knowing what looks bad. :)

Dr. Dobb's: With the 2.0 release of the Linode API, you have exposed a significant portion of your services to programmatic manipulation. In addition to the various community bindings, do you plan on offering scripts or examples using Capistrano, Puppet, eBox, and others?

Aker: Provisioning a Linode through our API includes the ability to pass an SSH key, which gets configured when the Linux distribution is deployed. So, one can further automate the configuration and set up of the deployed Linode using SSH keys. However, we have plans to integrate support for "installation recipes" that can be shared via the community, and also some tools that will allow images to be imported remotely (like your local machine), or from other providers.

Dr. Dobb's: As you continue to scale more nodes, datacenter locations and distribution types, to support your growing customer base, what do you see as your biggest challenges and opportunities ahead?

Aker: It's really a matter of continuing to identify customer needs and implementing the tools that enable our customers to leverage the opportunities that the cloud computing movement provides.

—MR

Small Company, Big Potential

As of this writing, Linode has eight employees and is currently seeking additional help. Their customer base is continuing to expand and their range of service offerings and flexible OS host options is meeting the demands and expectations of the most technically savvy web application developers. Most importantly, the company has locked on the VPS provisioning angle in an innovative, approachable way that make much larger competitors look cumbersome and outdated. If you are a web developer seeking an inexpensive virtual hosting service provider, Linode should be one of the first choices on the list to consider.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 

Video