Hacking onOpenStack’sNova Source Code2012-01-08Luo, Zhongyuezhongyue@staff.sina.com.cn
TODO Intro The source code structure of Nova     File structure     Component architecture An example Contributing Conclus...
Intro        What is OpenStack? and Nova? WHY shoud I listen to this?   Can we actually hack the code in 30min?         Wh...
Source code structure of Nova         Macro vs Micro(DIY)               File structure         Component architecture  Fil...
But first...terminologies  Service  Topic  Nova component → Service.create(Topic)  Manager (abst) ⊂ Nova component  Driver...
File structure                  ”start”                ”configs”                ”helpers”       ”REST”               ”is a...
Component architecture   Tenant            http://nova.openstack.org/nova.concepts.html                                   ...
Component architecture    ”/etc/nova/nova.conf”         ”ec2”, ”osapi”                                            8
”network”??                9
Component structure                  ”network”                           Network service                                  ...
Component architecture revisited                         DB       API             API                                    Q...
An exampleLet’s allocate afloating-ip to aninstance with a fixed-ip                                   DB   ”compute API”  ...
An example     Yup, a-fake-uuid is valid.Oh, and its fixed-ip is 192.168.0.8. Take it from here network API!              ...
An example                                                          ”nova-network”So translate 192.168.0.8 to 10.2.3.11?  ...
An example                                                     ”nova network”                                             ...
An example                                                             ”nova network”Did the allocation                   ...
OpenStack Nova architecture                                                      ”nova network”                      ”nova...
Contributing LaunchPad     http://launchpad.net/~openstack     Join mailing lists Documents     http://docs.openstack.org/...
Conclusion Structure of code and components of Nova               An example            How to get involved http://github....
Upcoming SlideShare
Loading in...5
×

Cosug 2012-lzy

529

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
529
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
18
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Cosug 2012-lzy

  1. 1. Hacking onOpenStack’sNova Source Code2012-01-08Luo, Zhongyuezhongyue@staff.sina.com.cn
  2. 2. TODO Intro The source code structure of Nova File structure Component architecture An example Contributing Conclusion 2
  3. 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. 4. Source code structure of Nova Macro vs Micro(DIY) File structure Component architecture File structure ↔ Component architecture 4
  5. 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. 6. File structure ”start” ”configs” ”helpers” ”REST” ”is a topic” ”is a topic” ”is a topic” ”is a topic” 6
  7. 7. Component architecture Tenant http://nova.openstack.org/nova.concepts.html 7
  8. 8. Component architecture ”/etc/nova/nova.conf” ”ec2”, ”osapi” 8
  9. 9. ”network”?? 9
  10. 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. 11. Component architecture revisited DB API API Queue API API WSGI 11
  12. 12. An exampleLet’s allocate afloating-ip to aninstance 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. 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. 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. 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. 16. An example ”nova network”Did the allocation a-fake-uuid: 192.168.0.8 ↔ 10.2.3.11finish? 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. 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. 18. Contributing LaunchPad http://launchpad.net/~openstack Join mailing lists Documents http://docs.openstack.org/ More info http://wiki.openstack.org/HowToContribute 18
  19. 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
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×