Your SlideShare is downloading. ×
Apache Libcloud
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Apache Libcloud

793
views

Published on

An introduction to Apache libcloud, a python module to abstract the differences in cloud providers API.

An introduction to Apache libcloud, a python module to abstract the differences in cloud providers API.

Published in: Technology

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
793
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
18
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Sebastien Goasguen, @sebgoa Apache libcloud
  • 2. Background
  • 3. The Ten areas covered by the 60 core WS-* Specifications WS-* Specification Area Typical Grid/Web Service Examples 1: Core Service Model XML, WSDL, SOAP 2: Service Internet WS-Addressing, WS-MessageDelivery; Reliable Messaging WSRM; Efficient Messaging MOTM 3: Notification WS-Notification, WS-Eventing (Publish- Subscribe) 4: Workflow and Transactions BPEL, WS-Choreography, WS-Coordination 5: Security WS-Security, WS-Trust, WS-Federation, SAML, WS-SecureConversation 6: Service Discovery UDDI, WS-Discovery 7: System Metadata and State WSRF, WS-MetadataExchange, WS-Context 8: Management WSDM, WS-Management, WS-Transfer 9: Policy and Agreements WS-Policy, WS-Agreement 10: Portals and User Interfaces WSRP (Remote Portlets) Web 2.0 Grids and Parallel Computing, Geoffrey Fox
  • 4. WS-* Areas and Web 2.0 WS-* Specification Area Web 2.0 Approach 1: Core Service Model XML becomes optional but still useful SOAP becomes JSON RSS ATOM WSDL becomes REST with API as GET PUT etc. Axis becomes XmlHttpRequest 2: Service Internet No special QoS. Use JMS or equivalent? 3: Notification Hard with HTTP without polling– JMS perhaps? 4: Workflow and Transactions (no Transactions in Web 2.0) Mashups, Google MapReduce Scripting with PHP JavaScript …. 5: Security SSL, HTTPAuthentication/Authorization, OpenID is Web 2.0 Single Sign on 6: Service Discovery http://www.programmableweb.com 7: System Metadata and State Processed by application – no system state – Microformats are a universal metadata approach 8: Management==Interaction WS-Transfer style Protocols GET PUT etc. 9: Policy and Agreements Service dependent. Processed by application 10: Portals and User Interfaces Start Pages, AJAX and Widgets(Netvibes) Gadgets
  • 5. No more EC2 SOAP
  • 6. GCE is RESTfull
  • 7. Standards and de-facto standards
  • 8. Adapters Client side
  • 9. Interfaces e.g EC2 interface to CloudStack: ec2stack e.g GCE interface to CloudStack: gstack Server side
  • 10. Libcloud API
  • 11. libcloud • Python module that provides a Cloud Provider API abstraction • Ability to write apps using multiple providers • Now with an improved CloudStack driver
  • 12. Functionality Manages: • Compute nodes • Data volumes • DNS • Load balancers
  • 13. DNS providers 6 providers: • Route53 • Rackspace • Linode • Zerigo • Gandi • hostvirtual
  • 14. LB providers 7 providers: • EC2 ELB • CloudStack • Rackspace • Ninefold • gce • Gogrid • brightbox
  • 15. Compute Providers 40 providers including: • CloudStack • OpenStack • Opennebula • Rackspace • EC2 • GCE
  • 16. Installation pip install apache-libcloud Or from source: git clone https://git-wip- us.apache.org/repos/asf/libcloud.git python ./setup.py install
  • 17. Test installation $ python Python 2.7.5 (default, May 19 2013, 13:26:46) [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import libcloud
  • 18. Base API Base Classes • Node() • NodeImage() • NodeSize() • NodeLocation() • StorageVolume() • NodeDriver()
  • 19. Base API Base Methods • list_nodes() • list_images() • list_sizes() • list_locations() • create_node() • destroy_node() • create_volume() • …..
  • 20. New API • list_key_pairs() • create_key_pair() • get_key_pair() • delete_key_pair() • Possible to promote new API as soon as there is support in several providers.
  • 21. Deploying nodes Create a node and execute a script to configure it deploy_node() script=ScriptDeployment(wordpress) msd = MultiStepDeployment([script]) deploy_node(name='apachecon',image=image,siz e=size,ex_keyname=mykey,pub_key_identity=</p ath/to/key>,deploy=msd)
  • 22. Contributing to libcloud http://docs.libcloud.apache.org
  • 23. Github integration http://github.com/apache/libcloud
  • 24. CloudStack Driver Apache Libcloud
  • 25. Ecosystem Contributing to Apache CloudStack
  • 26. API
  • 27. Extension methods For specific drivers, e.g: def ex_list_networks() def ex_create_security_group(self, name, description)
  • 28. CloudStack + libcloud from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver Driver = get_driver(Provider.CLOUDSTACK) conn=Driver(key=apikey,secret=secretkey,secure=T rue,host=host,path=path)
  • 29. CloudStack/libcloud basics conn.list_locations() images=conn.list_images() offerings=conn.list_sizes() conn.list_nodes() conn.create_node(name='yoyo’, image=images[0], size=offerings[0], extra_args={'keypair':’testkey'})
  • 30. CloudStack basic zones Instances isolated at Layer 3 through security groups Usual access to instances through ssh key pairs. Similar to AWS EC2
  • 31. CloudStack Basic Zone conn.ex_list_security_groups() conn.ex_create_security_group(name=’libcloud') conn.ex_authorize_security_group_ingress(security groupname=’libcloud',protocol='TCP',startport=22, cidrlist='0.0.0.0/0') conn.ex_delete_security_group(’libcloud’)
  • 32. CloudStack Advanced Zone Creates isolated guest networks (L2 isolation). Need to manage IP and port forwarding rules, possibly NAT and firewalls.
  • 33. Advanced zone ex_list_networks() ex_list_public_ips() ex_create_port_forwarding_rule() ex_create_ip_forwarding_rule() ex_allocate_public_ip() ex_release_public_ip()
  • 34. CloudStack “inherited” Drivers Apache Libcloud
  • 35. KTUCloud
  • 36. iKoula http://www.ikoula.com
  • 37. Exoscale http://exoscale.ch
  • 38. from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver Driver = get_driver(Provider.IKOULA) conn = Driver(key=apikey, secret=secretkey)
  • 39. from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver apikey = os.getenv('EXOSCALE_API_KEY') secretkey = os.getenv('EXOSCALE_SECRET_KEY') Driver = get_driver(Provider.EXOSCALE) conn = Driver(key=apikey, secret=secretkey)
  • 40. Time for Demos ? Apache Libcloud
  • 41. Conclusions • Use libcloud to abstract API differences. • Useful if you are using multiple cloud providers • Actively developed and easy to contribute to • @libcloud • dev@libcloud.apache.org