一、概述
在實際傳遞過程中,由于某些原因,可能會碰到不需要kolla部署ceph,而是內建一套已存在ceph叢集的情況,這種需求也是合理的。 在這種情況下,需要調整部分kolla的配置。
二、環境準備
1. 已存在的ceph叢集(關于ceph的安裝部署請參考http://blog.csdn.net/dylloveyou/article/details/79054120)
2. openstack需要的pool已經建立完成,內建之後各個project的資料會儲存在對應的pool中
- cinder-volumes (Cinder-volume)
- glance-images (Glance)
- cinder-backups (Cinder-Backup)
- nova-vms (Nova)
三、開啟外接ceph功能
使用外接ceph意味着不需要通過kolla去部署ceph。是以需要在全局配置中關閉ceph元件。編輯
/etc/kolla/globals.yml
,配置如下:
enable_ceph: “no
glance_backend_ceph: "yes"
cinder_backend_ceph: "yes"
nova_backend_ceph: "yes"
enable_ceph: "no"
和
<service>_backend_ceph:"yes"
會觸發kolla的外接ceph叢集的機制。
四、配置Kolla
Glance
1.為
glance-api.conf
配置RBD 後端
編輯
/etc/kolla/config/glance/glance-api.conf
檔案,加入如下配置:
[glance_store]
stores = rbd
default_store = rbd
rbd_store_pool = glance-images
rbd_store_user = glance
rbd_store_ceph_conf = /etc/ceph/ceph.conf
以上配置會被kolla自動合并到glance的配置檔案中。
2.拷貝ceph叢集配置檔案(
/etc/ceph/ceph.conf
)到
/etc/kolla/config/glance/ceph.conf
cat /etc/kolla/config/glance/ceph.conf
[global]
fsid = 9c424511-ade9-45e3-be88-24d72232dd7a
mon_initial_members = ceph-node01, ceph-node02, ceph-node03
mon_host = 11.10.37.85,11.10.37.86,11.10.37.87
auth_cluster_required = cephx
auth_service_required = cephx
auth_client_required = cephx
osd_journal_size = 10000
osd_pool_default_size = 2
osd_pool_default_pg_num = 512
osd_pool_default_pgp_num = 512
rbd_default_features = 3
3.生成
ceph.client.glance.keyring
檔案,并儲存到
/etc/kolla/config/glance
目錄
在存儲mon節點執行指令:
為 glance 生成 glance.keyring 檔案,并将回顯儲存在
/etc/kolla/config/glance/ceph.client.glance.keyring
cat /etc/kolla/config/glance/ceph.client.glance.keyring
[client.glance]
key = AQD6gVRasWreLRAAPSlTc1LPIayGjPtvuK1FCw==
Kolla會将所有名稱為ceph*的檔案拷貝到對應容器中的 /etc/ceph目錄中。
Cinder
1. 編輯
/etc/kolla/config/cinder/cinder-volume.conf
,并配置如下内容:
[DEFAULT]
enabled_backends=rbd-
[rbd-1]
rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_user=cinder
backend_host=storage01
rbd_pool=cinder-volumes
volume_backend_name=rbd-
volume_driver=cinder.volume.drivers.rbd.RBDDriver
rbd_secret_uuid = {{ cinder_rbd_secret_uuid}}
注:
cinder_rbd_secret_uuid
被定義在
/etc/kolla/passwords.yml
中,用來解決虛拟機boot from volume 的bug。
2. 編輯
/etc/kolla/config/cinder/cinder-backup.conf
,并配置如下内容:
[DEFAULT]
backup_ceph_conf=/etc/ceph/ceph.conf
backup_ceph_user=cinder-backup
backup_ceph_chunk_size =
backup_ceph_pool=cinder-backups
backup_driver = cinder.backup.drivers.ceph
backup_ceph_stripe_unit =
backup_ceph_stripe_count =
restore_discard_excess_bytes = true
3. 拷貝ceph的配置檔案(
/etc/ceph/ceph.conf
)到
/etc/kolla/config/glance/ceph.conf
4. 生成
ceph.client.cinder.keyring
檔案
在 ceph mon 節點運作:
為 cinder 生成 cephx keyring,将回顯結果儲存在
/etc/kolla/config/cinder/cinder-volume/ceph.client.cinder.keyring
和
/etc/kolla/config/cinder/cinder-backup/ceph.client.cinder.keyring
中
在ceph mon節點繼續運作:
為 cinder-backu p生成 cephx keyring,将回顯結果儲存在
/etc/kolla/config/cinder/cinder-backup/ceph.client.cinder-backup.keyring
注: cinder-backup 需要兩個 keyring 去連接配接 cinder-volumes 和 cinder-backups pool
Nova
1. 編輯
/etc/kolla/config/nova/nova-compute.conf
,配置如下内容:
[libvirt]
images_rbd_pool=nova-vms
images_type=rbd
images_rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_user=nova
2. 生成 ceph.client.nova.keyring 檔案
拷貝ceph.conf, nova client keyring, 和cinder client keyring 到 /etc/kolla/config/nova
ls /etc/kolla/config/nova
ceph.client.cinder.keyring ceph.client.nova.keyring ceph.conf nova-compute.conf
五、部署
kolla使用外接ceph,意味着沒有儲存節點,而預設情況下cinder-volume和cinder-backup運作在存儲節點,外接ceph存儲需要指定主機去運作cinder-volume和cinder-backup容器。
編輯multinode檔案,修改配置如下(這裡把cinder-volume和cinder-backup安裝到controller節點):
[storage]
controller01
執行kolla-ansible指令,完成部署
kolla-ansible -i /home/multimode deploy
參考自 九州雲 微信公衆号。