Overview of Cloud Standard APIs and Contextualization Methods

Slide Note
Embed
Share

Explore the different aspects of cloud standard APIs, contextualization methods, and specific provider APIs. Understand the functionalities, management techniques, and challenges associated with using standard APIs in cloud computing environments. Learn about OCCI, cloud bursting, and federation for seamless cloud management across various platforms.


Uploaded on Sep 12, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Cloud Standard API and Contextualization XIANGHU ZHAO IHEP COMPUTING CENTER 2016 BESIIICGEM CLOUD COMPUTING SUMMER SCHOOL

  2. 2 Content Cloud Standard API OCCI EC2 Other approaches Contextualization Cloud-init

  3. 3 Cloud Standard API

  4. 4 Cloud API Cloud API (Application Programming Interfaces) API through network Almost all based on the HTTP protocol Independent on programming language RESTful / XML-RPC / SOAP / Cloud SDK (Software Development Kit) Provide easy access to cloud API There could be implementations for different programming languages

  5. 5 Cloud Provider Specific API Specific for a certain type of cloud manager Full functionalities to manage the cloud Web portal and command lines are normally running upon cloud specific API Each cloud manager usually has its own type of API OpenNebula OCA (XML-RPC) OpenStack Nova API (REST) Aliyun

  6. 6 Cloud Standard API There may be hundreds types of cloud in the world All clouds are providing similar functionalities Instance, image, keypair, block storage, network It is possible to use a unique way to manage different cloud types Cross-platform Control different cloud types with the same interface Program only once, manage cloud from everywhere Easier to deal with cloud bursting and federation Both situation involve more than one cloud

  7. 7 Use Cloud Standard API Need extra configuration or installation for the cloud Provide functionality by a particular component or extension Not natively supported Need installation of some intermediate services Not full-featured API for a specified cloud General design won t cover everything for all the cloud characteristics Less functionality or other limitations vs cloud specific APIs

  8. 8 OCCI

  9. 9 Introduction to OCCI Open Cloud Computing Interface Protocol and API for management of cloud service resources OCCI is an open specification Need implementations to put it into practice Used as the second API for clouds

  10. 10 OCCI in Action

  11. 11 rOCCI rOCCI is a modular Framework for OCCI written in ruby Current supported backends OpenNebula EC2 Include 4 components rOCCI-core rOCCI-api (SDK) rOCCI-cli (Command tool) rOCCI-server https://github.com/EGI-FCTF/rOCCI

  12. 12 Adding OCCI Support for OpenNebula Install rOCCI-server for OpenNebula rOCCI-server is actually a web service Based on Ruby on Rails framework rOCCI-server Could be located on any server Virtual machine is also OK Configure the web server apache / nginx / Installation details https://wiki.egi.eu/wiki/rOCCI:ROCCI- server_Admin_Guide

  13. 13 rOCCI Command Line rOCCI-cli is a ready-to-use shell client for OCCI enabled services Based on rOCCI-api Provide full features to access rOCCI server Installation Need Ruby >= 1.9.3 gem install occi-cli

  14. 14 rOCCI-cli Examples List all image resources (templates in OpenNebula) occi -s --endpoint https://<ENDPOINT>:<PORT>/ --action list --resource os_tpl --auth basic --username <username> --password <password> Resource types (CPU, Memory, ) occi -s --endpoint https://<ENDPOINT>:<PORT>/ --action list --resource resource_tpl --auth basic --username <username> --password <password> occi -s --endpoint https://<ENDPOINT>:<PORT>/ --action describe --resource resource_tpl#small --auth basic -- username <username> --password <password>

  15. 15 rOCCI-cli Examples List all VM instances occi -s --endpoint https://<ENDPOINT>:<PORT>/ --action list --resource compute --auth basic Create a new VM instances occi -s --endpoint https://<ENDPOINT>:<PORT>/ --action create --resource compute --mixin os_tpl#<tpl_name> - -attribute occi.core.title="<name>" --auth basic Detail information about the VM instance occi -s --endpoint https://<ENDPOINT>:<PORT>/ --action describe --resource /compute/<OCCI_ID> --auth basic

  16. 16 EC2

  17. 17 Introduction to EC2 API EC2 API is original used for management of Amazon EC2 (Amazon Elastic Compute Cloud) Became a kind of standard by the powerful influence of AWS in cloud computing It is widely supported by many cloud managers especially open source cloud projects

  18. 18 EC2 SDK Example (python) A simple example using boto3 SDK to access AWS EC2

  19. 19 Tools for EC2 API Amazon EC2 command line tools EC2 official tools written in java euca2ools Compatible with Amazon EC2 and IAM APIs Good tool for testing EC2 functionalities econe tools provided by OpenNebula Suitable for testing the OpenNebula econe service

  20. 20 Configure EC2 in OpenNebula Adapt the configuration file /etc/one/econe.conf Start econe service econe-server start EC2_ACCESS_KEY is the user name EC2_SECRET_KEY is the SHA1 hashed password oneuser show user-name Detailed configuration http://docs.opennebula.org/4.14/advanced_administr ation/public_cloud/ec2qcg.html

  21. 21 econe Commands econe is providing EC2 API for OpenNebula Common environments for econe commands EC2_URL EC2_ACCESS_KEY EC2_SECRET_KEY Image

  22. 22 econe Commands Instances

  23. 23 Other Approaches

  24. 24 Unified API from Client Side Interacting with many cloud service providers using a unified API Provide different drivers for many clouds Expose consistent API for the user Do not need to change anything from the cloud side Use the native way to talk to cloud Related projects Apache Libcloud (python) Fog (ruby) Apache Deltacloud Libcloud REST

  25. 25 Libcloud Python library for interacting with many of the popular cloud service providers using a unified API Supports more than 50 providers Driver could be changed to accommodate different clouds

  26. 26 Deltacloud Provide a REST-based API for simple any-platform access Hide all cloud specific details behind the deltacloud server Need to maintain a deltacloud service

  27. 27 There is No Silver Bullet for Cloud API There are always many choices for you Choose the one fits your needs best Supported cloud types The way to manage the cloud Need for cloud specific features

  28. 28 Contextualizat ion

  29. 29 What is Contextualization Contextualization provides boot time customization for cloud and virtualization instances Service runs early during boot, retrieves user data from an external provider and performs actions Very useful when doing automation jobs Build various instances on your request even from the same image

  30. 30 Contextualization Methods Amiconfig HEPIX Cloud-init Vmcontext in OpenNebula

  31. 31 Cloud-init Cloud-init is trying to rule the whole world of contextualization General purpose solution Support different linux distributions Support different cloud Data source from different cloud managers ISO context OpenNebula Meta-data service AWS, OpenStack Modular and highly configurable

  32. 32 What can cloud-init Do You may already be using it! Injects SSH keys Configures network Grows root filesystems Other module support tasks such as Setting the hostname Setting the root password Setting locale and time zone Running custom scripts

  33. 33 Cloud-init Modules Cloud-init has modules for handling: Disk configuration Command execution Creating users and groups Package management Writing content files Bootstrapping Chef/Puppet Additional modules can be written in Python if desired.

  34. 34 Cloud-init with User-data Cloud-init s behavior can be configured via user- data User-data can be given by the user at instance launch time Supported user data formats: Shell scripts (starts with #!) Cloud config files (starts with #cloud-config) Standard YAML syntax available for many common configuration operations. MIME multipart archive Combine the above and more

  35. 35 Data Categories All data are located under /var/lib/cloud by default meta-data is provided by the cloud platform user-data is a chunk of arbitrary data the user provides

  36. 36 Examples User-data Examples Upgrading and installing packages: #cloudconfig package_upgrade: true packages: - git - screen - vimenhanced

  37. 37 Examples Run an arbitrary command: #cloudconfig runcmd: - [ ls, -l, / ] - ls -l /root - [ wget, "http://slashdot.org", -O, /tmp/index.html ] Or: #!/bin/bash ls -l / ls -l /root wget http://Slashdot.org -O /tmp/index.html

  38. 38 Enable Cloud-init in Image Must create instance with a cloud-init enabled image Install cloud-init package via package manager in the guest OS Enable EPEL repository and install yum install cloud-init Check if service is correctly configured chkconfig --list cloud-init Remove directory /var/lib/cloud if exists Take snapshot from the above instance

  39. 39 How does it work - OpenNebula Try to find the CONTEXT ISO disk created by OpenNebula Find the context.sh file in the ISO image Configure the network with the variables Get the USER_DATA and consider it as cloud-init user-data (optionally decode with base64)

  40. 40 Cloud-init Configuration for OpenNebula Need a little modification of configuration The default behavior will try to get user-data from meta-data service Use the OpenNebula data source Edit /etc/cloud/cloud.cfg in VM and add: This will tell cloud-init to get user-data from ISO context

  41. 41 Set USER_DATA in OpenNebula Add USER_DATA variable in the template

  42. 42 How does it work - OpenStack / AWS EC2 Accesses metadata service at http://169.254.169.254/latest/meta-data http://169.254.169.254/latest/user-data NAT rules on your network controller make this work. Service provided by nova-api / nova-metadata-api (accessed via per-router neutron-metadata-proxy when using Neutron).

  43. 43 Thanks

Related


More Related Content