Total PGs = (Total_number_of_OSD * 100) /max_replication_count)
1、 Create pool for OpenStack
pg=256ceph osd pool create volumes $pg #disk_poolceph osd pool create p_w_picpaths $pg #p_w_picpath_poolceph osd pool create vms $pg #host_poolceph osd pool create backups $pg #backup_pool
2、 setup ceph client authentication
ceph auth get-or-create client.cinder mon'allow r' osd 'allow class-read object_prefix rbd_children, allow rwxpool=volumes, allow rwx pool=vms, allow rx pool=p_w_picpaths'ceph auth get-or-create client.glance mon'allow r' osd 'allow class-read object_prefix rbd_children, allow rwxpool=p_w_picpaths'ceph auth get-or-createclient.cinder-backup mon 'allow r' osd 'allow class-read object_prefixrbd_children, allow rwx pool=backups'
3、Add the keyringsfor client.cinder, client.glance, and client.cinder-backup to the appropriatenodes and change their ownership
ceph auth get-or-create client.glance | ssh{your-glance-api-server} sudo tee /etc/ceph/ceph.client.glance.keyringssh {your-glance-api-server} sudo chownglance:glance /etc/ceph/ceph.client.glance.keyringceph auth get-or-create client.cinder | ssh{your-volume-server} sudo tee /etc/ceph/ceph.client.cinder.keyringssh {your-cinder-volume-server} sudo chowncinder:cinder /etc/ceph/ceph.client.cinder.keyring
4、 Nodes running nova-compute need the keyring file for thenova-compute process
ceph auth get-or-create client.cinder | ssh{your-nova-compute-server} sudo tee /etc/ceph/ceph.client.cinder.keyring
5、 Create a temporary copy of the secret key on the nodes runningnova-compute:
ceph auth get-key client.cinder > client.cinder.keyceph auth get-key client.cinder | ssh{your-compute-node} tee client.cinder.keyuuidgen4f859b95-406e-49f6-9ff8-d6e04f7ba1efcat > secret.xml <4f859b95-406e-49f6-9ff8-d6e04f7ba1ef client.cinder secret EOFsudo virsh secret-define --file secret.xmlsudo virsh secret-set-value --secret e05983be-9251-44cb-9738-198bf9ec2d7e --base64 $(cat client.cinder.key)&& rm client.cinder.key secret.xml
6、 Configuring Glance
vi /etc/glance/glance-api.conf[DEFAULT]...default_store=rbdrbd_store_user=glancerbd_store_pool=p_w_picpathsshow_p_w_picpath_direct_url=True...
7、 Configuring Cinder
vi /etc/cinder/cinder.conf[DEFAULT]...volume_driver=cinder.volume.drivers.rbd.RBDDriverrbd_pool=volumesrbd_ceph_conf=/etc/ceph/ceph.confrbd_flatten_volume_from_snapshot=falserbd_max_clone_depth=5glance_api_version=2rbd_user=cinderrbd_secret_uuid=e05983be-9251-44cb-9738-198bf9ec2d7e
8、 Configuring Cinder Backup
vi /etc/cinder/cinder.conf[DEFAULT]...backup_driver=cinder.backup.drivers.cephbackup_ceph_conf=/etc/ceph/ceph.confbackup_ceph_user=cinder-backupbackup_ceph_chunk_size=134217728backup_ceph_pool=backupsbackup_ceph_stripe_unit=0backup_ceph_stripe_count=0restore_discard_excess_bytes=true
9、 Configuring Nova
vi /etc/nova/nova.conf[DEFAULT]...libvirt_p_w_picpaths_type=rbdlibvirt_p_w_picpaths_rbd_pool=vmslibvirt_p_w_picpaths_rbd_ceph_conf=/etc/ceph/ceph.confrbd_user=cinderrbd_secret_uuid=e05983be-9251-44cb-9738-198bf9ec2d7elibvirt_inject_password=falselibvirt_inject_key=falselibvirt_inject_partition=-2libvirt_live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST"
10、 Restart OpenStack
service openstack-glance-api restartservice openstack-nova-compute restartservice openstack-cinder-volume restart
10、Test