1. 启用 Glance Ceph 后端
在部署机上找到 /etc/kolla/globals.yml
将 glance_backend_ceph 修改为 yes
glance_backend_ceph: "yes"
#2. 创建存储池
ceph osd pool create volumes ceph osd pool create images ceph osd pool create backups ceph osd pool create vms
新创建的池必须在使用前进行初始化。使用该rbd工具初始化池:
rbd pool init volumes rbd pool init images rbd pool init backups rbd pool init vms
#3. 配置 OPENSTACK CEPH 客户端
只要使用了 ceph 客户端就需要 ceph.conf。这里需要在每个需要使用到 ceph 客户端的节点创建一个 ceph.conf
示例配置文件:
[global] auth_client_required = cephx auth_cluster_required = cephx auth_service_required = cephx cluster_network = 18.10.151/24 fsid = 59863611-9b12-4807-bf9d-ecfa60480d94 mon_allow_pool_delete = true mon_host = 1.10.1.51 ms_bind_ipv4 = true ms_bind_ipv6 = false osd_pool_default min size = 2 osd_pool_default size = 2 public_network = 10.10.1.51/24
#4. 创建 glance cinder ceph 账户
ceph auth get-or-create client.glance mon 'profile rbd' osd 'profile rbd pool=images' mgr 'profile rbd pool=images' ceph auth get-or-create client.cinder mon 'profile rbd' osd 'profile rbd pool=volumes, profile rbd pool=vms, profile rbd-read-only pool=images' mgr 'profile rbd pool=volumes, profile rbd pool=vms' ceph auth get-or-create client.cinder-backup mon 'profile rbd' osd 'profile rbd pool=backups' mgr 'profile rbd pool=backups'
#5. 复制keyring
将 Ceph keyring 复制到 /etc/kolla/config/glance/ceph.client.glance.keyring
ceph auth get-or-create client.glance | ssh <kolla_deploy_host> sudo tee /etc/kolla/config/glance/ceph.client.glance.keyring
#6. 重新部署
在部署机
kolla-ansible -i ./multinode deploy
#7. 验证
#7.1 上传镜像
下载一个cirros-0.6.1-x86_64-disk.img镜像测试(很小20M)
看到是运行中,那就大差不差已经成功了
#7.2 验证存储池文件列表
rbd ls -p images
显示如下,再对比一下上图的id,是一致的,说明成功了
root@ceph1:~# rbd ls -p images 255dd8a4-c442-4d09-a1a1-878466424253