storage -cinder(2)

在storage -cinder(1)中说过,知道host的情况下,直接使用rpc call在指定host上创建volume,否则则需要调度,就是是提到的volume_scheduler,到调度host

上create volume。

 self.scheduler_rpcapi.create_volume #这里的scheduler_rpcapi即 cinder/scheduler/rpcapi.py

在rpcapi.py中cast的消息,被cinder/scheduler/manager.py收到:

self._wait_for_scheduler()

flow_engine = create_volume.get_flow(context,
                                                 db, self.driver,
                                                 request_spec,
                                                 filter_properties,
                                                 volume_id,
                                                 snapshot_id,
                                                 image_id)

需要指出的是,这里的self.driver默认为:cinder.scheduler.filter_scheduler.FilterScheduler

在cinder中大量使用了task flow,看来一开始写cinder的人很喜欢这个库:), 在taskflow中ScheduleCreateVolumeTask的execute里:

self.driver_api.schedule_create_volume(context, request_spec,  filter_properties), 即调用FilterScheduler中的scheduler_create_volume方法

其中最主要的_schedule方法,关于cinder中所有调度的部分都在这里。

如果是各个厂商自己的存储,用厂商自己的client对存储池中进行操作,这些个schedule的动作就没有必要了。

和nova生成instance一样,cinder的调度最终也是为了决定存储的位置,对应的host是哪个,因此有host_manager, 而host_manager中

则调用很多的filter进行过滤,过滤之后用weight打分,决定最终的位置。

hosts = self.host_manager.get_all_host_states

hosts = self.host_manager.get_filtered_hosts#过滤

weighed_hosts = self.host_manager.get_weighed_hosts#打分



在mark link中,对cinder的架构讲的很好,末尾也提到了不足,实际上,对Cinder的无数的driver来说(每个有存储的厂家,一般的都有自己的块存储产品),目前Ceph

是十分火的,我曾经听人说,以后搞Ceph的会比openstack本身要更火,本来Ceph也是开源的,Redhat以其在开源社区的影响力,自己在推glusterfs。看cinder部分的

源码,我们除了能在cinder/volume/drivers/中看到Ceph的影子(RBD Driver), 也能在cinder/backup/drivers中看到Ceph Driver,Ceph以其同时支持块存储和对象

存储而受到很多人的亲睐(对于很多想使用openstack的人而言,并非所有人都想要自己的对象存储,可能干脆就不要swift模块,Ceph的这一特点,使得客户在选择的时候

更加倾向)。


前一篇中cinder/volume/drivers中块存储可以用来放镜像,用户数据,虚机等,提高了openstack的可用性,而backup driver中的主要功能,我们可以从openstack

官方wiki中看到,其对volume进行备份(提供增量/差异化的备份策略)


mark link

http://www.storageonline.com.cn/storage/san-storage/openstack-hanvan-block-service-cinder-installation-and-configuration-guide/

http://specs.openstack.org/openstack/cinder-specs/specs/kilo/incremental-backup.html


加一句,整合openstack和ceph,在ceph的官网有详细教程 http://ceph.com/docs/master/rbd/rbd-openstack/




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值