这段时间捣鼓了一下Glance源代码,还是有收获的,修改了部分代码实现了支持多个ceph存储后端的功能。这个功能是不是个伪需求都还待定,反正也就当磨练了。
关于支持多个ceph存储后端的功能,稍微说一下
需要实现的功能就是在命令中行上传镜像,通过指定集群将镜像上传到不同ceph集群中。在通过nova创建虚拟机的时候肯定也需要能够使用这些创建虚拟机,当然这在计算节点的nova配置中就能实现。
整体结构图
Glance架构是一个典型的CS架构,提供的也是标准的Rest接口,各个layer分层也是很清楚的。
Following components are present in the Glance architecture:
- A client - any application that makes use of a Glance server.
- REST API - Glance functionalities are exposed via REST.
- Database Abstraction Layer (DAL) - an application programming interface
(API) that unifies the communication between Glance and databases. - Glance Domain Controller - middleware that implements the main
Glance functionalities such as authorization, notifications, policies, database connections. - Glance Store - used to organize interactions between Glance and various
data stores. - Registry Layer - optional layer that is used to organise secure
communication between the domain and the DAL by using a separate service.
这都是直接从官网弄下来的。稍微解释一下
名字 | 解释 |
---|---|
glance-api | 服务端,负责处理各个请求 |
glance-store | 与底层存储打交道,做适应性驱动等 |
glance-client | 客户端,处理用户命令并发送请求到服务端 |
glance-registry | 处理元数据相关,跟数据库有关 |
Gateway and basic layers
The domain model contains the following layers:
- Authorization
- Property protection
- Notifier
- Policy
- Quota
- Location
- Database
这次主要关注的还是Location
这一层,database
主要是由glance-registry
来进行数