Este contenido no está disponible en el idioma seleccionado.
Chapter 3. Configuring OpenStack to use Ceph block devices
As a storage administrator, you must configure the Red Hat OpenStack Platform to use the Ceph block devices. The Red Hat OpenStack Platform can use Ceph block devices for Cinder, Cinder Backup, Glance, and Nova.
3.1. Prerequisites Copiar enlaceEnlace copiado en el portapapeles!
- A new or existing Red Hat Ceph Storage cluster.
- A running Red Hat OpenStack Platform environment.
3.2. Configuring Cinder to use Ceph block devices Copiar enlaceEnlace copiado en el portapapeles!
The Red Hat OpenStack Platform can use Ceph block devices to provide back-end storage for Cinder volumes.
Prerequisites
- Root-level access to the Cinder node.
-
A Ceph
volumepool. - The user and UUID of the secret to interact with Ceph block devices.
Procedure
Edit the Cinder configuration file:
vim /etc/cinder/cinder.conf
[root@cinder ~]# vim /etc/cinder/cinder.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow In the
[DEFAULT]section, enable Ceph as a backend for Cinder:enabled_backends = ceph
enabled_backends = cephCopy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that the Glance API version is set to 2. If you are configuring multiple cinder back ends in
enabled_backends, theglance_api_version = 2setting must be in the[DEFAULT]section and not the[ceph]section.glance_api_version = 2
glance_api_version = 2Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Create a
[ceph]section in thecinder.conffile. Add the Ceph settings in the following steps under the[ceph]section. Specify the
volume_driversetting and set it to use the Ceph block device driver:volume_driver = cinder.volume.drivers.rbd.RBDDriver
volume_driver = cinder.volume.drivers.rbd.RBDDriverCopy to Clipboard Copied! Toggle word wrap Toggle overflow Specify the cluster name and Ceph configuration file location. In typical deployments the Ceph cluster has a cluster name of
cephand a Ceph configuration file at/etc/ceph/ceph.conf. If the Ceph cluster name is notceph, specify the cluster name and configuration file path appropriately:rbd_cluster_name = us-west rbd_ceph_conf = /etc/ceph/us-west.conf
rbd_cluster_name = us-west rbd_ceph_conf = /etc/ceph/us-west.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow By default, Red Hat OpenStack Platform stores Ceph volumes in the
rbdpool. To use thevolumespool created earlier, specify therbd_poolsetting and set thevolumespool:rbd_pool = volumes
rbd_pool = volumesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Red Hat OpenStack Platform does not have a default user name or a UUID of the secret for volumes. Specify
rbd_userand set it to thecinderuser. Then, specify therbd_secret_uuidsetting and set it to the generated UUID stored in theuuid-secret.txtfile:rbd_user = cinder rbd_secret_uuid = 4b5fd580-360c-4f8c-abb5-c83bb9a3f964
rbd_user = cinder rbd_secret_uuid = 4b5fd580-360c-4f8c-abb5-c83bb9a3f964Copy to Clipboard Copied! Toggle word wrap Toggle overflow Specify the following settings:
rbd_flatten_volume_from_snapshot = false rbd_max_clone_depth = 5 rbd_store_chunk_size = 4 rados_connect_timeout = -1
rbd_flatten_volume_from_snapshot = false rbd_max_clone_depth = 5 rbd_store_chunk_size = 4 rados_connect_timeout = -1Copy to Clipboard Copied! Toggle word wrap Toggle overflow When you configure Cinder to use Ceph block devices, the configuration file might look similar to this:
Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteConsider removing the default
[lvm]section and its settings.
3.3. Configuring Cinder backup to use Ceph block devices Copiar enlaceEnlace copiado en el portapapeles!
The Red Hat OpenStack Platform can configure Cinder backup to use Ceph block devices.
Prerequisites
- Root-level access to the Cinder node.
Procedure
Edit the Cinder configuration file:
vim /etc/cinder/cinder.conf
[root@cinder ~]# vim /etc/cinder/cinder.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Go to the
[ceph]section of the configuration file. Specify the
backup_driversetting and set it to the Ceph driver:backup_driver = cinder.backup.drivers.ceph
backup_driver = cinder.backup.drivers.cephCopy to Clipboard Copied! Toggle word wrap Toggle overflow Specify the
backup_ceph_confsetting and specify the path to the Ceph configuration file:backup_ceph_conf = /etc/ceph/ceph.conf
backup_ceph_conf = /etc/ceph/ceph.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe Cinder backup Ceph configuration file may be different from the Ceph configuration file used for Cinder. For example, it can point to a different Ceph storage cluster.
Specify the Ceph pool for backups:
backup_ceph_pool = backups
backup_ceph_pool = backupsCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe Ceph configuration file used for Cinder backup might be different from the Ceph configuration file used for Cinder.
Specify the
backup_ceph_usersetting and specify the user ascinder-backup:backup_ceph_user = cinder-backup
backup_ceph_user = cinder-backupCopy to Clipboard Copied! Toggle word wrap Toggle overflow Specify the following settings:
backup_ceph_chunk_size = 134217728 backup_ceph_stripe_unit = 0 backup_ceph_stripe_count = 0 restore_discard_excess_bytes = true
backup_ceph_chunk_size = 134217728 backup_ceph_stripe_unit = 0 backup_ceph_stripe_count = 0 restore_discard_excess_bytes = trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow When you include the Cinder options, the
[ceph]section of thecinder.conffile might look similar to this:Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify if Cinder backup is enabled:
cat /etc/openstack-dashboard/local_settings | grep enable_backup
[root@cinder ~]# cat /etc/openstack-dashboard/local_settings | grep enable_backupCopy to Clipboard Copied! Toggle word wrap Toggle overflow If
enable_backupis set toFalse, then edit thelocal_settingsfile and set it toTrue.Example
OPENSTACK_CINDER_FEATURES = { 'enable_backup': True, }OPENSTACK_CINDER_FEATURES = { 'enable_backup': True, }Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.4. Configuring Glance to use Ceph block devices Copiar enlaceEnlace copiado en el portapapeles!
The Red Hat OpenStack Platform can configure Glance to use Ceph block devices.
Prerequisites
- Root-level access to the Glance node.
Procedure
To use Ceph block devices by default, edit the
/etc/glance/glance-api.conffile. If you used different pool, user or Ceph configuration file settings apply the appropriate values. Uncomment the following settings if necessary and change their values accordingly:vim /etc/glance/glance-api.conf
[root@glance ~]# vim /etc/glance/glance-api.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow To enable copy-on-write (CoW) cloning set
show_image_direct_urltoTrue.show_image_direct_url = True
show_image_direct_url = TrueCopy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantEnabling CoW exposes the back end location via Glance’s API, so the endpoint should not be publicly accessible.
Disable cache management if necessary. The
flavorshould be set tokeystoneonly, notkeystone+cachemanagement.flavor = keystone
flavor = keystoneCopy to Clipboard Copied! Toggle word wrap Toggle overflow Red Hat recommends the following properties for images:
hw_scsi_model=virtio-scsi hw_disk_bus=scsi hw_qemu_guest_agent=yes os_require_quiesce=yes
hw_scsi_model=virtio-scsi hw_disk_bus=scsi hw_qemu_guest_agent=yes os_require_quiesce=yesCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
virtio-scsicontroller gets better performance and provides support for discard operations. For systems using SCSI/SAS drives, connect every Cinder block device to that controller. Also, enable the QEMU guest agent and sendfs-freeze/thawcalls through the QEMU guest agent.
3.5. Configuring Nova to use Ceph block devices Copiar enlaceEnlace copiado en el portapapeles!
The Red Hat OpenStack Platform can configure Nova to use Ceph block devices.
You must configure each Nova node to use ephemeral back-end storage devices, which allows all virtual machines to use the Ceph block devices.
Prerequisites
- Root-level access to the Nova nodes.
Procedure
Edit the Ceph configuration file:
vim /etc/ceph/ceph.conf
[root@nova ~]# vim /etc/ceph/ceph.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following section to the
[client]section of the Ceph configuration file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create new directories for the admin socket and log file, and change the directory permissions to use the
qemuuser andlibvirtdgroup:mkdir -p /var/run/ceph/guests/ /var/log/ceph/ chown qemu:libvirt /var/run/ceph/guests /var/log/ceph/
[root@nova ~]# mkdir -p /var/run/ceph/guests/ /var/log/ceph/ [root@nova ~]# chown qemu:libvirt /var/run/ceph/guests /var/log/ceph/Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe directories must be allowed by SELinux or AppArmor.
On each Nova node, edit the
/etc/nova/nova.conffile. Under the[libvirt]section, configure the following settings:Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace the UUID in
rbd_user_secretwith the UUID in theuuid-secret.txtfile.
3.6. Restarting the OpenStack services Copiar enlaceEnlace copiado en el portapapeles!
Restarting the Red Hat OpenStack Platform services enables you to activate the Ceph block device drivers.
Prerequisites
- Root-level access to the Red Hat OpenStack Platform nodes.
Procedure
- Load the block device pool names and Ceph user names into the configuration file.
Restart the appropriate OpenStack services after modifying the corresponding configuration files:
systemctl restart openstack-cinder-volume systemctl restart openstack-cinder-backup systemctl restart openstack-glance-api systemctl restart openstack-nova-compute
[root@osp ~]# systemctl restart openstack-cinder-volume [root@osp ~]# systemctl restart openstack-cinder-backup [root@osp ~]# systemctl restart openstack-glance-api [root@osp ~]# systemctl restart openstack-nova-computeCopy to Clipboard Copied! Toggle word wrap Toggle overflow