SlideShare a Scribd company logo
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 and get your mail.
      I’ll tell nova-network to run
         ”associate_floating_ip”.
          Ok, my casting is done.
                                           DB                       I got a message!
                                                              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

PDF
Hacking on OpenStack\'s Nova source code
PPTX
Envoy @ Lyft: Developer Productivity
PPTX
eBay From Ground Level to the Clouds
PDF
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA
PDF
Container Networking - State of the Ecosystem [ContainerConf, Mannheim, Nov 2...
PDF
Network Service Mesh
PDF
Docker kubernetes fundamental(pod_service)_190307
PDF
10 Lessons Learned from using Kafka with 1000 microservices - java global summit
Hacking on OpenStack\'s Nova source code
Envoy @ Lyft: Developer Productivity
eBay From Ground Level to the Clouds
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA
Container Networking - State of the Ecosystem [ContainerConf, Mannheim, Nov 2...
Network Service Mesh
Docker kubernetes fundamental(pod_service)_190307
10 Lessons Learned from using Kafka with 1000 microservices - java global summit

What's hot (16)

PDF
Kubernetes operator for MySQL
PDF
[Demo session] 관리형 Kafka 서비스 - Oracle Event Hub Service
PDF
8 Lessons Learned from Using Kafka in 1000 Scala microservices - Scale by the...
PDF
How Splunk Is Using Pulsar IO
PPTX
Introducing envoy-based service mesh at Booking.com
PDF
Configuration Management Tools on NX-OS
PDF
Implementing an IPv6 Enabled Environment for a Public Cloud Tenant
PPTX
Service Discovery using etcd, Consul and Kubernetes
PPTX
Re-envisioning the Lambda Architecture : Web Services & Real-time Analytics ...
PDF
Using Apache Kafka from Go
PDF
FIWARE Data Management in High Availability
PPTX
Flight recordings and mission control through thick clouds
PPTX
Azure Signalr Service
PDF
Strata London 2018: Multi-everything with Apache Pulsar
KEY
The Cloud Foundry bootcamp talk from SpringOne On The Road - Europe
PPTX
No Surprises Geo Replication - Pulsar Virtual Summit Europe 2021
Kubernetes operator for MySQL
[Demo session] 관리형 Kafka 서비스 - Oracle Event Hub Service
8 Lessons Learned from Using Kafka in 1000 Scala microservices - Scale by the...
How Splunk Is Using Pulsar IO
Introducing envoy-based service mesh at Booking.com
Configuration Management Tools on NX-OS
Implementing an IPv6 Enabled Environment for a Public Cloud Tenant
Service Discovery using etcd, Consul and Kubernetes
Re-envisioning the Lambda Architecture : Web Services & Real-time Analytics ...
Using Apache Kafka from Go
FIWARE Data Management in High Availability
Flight recordings and mission control through thick clouds
Azure Signalr Service
Strata London 2018: Multi-everything with Apache Pulsar
The Cloud Foundry bootcamp talk from SpringOne On The Road - Europe
No Surprises Geo Replication - Pulsar Virtual Summit Europe 2021
Ad

Viewers also liked (20)

DOCX
Options for filmingh
PPT
3words pp
PPTX
My life
ODP
Kites
PDF
06 enterprise resource planning
PDF
PPTX
Doublerbuxtutorial
PPT
Empacotamento e backport de aplicações em debian
PPTX
Lecture ready class 5
PDF
Goede leiders zijn goede verhalenvertellers - Hans Donckers - Beanmachine
PDF
Walking the talk - 3 insights from Behavior Design
PPT
Model answers
PPT
Privatsparande
PDF
Vesterinen: Etsivä nuorisotyö, ammattina välittäminen
PDF
Infográfico Pessoal
PPT
Elements, Compounds & Mixtures Day 3
PPTX
Slide share test 110727
PDF
Notam Sul/Sudeste - 01-mai-16
PDF
Crociate e preghiere quotidiane (Programma di Preghiera di Gesù all'umantià, ...
KEY
Linkedin
Options for filmingh
3words pp
My life
Kites
06 enterprise resource planning
Doublerbuxtutorial
Empacotamento e backport de aplicações em debian
Lecture ready class 5
Goede leiders zijn goede verhalenvertellers - Hans Donckers - Beanmachine
Walking the talk - 3 insights from Behavior Design
Model answers
Privatsparande
Vesterinen: Etsivä nuorisotyö, ammattina välittäminen
Infográfico Pessoal
Elements, Compounds & Mixtures Day 3
Slide share test 110727
Notam Sul/Sudeste - 01-mai-16
Crociate e preghiere quotidiane (Programma di Preghiera di Gesù all'umantià, ...
Linkedin
Ad

Similar to Cosug 2012-lzy (20)

PPTX
Openstack Quantum yahoo meetup 1 23-13
PDF
Crx 2.2 Deep-Dive
PDF
OpenStack 101 Technical Overview
PPTX
Blue host using openstack in a traditional hosting environment
PPTX
Blue host openstacksummit_2013
PDF
2003 scalable networking - unknown
PPTX
Am 04 track1--salvatore orlando--openstack-apac-2012-final
PDF
A Tale of a Server Architecture (Frozen Rails 2012)
PPTX
Quantum grizzly summit
PPTX
Quantum PTL Update - Grizzly Summit.pptx
PDF
Scalable Networking
PDF
Load Balancing in the Cloud using Nginx & Kubernetes
PDF
OSGi Service Platform 4.2
PDF
Using OSGi for script deployment in Apache Sling
PDF
RunningQuantumOnQuantumAtNicira.pdf
PPTX
StrongLoop Overview
PDF
Meetup open stack_grizzly
PPTX
Windows Server 2008 Web Workload Overview
PDF
Scaling the Container Dataplane
PDF
Deep Dive Into Quantum
Openstack Quantum yahoo meetup 1 23-13
Crx 2.2 Deep-Dive
OpenStack 101 Technical Overview
Blue host using openstack in a traditional hosting environment
Blue host openstacksummit_2013
2003 scalable networking - unknown
Am 04 track1--salvatore orlando--openstack-apac-2012-final
A Tale of a Server Architecture (Frozen Rails 2012)
Quantum grizzly summit
Quantum PTL Update - Grizzly Summit.pptx
Scalable Networking
Load Balancing in the Cloud using Nginx & Kubernetes
OSGi Service Platform 4.2
Using OSGi for script deployment in Apache Sling
RunningQuantumOnQuantumAtNicira.pdf
StrongLoop Overview
Meetup open stack_grizzly
Windows Server 2008 Web Workload Overview
Scaling the Container Dataplane
Deep Dive Into Quantum

More from OpenCity Community (20)

PDF
开源讲义.pdf
PDF
物联网操作系统漫谈-GIAC大会.pdf
PDF
2017开源年会-企业开源那些事儿-更新.pdf
PDF
社会化研发
PDF
Containers & CaaS
PPT
OaaS:Open as a Strategy
PDF
Hello openstack 2014
PDF
Docker openstack-2014
PDF
Learn OpenStack from trystack.cn
PDF
OpenStack系列公开课2 -20130508
PDF
OpenStack ecosystem
PDF
How to master OpenStack in 2 hours
PDF
Learn OpenStack from trystack.cn ——Folsom in practice
PDF
Quantum Networks
PDF
云计算思考
PDF
Openstorage Openstack
PDF
Openstack的研究与实践
PDF
Open Stack Cheng Du Swift Alex Yang
PDF
Nova与虚拟机管理
PDF
Look Into Libvirt Osier Yang
开源讲义.pdf
物联网操作系统漫谈-GIAC大会.pdf
2017开源年会-企业开源那些事儿-更新.pdf
社会化研发
Containers & CaaS
OaaS:Open as a Strategy
Hello openstack 2014
Docker openstack-2014
Learn OpenStack from trystack.cn
OpenStack系列公开课2 -20130508
OpenStack ecosystem
How to master OpenStack in 2 hours
Learn OpenStack from trystack.cn ——Folsom in practice
Quantum Networks
云计算思考
Openstorage Openstack
Openstack的研究与实践
Open Stack Cheng Du Swift Alex Yang
Nova与虚拟机管理
Look Into Libvirt Osier Yang

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPT
Teaching material agriculture food technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Electronic commerce courselecture one. Pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Approach and Philosophy of On baking technology
NewMind AI Weekly Chronicles - August'25 Week I
Unlocking AI with Model Context Protocol (MCP)
Per capita expenditure prediction using model stacking based on satellite ima...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Modernizing your data center with Dell and AMD
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Teaching material agriculture food technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Electronic commerce courselecture one. Pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf

Cosug 2012-lzy

  • 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 and get your mail. I’ll tell nova-network to run ”associate_floating_ip”. Ok, my casting is done. DB I got a message! 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