Understanding the source code of an open source project is essential not only to developers, but also to operators.
Nova, being the main project of OpenStack, covers the core functionality in which OpenStack provides.
Therefore understanding the inner structure of Nova should be beneficial to people related in all aspects.
This talk is about the structure of Nova\'s source code with an example to help you to understand the overall process scheme of OpenStack.
At the end, I briefly introduce how you can contribute to the OpenStack community.
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
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