OpenStack设计与实现阅读笔记
- OpenStack is implemented according to Amazon Web Service. AWS
 - 与运行在物理节点上的hypervisor进行交互,实现对硬件资源的管理和控制
 - Nova - ec2
 - swift - s3
 - cinder - ebs
 - keystone - iam
 
Componenrt Overview
Nova
- provide VM service. The overall controller. Compatible to EC2 api as well.
 - Nova components:
    
- Nova-api: provide services to outside (including both client-user and admin). Compatible with AWS EC2 API
 - Nova-compute: the process installed in every physical node. It receives request and translate the request to a set of operations provided by the API from Hypervisor. For example:
        
- Hypervisor XenServer - XenAPI
 - KVM, QEMU - libvirt
 - VMware - VMware api
 
 - Nova-scheduler: receives the request of creating a new VM and decide which physical node will be chosen as the place.
 - Nova-conductor: between Nova-compute and Nova-db, served as the forwarding role.
 - Nova-db: contains a lot of DB tables to record the state of VM, the mappings of VM and physic nodes and the infos of tenants.
 - Nova-console/Nova-consoleauth: the services that allows the user to access the console of the VMs
 - Nova-cert and Nova-objectstore
 
 
Swift - object storage
- used to stored and retrieve object
 - Swift components
    
- Proxy-server: between the inside and outside of Swift. It receives api or HTTP requests like uploading, modifying metadata and creating a container.
 - Account-server: used for account management
 - Container-server: manage the mappings between containers to directories.
 - Object-server: manage the object stored on the storing node, like files.
 
 
Keystone - Identity service
- Provide services of certification and authorization for users and manage their privileges. Giving a list of available services
 - Keystone components:
    
- Keystone-API: receives requests
 - Keystone-db
 
 
Cinder - Volume storage
- Cinder-api: receives requests and forwarding them to Cinder-volume
 - CInder-volume: Interact with the lower-level block storage service. Different Storage service provider implemented different driver for Cinder-volume,
 - Cinder-scheduler: Like Nova-scheduler, to determine which storage node should be chosen for creating a new volume.
 - Cinder-db: maintain inner infos.
 
Neutron - Network service
- Provides support for net-device providers via ‘plugins’
 - Neutron components:
    
- Neutron-server: receives API requests and forwarding them to corresponding neutron plugin
 
 
Glance - image service
- Provides services of storing, retrieving and searching for images
 
**a classic paragraph to desc the relationships btw components **

- 
    
插播:看了linus torvalds早年在google做的git宣传pre,发现原来linus是个narcissist hhhh. Git的设计理念确实很强:分布式+branch的想法让不同expertise的人各司其职。
 - 
    
橡皮鸭调试法hhhhh
 - 
    

 - 
    

- 
        
虚拟化的主流实现方式
- 直接在硬件驱动上进行封装(Xen)
 - 在操作系统上进行封装(KVM, VirtualBox)
 

 - 
        
主流虚拟化服务提供商
- VMware, 基于操作系统的虚拟化
 - Xen,通过修改linux kernel,实现硬件的虚拟化
 - KVM,也是基于硬件的虚拟化,作为模块运行在linux内核上
 
 - 
        
虚拟化管理工具:VMM本身只提供虚拟化的基础架构,最后和用户相关的工作还是要通过虚拟化管理工具来实现
- XenAPI

 - libvirt

 
 - XenAPI
 - 
        
RESTful: Representation State Transfer表现层状态迁移
- 用URI表示资源,用HTML谓词(get, post, delete, update, etc.)表示描述操作
 
 - 
        
协程(coroutine): 是进城的子单位
- 拥有自己的栈和局部变量
 - 与统一进程下的其他协程共享全局变量
 - 与线程不一样:不会并发执行,而是被执行协程阻塞了,另一个协程接手执行
 - 不需要考虑锁的问题,舒服
 - 执行顺序和时间长短由用户自己决定,舒服(线程由OS决定)
 - 本质是线程内的伪并发
 
 - 
        
Eventlet: python lib to provide coroutine support
 
 - 
        
 
Nova
- architecture

 - four core module:
    
- API
 - compute: interact with VMM
 - scheduler: choose the phy node to deploy new VM
 - conductor: abstraction for DB acces
        
- Communicate through AMQP(advanced message queue protocol)