SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (18)

RTP NPUG: Ansible Intro and Integration with ACI
RTP NPUG: Ansible Intro and Integration with ACIRTP NPUG: Ansible Intro and Integration with ACI
RTP NPUG: Ansible Intro and Integration with ACI
 
Kubernetes operator for MySQL
Kubernetes operator for MySQLKubernetes operator for MySQL
Kubernetes operator for MySQL
 
[Demo session] 관리형 Kafka 서비스 - Oracle Event Hub Service
[Demo session] 관리형 Kafka 서비스 - Oracle Event Hub Service[Demo session] 관리형 Kafka 서비스 - Oracle Event Hub Service
[Demo session] 관리형 Kafka 서비스 - Oracle Event Hub Service
 
8 Lessons Learned from Using Kafka in 1000 Scala microservices - Scale by the...
8 Lessons Learned from Using Kafka in 1000 Scala microservices - Scale by the...8 Lessons Learned from Using Kafka in 1000 Scala microservices - Scale by the...
8 Lessons Learned from Using Kafka in 1000 Scala microservices - Scale by the...
 
How Splunk Is Using Pulsar IO
How Splunk Is Using Pulsar IOHow Splunk Is Using Pulsar IO
How Splunk Is Using Pulsar IO
 
One tool, two fabrics: Ansible and Nexus 9000
One tool, two fabrics: Ansible and Nexus 9000One tool, two fabrics: Ansible and Nexus 9000
One tool, two fabrics: Ansible and Nexus 9000
 
Introducing envoy-based service mesh at Booking.com
Introducing envoy-based service mesh at Booking.comIntroducing envoy-based service mesh at Booking.com
Introducing envoy-based service mesh at Booking.com
 
Configuration Management Tools on NX-OS
Configuration Management Tools on NX-OSConfiguration Management Tools on NX-OS
Configuration Management Tools on NX-OS
 
Implementing an IPv6 Enabled Environment for a Public Cloud Tenant
Implementing an IPv6 Enabled Environment for a Public Cloud TenantImplementing an IPv6 Enabled Environment for a Public Cloud Tenant
Implementing an IPv6 Enabled Environment for a Public Cloud Tenant
 
Service Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and KubernetesService Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and Kubernetes
 
Re-envisioning the Lambda Architecture : Web Services & Real-time Analytics ...
Re-envisioning the Lambda Architecture : Web Services & Real-time Analytics ...Re-envisioning the Lambda Architecture : Web Services & Real-time Analytics ...
Re-envisioning the Lambda Architecture : Web Services & Real-time Analytics ...
 
Using Apache Kafka from Go
Using Apache Kafka from GoUsing Apache Kafka from Go
Using Apache Kafka from Go
 
FIWARE Data Management in High Availability
FIWARE Data Management in High AvailabilityFIWARE Data Management in High Availability
FIWARE Data Management in High Availability
 
Flight recordings and mission control through thick clouds
Flight recordings and mission control through thick cloudsFlight recordings and mission control through thick clouds
Flight recordings and mission control through thick clouds
 
Azure Signalr Service
Azure Signalr ServiceAzure Signalr Service
Azure Signalr Service
 
Strata London 2018: Multi-everything with Apache Pulsar
Strata London 2018:  Multi-everything with Apache PulsarStrata London 2018:  Multi-everything with Apache Pulsar
Strata London 2018: Multi-everything with Apache Pulsar
 
The Cloud Foundry bootcamp talk from SpringOne On The Road - Europe
The Cloud Foundry bootcamp talk from SpringOne On The Road - EuropeThe Cloud Foundry bootcamp talk from SpringOne On The Road - Europe
The Cloud Foundry bootcamp talk from SpringOne On The Road - Europe
 
No Surprises Geo Replication - Pulsar Virtual Summit Europe 2021
No Surprises Geo Replication - Pulsar Virtual Summit Europe 2021No Surprises Geo Replication - Pulsar Virtual Summit Europe 2021
No Surprises Geo Replication - Pulsar Virtual Summit Europe 2021
 

Andere mochten auch

Doublerbuxtutorial
DoublerbuxtutorialDoublerbuxtutorial
Doublerbuxtutorial
cutiekate78
 
Empacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debianEmpacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debian
Andre Ferraz
 
Goede leiders zijn goede verhalenvertellers - Hans Donckers - Beanmachine
Goede leiders zijn goede verhalenvertellers - Hans Donckers - BeanmachineGoede leiders zijn goede verhalenvertellers - Hans Donckers - Beanmachine
Goede leiders zijn goede verhalenvertellers - Hans Donckers - Beanmachine
Antwerp Management School
 

Andere mochten auch (20)

Options for filmingh
Options for filminghOptions for filmingh
Options for filmingh
 
3words pp
3words pp3words pp
3words pp
 
My life
My lifeMy life
My life
 
Kites
KitesKites
Kites
 
06 enterprise resource planning
06 enterprise resource planning06 enterprise resource planning
06 enterprise resource planning
 
Globo
GloboGlobo
Globo
 
Doublerbuxtutorial
DoublerbuxtutorialDoublerbuxtutorial
Doublerbuxtutorial
 
Empacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debianEmpacotamento e backport de aplicações em debian
Empacotamento e backport de aplicações em debian
 
Lecture ready class 5
Lecture ready class 5Lecture ready class 5
Lecture ready class 5
 
Goede leiders zijn goede verhalenvertellers - Hans Donckers - Beanmachine
Goede leiders zijn goede verhalenvertellers - Hans Donckers - BeanmachineGoede leiders zijn goede verhalenvertellers - Hans Donckers - Beanmachine
Goede leiders zijn goede verhalenvertellers - Hans Donckers - Beanmachine
 
Walking the talk - 3 insights from Behavior Design
Walking the talk - 3 insights from Behavior DesignWalking the talk - 3 insights from Behavior Design
Walking the talk - 3 insights from Behavior Design
 
Model answers
Model answers Model answers
Model answers
 
Privatsparande
PrivatsparandePrivatsparande
Privatsparande
 
Vesterinen: Etsivä nuorisotyö, ammattina välittäminen
Vesterinen: Etsivä nuorisotyö, ammattina välittäminenVesterinen: Etsivä nuorisotyö, ammattina välittäminen
Vesterinen: Etsivä nuorisotyö, ammattina välittäminen
 
Infográfico Pessoal
Infográfico PessoalInfográfico Pessoal
Infográfico Pessoal
 
Elements, Compounds & Mixtures Day 3
Elements, Compounds & Mixtures Day 3Elements, Compounds & Mixtures Day 3
Elements, Compounds & Mixtures Day 3
 
Slide share test 110727
Slide share test 110727Slide share test 110727
Slide share test 110727
 
Notam Sul/Sudeste - 01-mai-16
Notam Sul/Sudeste - 01-mai-16Notam Sul/Sudeste - 01-mai-16
Notam Sul/Sudeste - 01-mai-16
 
Linkedin
LinkedinLinkedin
Linkedin
 
Link Building With Twitter
Link Building With TwitterLink Building With Twitter
Link Building With Twitter
 

Ähnlich wie Cosug 2012-lzy

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
Dan Wendlandt
 
Blue host openstacksummit_2013
Blue host openstacksummit_2013Blue host openstacksummit_2013
Blue host openstacksummit_2013
Jun 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 environment
OpenStack Foundation
 
2003 scalable networking - unknown
2003 scalable networking - unknown2003 scalable networking - unknown
2003 scalable networking - unknown
George Ang
 
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
OpenCity Community
 
Scalable Networking
Scalable NetworkingScalable Networking
Scalable Networking
l xf
 
OSGi Service Platform 4.2
OSGi Service Platform 4.2OSGi Service Platform 4.2
OSGi Service Platform 4.2
Ilya Katsov
 

Ähnlich wie Cosug 2012-lzy (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
 
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
 
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)
 
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
 
Scalable Networking
Scalable NetworkingScalable Networking
Scalable Networking
 
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...
 
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
 
OSGi Service Platform 4.2
OSGi Service Platform 4.2OSGi Service Platform 4.2
OSGi Service Platform 4.2
 
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
 
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
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
Meetup open stack_grizzly
Meetup open stack_grizzlyMeetup open stack_grizzly
Meetup open stack_grizzly
 
Windows Server 2008 Web Workload Overview
Windows Server 2008 Web Workload OverviewWindows Server 2008 Web Workload Overview
Windows Server 2008 Web Workload Overview
 

Mehr von OpenCity Community

Mehr von OpenCity Community (20)

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

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

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