How to Develop OpenStack
-
Upload
mehdi-ali-soltani -
Category
Software
-
view
61 -
download
1
Transcript of How to Develop OpenStack
![Page 1: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/1.jpg)
OPENSTACK DEVELOPMENT
HOW TO DEVELOP OPENSTACK
by
Mehdi AliSoltani
1
www.linkedin.com/in/mehdi-ali-soltani-315453b7
![Page 2: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/2.jpg)
2OPENSTACK DEVELOPMENT
Agenda
• OpenStack Services• OpenStack Architecture• Nova Architecture• Start on Codes• Messaging in OpenStack• OpenStack Libraries• Request Flow in OpenStack• OpenStack Clients
![Page 3: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/3.jpg)
3
OpenStack is a cloud operating system that controls large pools of compute, storage, and networking resources throughout a datacenter.
OPENSTACK DEVELOPMENT
What is OpenStack
![Page 4: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/4.jpg)
4OPENSTACK DEVELOPMENT
OpenStack Services
DashboardHorizon• web-based portal to
interact with underlying OpenStack services
NOVA COMPUTE LAYER• Manages the compute
instances in an OpenStack environment. Responsibilities include creating , scheduling and decommissioning of virtual machines on demand.
KEYSTONEIDENTITY• authentication and
authorization service for other OpenStack services
![Page 5: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/5.jpg)
5OPENSTACK DEVELOPMENT
OpenStack Services
CINDERBLOCK STORAGE• Provides persistent
block storage to running instances
SWIFT OBJECT STORAGE• Stores and retrieves
arbitrary unstructured data objects via a RESTful, HTTP based API
GLANCEIMAGE MANAGEMENT• Stores and retrieves
virtual machine disk images
![Page 6: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/6.jpg)
6OPENSTACK DEVELOPMENT
OpenStack Services
NEUTRONNETWORKING• Enables Network-
Connectivity-as-a-Service for other OpenStack services, such as OpenStack Compute
HEAT ORCHESTRATION
CEILOMETERTROVESAHARA
![Page 7: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/7.jpg)
7OPENSTACK DEVELOPMENT
OpenStack Architecture
![Page 8: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/8.jpg)
8OPENSTACK DEVELOPMENT
Why Develop OpenStack
OpenStack Hypervisor Support Matrix
![Page 9: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/9.jpg)
9OPENSTACK DEVELOPMENT
First Step
You should understand the codes
![Page 10: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/10.jpg)
10OPENSTACK DEVELOPMENT
OpenStack Code Architecture
![Page 11: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/11.jpg)
11OPENSTACK DEVELOPMENT
Many Teams and Many Projects
![Page 12: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/12.jpg)
12
NOVA
OPENSTACK DEVELOPMENT
NOVA
QUEUENOVA API
![Page 13: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/13.jpg)
13OPENSTACK DEVELOPMENT
Nova Architecture
![Page 14: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/14.jpg)
14OPENSTACK DEVELOPMENT
Nova Components
Nova-apisupports OpenStack Compute API, Amazon's EC2 APIcommunicated over HTTP, converts the requests to components via message queue
Nova-conductorprovides coordinationand database query support for Nova
Nova-computeA worker daemon which takes orders from its message queue and perform virtualmachine create/delete tasks using Hypervisor's API.
![Page 15: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/15.jpg)
15OPENSTACK DEVELOPMENT
Nova Components
Nova-schedulerdecides which Nova Compute Host to allot for virtual machine request
Nova-networktakes network related tasks from its message queue and performing those. OpenStack's neutron component can be opted instead of nova-network.
Message queueAll components of Nova communicate with each other in a non-blocking callback-oriented manner using AMQP protocol
![Page 16: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/16.jpg)
16
Clone a repository from: • https://git.openstack.org/openstack/<projectname>• https://github.com/openstack/<projectname>
For nova :• https://github.com/openstack/nova• https://git.openstack.org/openstack/nova
OPENSTACK DEVELOPMENT
Starting Work on Code
![Page 17: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/17.jpg)
17
OpenStack Programming Language
OPENSTACK DEVELOPMENT
You Should Know
• Python• JavaScript, JSON• Shell Script
![Page 18: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/18.jpg)
18OPENSTACK DEVELOPMENT
Messaging in OpenStack
How messages transport in OpenStack ?
![Page 19: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/19.jpg)
19
Two methods:
• OpenStack components such as Nova , Cinder , Neutron communicates internally via AMQP (Advanced Message Queue Protocol) using RabbitMQ or Qpid
• Through each other using REST-call.
OPENSTACK DEVELOPMENT
Messaging in OpenStack
![Page 20: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/20.jpg)
20
The AMQP either RabbitMQ or Qpid, sits between any two Nova components and allows them to communicate using Remote Procedure Calls (RPC )
OPENSTACK DEVELOPMENT
Message Queue in Nova
![Page 21: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/21.jpg)
21OPENSTACK DEVELOPMENT
Message Queue in Nova
• rpc.cast :don’t wait for result• rpc.call : wait for result (when
there is something to return)
![Page 22: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/22.jpg)
22OPENSTACK DEVELOPMENT
Messaging Between OpenStack Services
![Page 23: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/23.jpg)
23OPENSTACK DEVELOPMENT
OpenStack Libraries(oslo)
The Oslo project intends to produce a python library containing infrastructure code shared by OpenStack projects including :
oslo.config
oslo.concurrency
oslo.utils
oslo.serialization
oslo.messaging
oslo.i18n
![Page 24: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/24.jpg)
24OPENSTACK DEVELOPMENT
OpenStack Libraries(oslo.config)
A library for parsing configuration options from the command line and configuration files.
Parse the /etc/nova/nova.conf and convert it to cfg object
![Page 25: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/25.jpg)
25
oslo.concurrencymanaging external processes and task synchronization.
OPENSTACK DEVELOPMENT
OpenStack oslo
oslo.utilsa library that provides various low-level utility modules/code, such as fileutils, timeutils, importutils(import related utilities and helper functions)
oslo.messagingThe Oslo messaging API supports RPC
![Page 26: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/26.jpg)
26OPENSTACK DEVELOPMENT
Request Flow for Provisioning Instance
![Page 27: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/27.jpg)
27OPENSTACK DEVELOPMENT
OpenStack Clients
• Most OpenStack project provides a command-line client for each service including:
• python-glanceclient• python-novaclient• python-keystoneclient• …
![Page 28: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/28.jpg)
28
• nova boot (Create new instance)• nova reboot• nova flavor-list(Print a list of available flavors (sizes of servers))• nova resize (Resize the instance to new flavor)• ….
OPENSTACK DEVELOPMENT
Nova-client
• Nova client is for the Compute service provides a nova command-line client
• Nova client is a client for the OpenStack Nova APISome of nova commands:
![Page 29: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/29.jpg)
29OPENSTACK DEVELOPMENT
Write New API in Nova
• If you want to write new API in Nova, you should be familiar with nova client as well .
• For example nova resize , first shutdown the current instance, then change the flavor and migrate it to the new host which is selected by scheduler.
• You should know how to invoke new API by nova client
![Page 30: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/30.jpg)
30OPENSTACK DEVELOPMENT
Resize Instance on the Same Host
• Suppose we want to have our own resize instance command which allows to resize an instance on the same host if it is possible(enough resources available)
• A solutionCheck if possible to resize on place If OK, Shutdown the instanceTake a snapshot Create a new instance with the new flavor on the same
hostBoot instance with the snapshot imageDelete the old instance
![Page 31: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/31.jpg)
31
• Many commands in OpenStack novaclient following same process
• Suppose Libvirt is used as compute driver
OPENSTACK DEVELOPMENT
Command Flow
![Page 32: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/32.jpg)
32
• Account Setup: You need a Launchpad account• Join OpenStack Foundation• Log Into Gerrit Review System• Install git• Clone the codes• Working on Bugs
OPENSTACK DEVELOPMENT
How to Contribute in OpenStack
![Page 33: How to Develop OpenStack](https://reader035.fdocuments.in/reader035/viewer/2022062401/58ed37331a28ab531c8b4651/html5/thumbnails/33.jpg)
33OPENSTACK DEVELOPMENT