Cinder对接ceph

Cinder对接ceph

#1、准备工作

##1、ceph配置

# 创建cinder使用的存储池
ceph osd pool create cinder 128
rbd pool init cinder
ceph osd pool create cinder-backup 128
rbd pool init cinder-backup
# 创建cinder服务使用的keyring
ceph auth get-or-create  client.cinder mon 'allow r' osd 'allow class-read object_prefix rbd_children,allow rwx pool=cinder' -o ceph.client.cinder.keyring
ceph auth get-or-create  client.cinder-backup mon 'allow r' osd 'allow class-read object_prefix rbd_children,allow rwx pool=cinder-backup' -o ceph.client.cinder-backup.keyring
# 拷贝配置文件
scp ceph.client.cinder.keyring ceph.client.cinder-backup.keyring /etc/ceph.conf   controller:/etc/ceph/

2、libvirt配置

1、配置secret

# cat ceph-uuid
<secret>
  <uuid>27913e2a-ebe8-4502-a9f6-1a7c05b9abbd</uuid>
  <usage type='ceph'>
    <name>client.cinder secret</name>
  </usage>
</secret>
# end cat
virsh secret-define --file ceph-uuid
virsh 
# 设置secret的value
cat /etc/ceph.client.cinder.keyring
key = AQBihllgH6paCBAAwdxGhl86PaQ2R3o+jZ6LuQ==
virsh secret-set-value --secret 403940e1-5242-4755-865d-6deb225acbc3 --base64 AQBihllgH6paCBAAwdxGhl86PaQ2R3o+jZ6LuQ== #上方的value

##3、cinder配置

###1、修改配置文件

# 添加如下配置
[ceph]
rbd_cluster_name= ceph
rbd_pool= cinder
rbd_user= cinder
volume_backend_name= ceph
volume_driver= cinder.volume.drivers.rbd.RBDDriver
rbd_ceph_conf= /etc/ceph/ceph.conf
rbd_keyring_conf= /etc/ceph/ceph.client.cinder.keyring
rbd_flatten_volume_from_snapshot= false
rbd_secret_uuid= 403940e1-5242-4755-865d-6deb225acbc3 #之前设置的secret的uuid
rbd_max_clone_depth= 5
rbd_store_chunk_size= 4
rados_connect_timeout= -1
# 修改存在参数
enabled_backends= ceph
# cinder备份参数
[DEFAULT]
backup_driver= cinder.backup.drivers.ceph
backup_ceph_conf= /etc/ceph/ceph.conf
backup_ceph_user= cinder-backup
backup_ceph_chunk_size= 134217728
backup_ceph_pool= backups
backup_ceph_stripe_unit= 0
backup_ceph_stripe_count= 0
restore_discard_excess_bytes= true

2、重启服务

systemctl restart openstack-cinder-volume.service

systemctl restart openstack-cinder-backup.service

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值