SlideShare a Scribd company logo
1 of 19
Download to read offline
Hacking on
OpenStack’s
Nova Source Code

2012-01-08




Luo, Zhongyue
zhongyue@staff.sina.com.cn
TODO
 Intro
 The source code structure of Nova
     File structure
     Component architecture
 An example
 Contributing
 Conclusion


                                     2
Intro


        What is OpenStack? and Nova?

 WHY shoud I listen to this?
   Can we actually hack the code in 30min?

         Why should I trust this guy?


                                             3
Source code structure of Nova


         Macro vs Micro(DIY)
               File structure

         Component architecture

  File structure ↔ Component architecture


                                            4
But first...terminologies
  Service
  Topic
  Nova component → Service.create(Topic)
  Manager (abst) ⊂ Nova component
  Drivers (impl) ⊂ Manager
      ex) lvm, qemu, xen, hyperV
  Lazy plugging → Value based module loading
  AMQP → Advanced Message Queue Protocol
  API → REST & Inner                           5
File structure
                  ”start”
                ”configs”
                ”helpers”
       ”REST”               ”is a topic”



                            ”is a topic”



                            ”is a topic”



                            ”is a topic”




                                           6
Component architecture
   Tenant
            http://nova.openstack.org/nova.concepts.html




                                                           7
Component architecture    ”/etc/nova/nova.conf”




         ”ec2”, ”osapi”




                                            8
”network”


?

?



                9
Component structure
                  ”network”
                           Network service
                                      Periodic    Topic: network
                                      task

                      Manager


                                                 Driver: linux_net



                                  Reads message from Queue
                                  Returns results back to DB or queue
                                  Calls inner APIs
        Network API
                            Looks up DB
                            Sends message to Service via queue
                            - Cast: Send and forget
                            - Call: Send and wait                    10
Component architecture revisited



                         DB


       API

             API
                                    Queue
                   API

                              API

    WSGI


                                            11
An example


Let’s allocate a
floating-ip to an
instance with a fixed-ip
                                   DB

   ”compute API”
                 API
             1         API
                                                         Queue
                             API
                                   Allocate 10.2.3.11 to a-fake-uuid?
                                        API
                                       Do you have permission?
           WSGI                     I wonder if a-fake-uuid exists...
                                          I’ll ask compute API.

POST /v2/a-fake-tenant/servers/a-fake-uuid/action                       12
An example


     Yup, a-fake-uuid is valid.
Oh, and its fixed-ip is 192.168.0.8.
 Take it from here network API!

                                       2         DB

    ”compute API”
                   API

                         3   API
                                                            Queue
                     ”network API”         API

                                                      API

              WSGI


                                                                    13
An example
                                                          ”nova-network”


So translate 192.168.0.8 to 10.2.3.11?                                  Go check your mail.
      I’ll tell nova-network to run
         ”associate_floating_ip”.
          Ok, my casting is done.
                                           DB                   I got a message! It says...
                                                              Dear manager,
   ”compute API”                                                 ”associate_floating_ip”
                  API                                     5
                            API                       4        Queue
                    ”network API”    API

                                                API

             WSGI


                                                                                          14
An example
                                                     ”nova network”

                                                                   7   iptables


                                           6
                                      DB                 192.168.0.8 ↔ 10.2.3.11
                                                            DB update...Done.
”compute API”                                          Running iptables-save...Done.
            API

                       API
                                                        Queue
                ”network API”   API

                                               API

        WSGI


                                                                                  15
An example
                                                             ”nova network”




Did the allocation
                             a-fake-uuid: 192.168.0.8 ↔ 10.2.3.11
finish?
                                   2         DB

   ”compute API”
                 API    3
             1              API
                                                                Queue
                   ”network API”       API                Here’s the details of a-fake-uuid.
               4                                  API
                                   You want to see if the allocation was a success?
           WSGI
                                           I’ll check with compute API...

GET /v2/a-fake-tenant/servers/a-fake-uuid                                                  16
OpenStack Nova architecture
                                                      ”nova network”



                      ”nova volume”
                                                                  ”nova compute”


                                     DB

 ”compute API”
            API

                      API
                                ”scheduler API”           Queue
               ”network API”   API                                 ”nova scheduler”
                                          API

        WSGI                               ”volume API”


                                                                                17
Contributing
 LaunchPad
     http://launchpad.net/~openstack
     Join mailing lists
 Documents
     http://docs.openstack.org/
 More info
     http://wiki.openstack.org/HowToContribute



                                                 18
Conclusion

 Structure of code and components of Nova

               An example

            How to get involved

 http://github.com/lzyeval/talk-COSUG-2012

      http://launchpad.net/~lzyeval

                                             19

More Related Content

What's hot

Introduction To OpenStack
Introduction To OpenStackIntroduction To OpenStack
Introduction To OpenStackHaim Ateya
 
CloudStack vs OpenStack
CloudStack vs OpenStackCloudStack vs OpenStack
CloudStack vs OpenStackVictor Zhang
 
Service Mesh on Kubernetes with Istio
Service Mesh on Kubernetes with IstioService Mesh on Kubernetes with Istio
Service Mesh on Kubernetes with IstioMichelle Holley
 
OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드
OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드
OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드Ian Choi
 
Introduction to OpenStack
Introduction to OpenStackIntroduction to OpenStack
Introduction to OpenStackEdureka!
 
Introduction to OpenStack Cinder
Introduction to OpenStack CinderIntroduction to OpenStack Cinder
Introduction to OpenStack CinderSean McGinnis
 
Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes NetworkingCJ Cullen
 
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-RegionJi-Woong Choi
 
OpenStack High Availability
OpenStack High AvailabilityOpenStack High Availability
OpenStack High AvailabilityJakub Pavlik
 
DevOps with Ansible
DevOps with AnsibleDevOps with Ansible
DevOps with AnsibleSwapnil Jain
 
Modular Layer 2 In OpenStack Neutron
Modular Layer 2 In OpenStack NeutronModular Layer 2 In OpenStack Neutron
Modular Layer 2 In OpenStack Neutronmestery
 
Docker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopDocker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopSathish VJ
 
An Intrudction to OpenStack 2017
An Intrudction to OpenStack 2017An Intrudction to OpenStack 2017
An Intrudction to OpenStack 2017Haim Ateya
 
Devops - Microservice and Kubernetes
Devops - Microservice and KubernetesDevops - Microservice and Kubernetes
Devops - Microservice and KubernetesNodeXperts
 
KVM and docker LXC Benchmarking with OpenStack
KVM and docker LXC Benchmarking with OpenStackKVM and docker LXC Benchmarking with OpenStack
KVM and docker LXC Benchmarking with OpenStackBoden Russell
 
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?OpenStack Korea Community
 

What's hot (20)

Openstack 101
Openstack 101Openstack 101
Openstack 101
 
Introduction To OpenStack
Introduction To OpenStackIntroduction To OpenStack
Introduction To OpenStack
 
Openstack nova
Openstack novaOpenstack nova
Openstack nova
 
CloudStack vs OpenStack
CloudStack vs OpenStackCloudStack vs OpenStack
CloudStack vs OpenStack
 
Service Mesh on Kubernetes with Istio
Service Mesh on Kubernetes with IstioService Mesh on Kubernetes with Istio
Service Mesh on Kubernetes with Istio
 
OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드
OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드
OpenStack을 중심으로 한 오픈 소스 & 상용 하이브리드 클라우드
 
Introduction to OpenStack
Introduction to OpenStackIntroduction to OpenStack
Introduction to OpenStack
 
Introduction to OpenStack Cinder
Introduction to OpenStack CinderIntroduction to OpenStack Cinder
Introduction to OpenStack Cinder
 
Ansible
AnsibleAnsible
Ansible
 
Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes Networking
 
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
[오픈소스컨설팅] Open Stack Ceph, Neutron, HA, Multi-Region
 
OpenStack High Availability
OpenStack High AvailabilityOpenStack High Availability
OpenStack High Availability
 
DevOps with Ansible
DevOps with AnsibleDevOps with Ansible
DevOps with Ansible
 
Modular Layer 2 In OpenStack Neutron
Modular Layer 2 In OpenStack NeutronModular Layer 2 In OpenStack Neutron
Modular Layer 2 In OpenStack Neutron
 
Docker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopDocker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshop
 
An Intrudction to OpenStack 2017
An Intrudction to OpenStack 2017An Intrudction to OpenStack 2017
An Intrudction to OpenStack 2017
 
Service mesh
Service meshService mesh
Service mesh
 
Devops - Microservice and Kubernetes
Devops - Microservice and KubernetesDevops - Microservice and Kubernetes
Devops - Microservice and Kubernetes
 
KVM and docker LXC Benchmarking with OpenStack
KVM and docker LXC Benchmarking with OpenStackKVM and docker LXC Benchmarking with OpenStack
KVM and docker LXC Benchmarking with OpenStack
 
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
[OpenStack Days Korea 2016] Track1 - 카카오는 오픈스택 기반으로 어떻게 5000VM을 운영하고 있을까?
 

Viewers also liked

OpenStack Nova Scheduler
OpenStack Nova Scheduler OpenStack Nova Scheduler
OpenStack Nova Scheduler Peeyush Gupta
 
Openstack Study Nova 1
Openstack Study Nova 1Openstack Study Nova 1
Openstack Study Nova 1Jinho Shin
 
OpenStack Architecture
OpenStack ArchitectureOpenStack Architecture
OpenStack ArchitectureMirantis
 
Deep Dive: OpenStack Summit (Red Hat Summit 2014)
Deep Dive: OpenStack Summit (Red Hat Summit 2014)Deep Dive: OpenStack Summit (Red Hat Summit 2014)
Deep Dive: OpenStack Summit (Red Hat Summit 2014)Stephen Gordon
 
OpenStack Nova - Developer Introduction
OpenStack Nova - Developer IntroductionOpenStack Nova - Developer Introduction
OpenStack Nova - Developer IntroductionJohn Garbutt
 
Introduction to OpenStack Architecture
Introduction to OpenStack ArchitectureIntroduction to OpenStack Architecture
Introduction to OpenStack ArchitectureOpenStack Foundation
 
OpenStack Tutorial
OpenStack TutorialOpenStack Tutorial
OpenStack TutorialBret Piatt
 
Deep Dive into Openstack Storage, Sean Cohen, Red Hat
Deep Dive into Openstack Storage, Sean Cohen, Red HatDeep Dive into Openstack Storage, Sean Cohen, Red Hat
Deep Dive into Openstack Storage, Sean Cohen, Red HatCloud Native Day Tel Aviv
 
20150511 jun lee_openstack neutron 분석 (최종)
20150511 jun lee_openstack neutron 분석 (최종)20150511 jun lee_openstack neutron 분석 (최종)
20150511 jun lee_openstack neutron 분석 (최종)rootfs32
 
OpenStack Summits 101: A Guide For Attendees
OpenStack Summits 101: A Guide For AttendeesOpenStack Summits 101: A Guide For Attendees
OpenStack Summits 101: A Guide For AttendeesOpenStack Foundation
 
Introducing OpenStack for Beginners
Introducing OpenStack for Beginners Introducing OpenStack for Beginners
Introducing OpenStack for Beginners openstackindia
 
What Makes Great Infographics
What Makes Great InfographicsWhat Makes Great Infographics
What Makes Great InfographicsSlideShare
 
Masters of SlideShare
Masters of SlideShareMasters of SlideShare
Masters of SlideShareKapost
 
STOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to SlideshareSTOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to SlideshareEmpowered Presentations
 
10 Ways to Win at SlideShare SEO & Presentation Optimization
10 Ways to Win at SlideShare SEO & Presentation Optimization10 Ways to Win at SlideShare SEO & Presentation Optimization
10 Ways to Win at SlideShare SEO & Presentation OptimizationOneupweb
 
How To Get More From SlideShare - Super-Simple Tips For Content Marketing
How To Get More From SlideShare - Super-Simple Tips For Content MarketingHow To Get More From SlideShare - Super-Simple Tips For Content Marketing
How To Get More From SlideShare - Super-Simple Tips For Content MarketingContent Marketing Institute
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksSlideShare
 
Storage based on_openstack_mariocho
Storage based on_openstack_mariochoStorage based on_openstack_mariocho
Storage based on_openstack_mariochoMario Cho
 
Openstack live migration
Openstack live migrationOpenstack live migration
Openstack live migrationymtech
 

Viewers also liked (20)

OpenStack Nova Scheduler
OpenStack Nova Scheduler OpenStack Nova Scheduler
OpenStack Nova Scheduler
 
Openstack Study Nova 1
Openstack Study Nova 1Openstack Study Nova 1
Openstack Study Nova 1
 
OpenStack Architecture
OpenStack ArchitectureOpenStack Architecture
OpenStack Architecture
 
Deep Dive: OpenStack Summit (Red Hat Summit 2014)
Deep Dive: OpenStack Summit (Red Hat Summit 2014)Deep Dive: OpenStack Summit (Red Hat Summit 2014)
Deep Dive: OpenStack Summit (Red Hat Summit 2014)
 
OpenStack Nova - Developer Introduction
OpenStack Nova - Developer IntroductionOpenStack Nova - Developer Introduction
OpenStack Nova - Developer Introduction
 
Introduction to OpenStack Architecture
Introduction to OpenStack ArchitectureIntroduction to OpenStack Architecture
Introduction to OpenStack Architecture
 
OpenStack Tutorial
OpenStack TutorialOpenStack Tutorial
OpenStack Tutorial
 
Deep Dive into Openstack Storage, Sean Cohen, Red Hat
Deep Dive into Openstack Storage, Sean Cohen, Red HatDeep Dive into Openstack Storage, Sean Cohen, Red Hat
Deep Dive into Openstack Storage, Sean Cohen, Red Hat
 
20150511 jun lee_openstack neutron 분석 (최종)
20150511 jun lee_openstack neutron 분석 (최종)20150511 jun lee_openstack neutron 분석 (최종)
20150511 jun lee_openstack neutron 분석 (최종)
 
OpenStack Summits 101: A Guide For Attendees
OpenStack Summits 101: A Guide For AttendeesOpenStack Summits 101: A Guide For Attendees
OpenStack Summits 101: A Guide For Attendees
 
Introducing OpenStack for Beginners
Introducing OpenStack for Beginners Introducing OpenStack for Beginners
Introducing OpenStack for Beginners
 
What Makes Great Infographics
What Makes Great InfographicsWhat Makes Great Infographics
What Makes Great Infographics
 
Masters of SlideShare
Masters of SlideShareMasters of SlideShare
Masters of SlideShare
 
STOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to SlideshareSTOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
STOP! VIEW THIS! 10-Step Checklist When Uploading to Slideshare
 
You Suck At PowerPoint!
You Suck At PowerPoint!You Suck At PowerPoint!
You Suck At PowerPoint!
 
10 Ways to Win at SlideShare SEO & Presentation Optimization
10 Ways to Win at SlideShare SEO & Presentation Optimization10 Ways to Win at SlideShare SEO & Presentation Optimization
10 Ways to Win at SlideShare SEO & Presentation Optimization
 
How To Get More From SlideShare - Super-Simple Tips For Content Marketing
How To Get More From SlideShare - Super-Simple Tips For Content MarketingHow To Get More From SlideShare - Super-Simple Tips For Content Marketing
How To Get More From SlideShare - Super-Simple Tips For Content Marketing
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & Tricks
 
Storage based on_openstack_mariocho
Storage based on_openstack_mariochoStorage based on_openstack_mariocho
Storage based on_openstack_mariocho
 
Openstack live migration
Openstack live migrationOpenstack live migration
Openstack live migration
 

Similar to Hacking on OpenStack\'s Nova source code

Openstack Quantum yahoo meetup 1 23-13
Openstack Quantum yahoo meetup 1 23-13Openstack Quantum yahoo meetup 1 23-13
Openstack Quantum yahoo meetup 1 23-13Dan Wendlandt
 
OpenStack 101 Technical Overview
OpenStack 101 Technical OverviewOpenStack 101 Technical Overview
OpenStack 101 Technical OverviewOpen Stack
 
Blue host openstacksummit_2013
Blue host openstacksummit_2013Blue host openstacksummit_2013
Blue host openstacksummit_2013Jun Park
 
Blue host using openstack in a traditional hosting environment
Blue host using openstack in a traditional hosting environmentBlue host using openstack in a traditional hosting environment
Blue host using openstack in a traditional hosting environmentOpenStack Foundation
 
2003 scalable networking - unknown
2003 scalable networking - unknown2003 scalable networking - unknown
2003 scalable networking - unknownGeorge Ang
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)Flowdock
 
Am 04 track1--salvatore orlando--openstack-apac-2012-final
Am 04 track1--salvatore orlando--openstack-apac-2012-finalAm 04 track1--salvatore orlando--openstack-apac-2012-final
Am 04 track1--salvatore orlando--openstack-apac-2012-finalOpenCity Community
 
Scalable Networking
Scalable NetworkingScalable Networking
Scalable Networkingl xf
 
Quantum grizzly summit
Quantum   grizzly summitQuantum   grizzly summit
Quantum grizzly summitDan Wendlandt
 
Quantum PTL Update - Grizzly Summit.pptx
Quantum PTL Update - Grizzly Summit.pptxQuantum PTL Update - Grizzly Summit.pptx
Quantum PTL Update - Grizzly Summit.pptxOpenStack Foundation
 
Building Fault Tolerant, Highly Available and Secured Architectures - Simon E...
Building Fault Tolerant, Highly Available and Secured Architectures - Simon E...Building Fault Tolerant, Highly Available and Secured Architectures - Simon E...
Building Fault Tolerant, Highly Available and Secured Architectures - Simon E...Amazon Web Services
 
Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018
Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018
Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018Amazon Web Services
 
OSGi Service Platform 4.2
OSGi Service Platform 4.2OSGi Service Platform 4.2
OSGi Service Platform 4.2Ilya Katsov
 
Load Balancing in the Cloud using Nginx & Kubernetes
Load Balancing in the Cloud using Nginx & KubernetesLoad Balancing in the Cloud using Nginx & Kubernetes
Load Balancing in the Cloud using Nginx & KubernetesLee Calcote
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop OverviewShubhra Kar
 
Using OSGi for script deployment in Apache Sling
Using OSGi for script deployment in Apache SlingUsing OSGi for script deployment in Apache Sling
Using OSGi for script deployment in Apache SlingRadu Cotescu
 
RunningQuantumOnQuantumAtNicira.pdf
RunningQuantumOnQuantumAtNicira.pdfRunningQuantumOnQuantumAtNicira.pdf
RunningQuantumOnQuantumAtNicira.pdfOpenStack Foundation
 
Windows Server 2008 Web Workload Overview
Windows Server 2008 Web Workload OverviewWindows Server 2008 Web Workload Overview
Windows Server 2008 Web Workload OverviewDavid Chou
 
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021WDDay
 

Similar to Hacking on OpenStack\'s Nova source code (20)

Openstack Quantum yahoo meetup 1 23-13
Openstack Quantum yahoo meetup 1 23-13Openstack Quantum yahoo meetup 1 23-13
Openstack Quantum yahoo meetup 1 23-13
 
Crx 2.2 Deep-Dive
Crx 2.2 Deep-DiveCrx 2.2 Deep-Dive
Crx 2.2 Deep-Dive
 
OpenStack 101 Technical Overview
OpenStack 101 Technical OverviewOpenStack 101 Technical Overview
OpenStack 101 Technical Overview
 
Blue host openstacksummit_2013
Blue host openstacksummit_2013Blue host openstacksummit_2013
Blue host openstacksummit_2013
 
Blue host using openstack in a traditional hosting environment
Blue host using openstack in a traditional hosting environmentBlue host using openstack in a traditional hosting environment
Blue host using openstack in a traditional hosting environment
 
2003 scalable networking - unknown
2003 scalable networking - unknown2003 scalable networking - unknown
2003 scalable networking - unknown
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)
 
Am 04 track1--salvatore orlando--openstack-apac-2012-final
Am 04 track1--salvatore orlando--openstack-apac-2012-finalAm 04 track1--salvatore orlando--openstack-apac-2012-final
Am 04 track1--salvatore orlando--openstack-apac-2012-final
 
Scalable Networking
Scalable NetworkingScalable Networking
Scalable Networking
 
Quantum grizzly summit
Quantum   grizzly summitQuantum   grizzly summit
Quantum grizzly summit
 
Quantum PTL Update - Grizzly Summit.pptx
Quantum PTL Update - Grizzly Summit.pptxQuantum PTL Update - Grizzly Summit.pptx
Quantum PTL Update - Grizzly Summit.pptx
 
Building Fault Tolerant, Highly Available and Secured Architectures - Simon E...
Building Fault Tolerant, Highly Available and Secured Architectures - Simon E...Building Fault Tolerant, Highly Available and Secured Architectures - Simon E...
Building Fault Tolerant, Highly Available and Secured Architectures - Simon E...
 
Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018
Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018
Mastering Kubernetes on AWS (CON301-R1) - AWS re:Invent 2018
 
OSGi Service Platform 4.2
OSGi Service Platform 4.2OSGi Service Platform 4.2
OSGi Service Platform 4.2
 
Load Balancing in the Cloud using Nginx & Kubernetes
Load Balancing in the Cloud using Nginx & KubernetesLoad Balancing in the Cloud using Nginx & Kubernetes
Load Balancing in the Cloud using Nginx & Kubernetes
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
Using OSGi for script deployment in Apache Sling
Using OSGi for script deployment in Apache SlingUsing OSGi for script deployment in Apache Sling
Using OSGi for script deployment in Apache Sling
 
RunningQuantumOnQuantumAtNicira.pdf
RunningQuantumOnQuantumAtNicira.pdfRunningQuantumOnQuantumAtNicira.pdf
RunningQuantumOnQuantumAtNicira.pdf
 
Windows Server 2008 Web Workload Overview
Windows Server 2008 Web Workload OverviewWindows Server 2008 Web Workload Overview
Windows Server 2008 Web Workload Overview
 
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
ОЛЕКСАНДР ЛИПКО «Graceful Shutdown Node.js + k8s» Online WDDay 2021
 

Hacking on OpenStack\'s Nova source code

  • 1. Hacking on OpenStack’s Nova Source Code 2012-01-08 Luo, Zhongyue zhongyue@staff.sina.com.cn
  • 2. TODO Intro The source code structure of Nova File structure Component architecture An example Contributing Conclusion 2
  • 3. Intro What is OpenStack? and Nova? WHY shoud I listen to this? Can we actually hack the code in 30min? Why should I trust this guy? 3
  • 4. Source code structure of Nova Macro vs Micro(DIY) File structure Component architecture File structure ↔ Component architecture 4
  • 5. But first...terminologies Service Topic Nova component → Service.create(Topic) Manager (abst) ⊂ Nova component Drivers (impl) ⊂ Manager ex) lvm, qemu, xen, hyperV Lazy plugging → Value based module loading AMQP → Advanced Message Queue Protocol API → REST & Inner 5
  • 6. File structure ”start” ”configs” ”helpers” ”REST” ”is a topic” ”is a topic” ”is a topic” ”is a topic” 6
  • 7. Component architecture Tenant http://nova.openstack.org/nova.concepts.html 7
  • 8. Component architecture ”/etc/nova/nova.conf” ”ec2”, ”osapi” 8
  • 10. Component structure ”network” Network service Periodic Topic: network task Manager Driver: linux_net Reads message from Queue Returns results back to DB or queue Calls inner APIs Network API Looks up DB Sends message to Service via queue - Cast: Send and forget - Call: Send and wait 10
  • 11. Component architecture revisited DB API API Queue API API WSGI 11
  • 12. An example Let’s allocate a floating-ip to an instance with a fixed-ip DB ”compute API” API 1 API Queue API Allocate 10.2.3.11 to a-fake-uuid? API Do you have permission? WSGI I wonder if a-fake-uuid exists... I’ll ask compute API. POST /v2/a-fake-tenant/servers/a-fake-uuid/action 12
  • 13. An example Yup, a-fake-uuid is valid. Oh, and its fixed-ip is 192.168.0.8. Take it from here network API! 2 DB ”compute API” API 3 API Queue ”network API” API API WSGI 13
  • 14. An example ”nova-network” So translate 192.168.0.8 to 10.2.3.11? Go check your mail. I’ll tell nova-network to run ”associate_floating_ip”. Ok, my casting is done. DB I got a message! It says... Dear manager, ”compute API” ”associate_floating_ip” API 5 API 4 Queue ”network API” API API WSGI 14
  • 15. An example ”nova network” 7 iptables 6 DB 192.168.0.8 ↔ 10.2.3.11 DB update...Done. ”compute API” Running iptables-save...Done. API API Queue ”network API” API API WSGI 15
  • 16. An example ”nova network” Did the allocation a-fake-uuid: 192.168.0.8 ↔ 10.2.3.11 finish? 2 DB ”compute API” API 3 1 API Queue ”network API” API Here’s the details of a-fake-uuid. 4 API You want to see if the allocation was a success? WSGI I’ll check with compute API... GET /v2/a-fake-tenant/servers/a-fake-uuid 16
  • 17. OpenStack Nova architecture ”nova network” ”nova volume” ”nova compute” DB ”compute API” API API ”scheduler API” Queue ”network API” API ”nova scheduler” API WSGI ”volume API” 17
  • 18. Contributing LaunchPad http://launchpad.net/~openstack Join mailing lists Documents http://docs.openstack.org/ More info http://wiki.openstack.org/HowToContribute 18
  • 19. Conclusion Structure of code and components of Nova An example How to get involved http://github.com/lzyeval/talk-COSUG-2012 http://launchpad.net/~lzyeval 19