In past I worked for CloudScreener.com as DevOps, I had in my responsabilities clouds benchmark. Computes' performances was mesured against a lot VMs categorized by the current parameters:
- Size or flavor: Number of vCPU, RAM size and root volume size
- Image: Chosen OS
- Location: Datacenter or region
As many public clouds don't use the same technologies, they don't have the same public API, and I had to deal with all them:
- And more and more
My issue was already solved by Apache Libcloud: A Python library which hides differences between different cloud provider APIs and allows you to manage different cloud resources through a unified and easy to use API
Libcloud supports more than 30 cloud providers including computes, block storage, object storage, CDN, DNS and etc. It began in summer 2009 and is actually in version 0.18 with more than 3500 commits and 100 contributors. Its current maintener is Tomaz Muraus aka Kami, a brillant and polite guy.
Libcloud is used in many project, notably in Ansible and its cloud modules. I used it while more than 2 years and as promised it realy eased me develop a Cloud broker (sorry it's not open source). Sometimes I prefered to choose an specific library but for less know clouds like Ikoula or Gandi, I had to make code myself from their JSON/XML API or use Libcloud.
Most driver are usable by the following syntax:
from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver Driver = get_driver(Provider.FOO_CLOUD) driver = Driver('yourlogin', 'yourpassword') images = driver.list_images() sizes = driver.list_sizes() # create node with first image and first size node = driver.create_node(name='bar', image=images, size=sizes)
Authentication credentials may change for API key/secret/token or whatever, but Libcloud is made for make clouds usage unified. The same methods can be use in every clouds if they implement it. The most long is generally how to get your credentials.
It's opensource, you can contribute
I encourage everyone with an account in a cloud offer and a little skill in Python to contribute to Libcloud. There are many things to maintain, document or implement. For how to, see contributing guide.