kolla-ansible执行openstack对接ceph

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

1、先决条件:
    已经部署完成的openstack和ceph集群
    已经创建完存储池
    准备好ceph.conf,(Glance, Cinder, Nova)keyring:如下图

kolla-ansible执行openstack对接ceph_第1张图片

2、设置ceph客户端认证,在其中一个ceph节点执行以下命令:
ceph auth get-or-create client.cinder mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms, allow rwx pool=images'
ceph auth get-or-create client.glance mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=images'
ceph auth get-or-create client.cinder-backup mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=backups'


3、对接glance服务,执行以下操作:
ceph auth get-or-create client.glance
将输出结果存入/etc/kolla/config/glance/ceph.client.glance.keyring

对接cinder服务,执行以下操作:
ceph auth get-or-create client.cinder
将输出结果存入/etc/kolla/config/cinder/cinder-backup/ceph.client.cinder.keyring
/etc/kolla/config/cinder/cinder-volume/ceph.client.cinder.keyring
ceph auth get-or-create client.cinder-backup
将输出结果存入/etc/kolla/config/cinder/cinder-backup/ceph.client.cinder-backup.keyring

ceph auth get-or-create client.nova
将输出结果存入/etc/kolla/config/nova/ceph.client.cinder.keyring


4、将ceph.conf配置文件放置到/etc/kolla/config/cinder/,glance/,nova/,当中

5、编辑/etc/kolla/config/glance/glance-api.conf,添加如下内容
[DEFAULT]
show_image_direct_url = True

[glance_store]
stores = rbd
default_store = rbd
rbd_store_pool = images
rbd_store_user = glance
rbd_store_ceph_conf = /etc/ceph/ceph.conf


6、编辑/etc/kolla/config/cinder/cinder-volume.conf,添加如下内容
[DEFAULT]
enabled_backends=rbd-1

[rbd-1]
rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_user=cinder
backend_host=rbd:volumes
rbd_pool=volumes
volume_backend_name=rbd-1
volume_driver=cinder.volume.drivers.rbd.RBDDriver
rbd_secret_uuid = { { cinder_rbd_secret_uuid }}

备注:cinder_rbd_secret_uuid 必须能够在/etc/kolla/passwords.yml 文件找到

7、编辑/etc/kolla/config/cinder/cinder-backup.conf,添加如下内容
[DEFAULT]
backup_ceph_conf=/etc/ceph/ceph.conf
backup_ceph_user=cinder
backup_ceph_chunk_size = 134217728
backup_ceph_pool=backups
backup_driver = cinder.backup.drivers.ceph
backup_ceph_stripe_unit = 0
backup_ceph_stripe_count = 0
restore_discard_excess_bytes = true

8、编辑/etc/kolla/config/nova/nova-compute.conf,添加如下内容
[libvirt]
virt_type=qemu
images_rbd_pool=vms
images_type=rbd
images_rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_user=nova

备注:rbd_user可能因您的环境而异。

9、执行kolla-ansible -i multinode reconfigure

10、重启容器

转载于:https://my.oschina.net/jennerlo/blog/1543749

你可能感兴趣的:(后端,python)