openstack Learning - Understanding storage management

openstack storage type

openstack stored divided into two categories, as shown below:
openstack Learning - Understanding storage management
current openstack supports three types of persistent storage: a storage block, storage and file system objects stored

openstack Learning - Understanding storage management
Because there is less use of Manila, focusing on CInder and Swift
openstack Learning - Understanding storage management

Cinder Block Storage

Cinder Profile

Cinder place and role in the OpenStack
openstack Learning - Understanding storage management
Cinder core function is to manage the volume, allowing the volume, the type of volume, the snapshot volume, volume backup processing. It provides different back-end storage devices to a unified interface to different vendors to achieve its block device driver service in Cinder can be integrated management Openstack

Cinder architecture

openstack Learning - Understanding storage management

  • Client Package provides Cinder Cinder rest interface, providing the user the CLI form
  • Cinder REST API API provided outside, the operation needs to parse the API find the corresponding routing processing method. Additions and deletions to change search volume contains (including the source volume, mirroring, snapshot creation), CRUD snapshots, backup, volume type management, mount / unmount (Nova call) and so on.
  • Cinder Scheduler responsible for collecting reports backend capacity, capability information, the root volume is set to a specified algorithm to complete the scheduling of cinder-volume
  • Cinder Volume multi-node deployment, use a different configuration files, access different backend devices, each storage vendor code is inserted interact with the device driver to complete the capacity and capability information collection device, the volume operation
  • Cinder Backup achieve backup data volume to another storage medium (current SWIFT / Ceph / TSM provides the drive)
  • SQL DB provides a reservoir volume, the snapshot, backup, service and other data to support Mysql, PG, MSSQL SQL databases, etc.

openstack Learning - Understanding storage management

Cinder components -API

Cinder API provide external REST API, the operator needs to parse, and call processing method:

  • 卷create/delete/list/show
  • Snapshots create / delete / list / show
  • Volume attach / detach (nova call)
  • 其他:
    Volume types
    Qutotas
    Backups

    Cinder组件-Scheduler

    Cinder scheduler负责收集后端上报的容量,能力信息,根据设定的算法完成卷到指定cinder-volume的调度,它通过过滤和称权,筛选出合适的后端:
    openstack Learning - Understanding storage management
    根据后端的能力进行筛选

  • Drivers定期报告后端的能力和状态
  • 管理员创建的卷类型
  • 创建卷时,用户指定卷类型

Cinder组件-Volume

Cinder volume多节点部署,使用不同的配置文件、接入不同的后端设备,由各存储厂商插入Driver代码与设备交互,完成设备容量和能力信息收集,卷操作等。
openstack Learning - Understanding storage management
Cinder默认的后端驱动是LVM

典型工作流程

openstack Learning - Understanding storage management
Cinder-volume会定期收集底层后端的容量信息,并通知Scheduler更新内存中的Backend信息

创建卷类型的目的是为了筛选不同的后端存储,例如SSD,STAT,高性能,低性能,通过创建不同的自定义卷类型,创建卷时自动给筛选出合适的后端存储

Cinder API

openstack Learning - Understanding storage management

  • 检查卷参数合法性(用户输入,权限,资源是否存在等)
  • 准备创建参数字典,预留和提交配额
  • 在数据库中创建对应的数据记录
  • 通过消息列队将请求和参数发送到Scheduler

Cinder Scheduler

openstack Learning - Understanding storage management
提取收到的请求参数
通过配置的filter和输入参数后端进行过滤

  • Avialability_zone_filter
  • Capactiy_filter
  • Capabilities_filter
  • Affinity_filter
  • Weigher计算后端进行权重

  • CapactiyWeigher/AllocatedCapacityWeigher
  • ChanceWeigher
  • GoodnessWeigher
  • 选取最优的Backend并通过消息列队将请求发送到指定的后端

和Nova Scheduler类似,Cinder Scheduler也是经过Filter删选合适条件的后端,然后使用Weigher计算后端进行权重排序,最终选择出最合适的后端存储

Cinder Volume

openstack Learning - Understanding storage management

提供接收到的请求参数
调用对应的Driver在后端创建世纪的卷
使用Driver返回的模型更新数据库中的记录

Cinder挂载卷流程

openstack Learning - Understanding storage management
挂卷流程:挂卷时通过Nova和Cinder的配合最终将远端的卷连接到虚拟机所在的Host节点上,并最终通过虚拟机管理程序映射到内部的虚拟机中

  • Nova调用Cinder api创建卷,传递主机的信息,如hostname,ISCSI initiator name,FC WWWPNs
  • Cinder API将该信息传递给Cincer Volume
  • Cinder Volume通过创建卷时保存的host信息找到对应的Cinder Driver
  • Cinder Driver通知存储允许该主机访问该卷,并返回该存储的连接信息(如ISCSI iqn,portal,FC target WWPN,NFS path)
  • Nova调用针对不同存储类型进行主机识别磁盘的代码(Cinder提供了brick模块用于参考)实现识别磁盘或者文件设备
  • Nova通知Cinder已经进行了挂载
  • Nova将主机的设备信息传递给hypervisor来实现虚拟机挂载磁盘

    Cinder主要操作

    openstack Learning - Understanding storage management

对象存储Swift

Swift简介

Swift提供高度可用、分布式、最终一致的对象存储服务

openstack Learning - Understanding storage management
Swift并不是文件系统或者试试的数据存储系统,它称为对象存储,用于永久类型的静态数据的长期存储,这些存储可以检索,调整,必要时进行更新
最蛇和存储的数据类型的例子是虚拟机镜像,图片存储,邮件存储和存档备份
因为没有中心的单元或主控节点,Swift提供了更强的扩展性,冗余和持久性
Swift经常用于存储镜像或者用于存储虚拟机实例卷的备份副本
openstack Learning - Understanding storage management

Swift应用
镜像存储后端:在Openstack中与镜像服务Glance结合,为其存储镜像文件
静态数据存储:由于swift的扩展能力,适合存储日志文件和数据备份仓库

Swift架构

openstack Learning - Understanding storage management
Swift中对象存储URL如下所示:
https://swift.example.com/va/account/container/object
URL有两个部分:集权位置和存储位置
集群位置:swift.example.com/v1/
存储位置(对象):/account/containr/oject
存储位置有如下三种:
/account
账户存储位置是唯一命名的存储区域,其中包含账户本身的元数据(描述性信息)以及账户中的容器列表
/account/container
容器存储位置是账号内的用户定义的存储区域,其中包含容器本身和容器中的对象列表的元数据
/account/container/object
对象存储位置存储了数据对象及元数据的位置。

Swift组件

Proxy Server: provide external object services API, thanks to stateless protocol REST request, you can scale out to load balance
Account Server: provide account metadata and statistical information, and maintenance services contained in the container list, information for each account are stored in a SQLite database
container Server: provides a container metadata and statistical information, and maintenance services included in the list of objects, each container information is also stored in a SQLite database
Object Server: provides object metadata and content services, each content object may be stored as a file in the file system, the metadata is stored as a file attribute
Replicator: detecting whether the local partition and remote copies of the same, will be found using the push (the push) update remote copy does not coincide, and to ensure that marked deleted object is removed from the file system
Updater: when the object can not be updated immediately due to high load, the task will be serialized queued in the local file system to be updated asynchronously when the service
Auditor: examination objects, containers and complete account If found bit-level error, the file will be quarantined, and the other copy of a copy of a copy of the cover of the local damage; other types of errors will be logged
Account Reaper: remove marked for deletion of the account, delete it contains all containers and objects

Swift API

Swift REST services-based HTTP Proxy server interfaces outwardly of the accounts, and other containers and objects CRUD operations

openstack Learning - Understanding storage management

Swift data model

Three logical structure: Accout / Contianer / Object
each nodes not limited, and may be arbitrarily extended
openstack Learning - Understanding storage management

Guess you like

Origin blog.51cto.com/11555417/2437914