Ceph 与 OpenStack系统集成指南(2)

编辑/etc/cinder/cinder.conf:

[DEFAULT] ... enabled_backends = ceph ... [ceph] volume_driver = cinder.volume.drivers.rbd.RBDDriver rbd_pool = volumes rbd_ceph_conf = /etc/ceph/ceph.conf rbd_flatten_volume_from_snapshot = false rbd_max_clone_depth = 5 rbd_store_chunk_size = 4 rados_connect_timeout = -1 glance_api_version = 2

 

在启用了cephx认证时,还需要配置认证信息:

[ceph] ... rbd_user = cinder rbd_secret_uuid = 22003ebb-0f32-400e-9584-fa90b6efd874

 

注:如果你需要配置多个cinder back ends,一定要在 [DEFAULT] 部分设置glance_api_version = 2 。

 

下表来自OpenStack官网Liberty的配置文档:

Description of Ceph storage configuration options Configuration option = Default valueDescription
[DEFAULT]
rados_connect_timeout = -1   (IntOpt) Timeout value (in seconds) used when connecting to ceph cluster. If value < 0, no timeout is set and default librados value is used.  
rados_connection_interval = 5   (IntOpt) Interval value (in seconds) between connection retries to ceph cluster.  
rados_connection_retries = 3   (IntOpt) Number of retries if connection to ceph cluster failed.  
rbd_ceph_conf =   (StrOpt) Path to the ceph configuration file  
rbd_cluster_name = ceph   (StrOpt) The name of ceph cluster  
rbd_flatten_volume_from_snapshot = False   (BoolOpt) Flatten volumes created from snapshots to remove dependency from volume to snapshot  
rbd_max_clone_depth = 5   (IntOpt) Maximum number of nested volume clones that are taken before a flatten occurs. Set to 0 to disable cloning.  
rbd_pool = rbd   (StrOpt) The RADOS pool where rbd volumes are stored  
rbd_secret_uuid = None   (StrOpt) The libvirt uuid of the secret for the rbd_user volumes  
rbd_store_chunk_size = 4   (IntOpt) Volumes will be chunked into objects of this size (in megabytes).  
rbd_user = None   (StrOpt) The RADOS client name for accessing rbd volumes - only set when using cephx authentication  
volume_tmp_dir = None   (StrOpt) Directory where temporary image files are stored when the volume driver does not write them directly to the volume. Warning: this option is now deprecated, please use image_conversion_dir instead.  

 

 

 

6、设置Cinder Backup集成Ceph

OpenStack Cinder Backup需要一个专门的进程。在你的Cinder Backup节点上,编辑/etc/cinder/cinder.conf:

backup_driver = cinder.backup.drivers.ceph backup_ceph_conf = /etc/ceph/ceph.conf backup_ceph_user = cinder-backup backup_ceph_chunk_size = 134217728 backup_ceph_pool = backups backup_ceph_stripe_unit = 0 backup_ceph_stripe_count = 0 restore_discard_excess_bytes = true

 

以下是来自OpenStack官网对Cinder Backup集成Ceph的配置说明:

To enable the Ceph backup driver, include the following option in the cinder.conf file:

backup_driver = cinder.backup.drivers.ceph

The following configuration options are available for the Ceph backup driver.

Table 2.52. Description of Ceph backup driver configuration options Configuration option = Default valueDescription
[DEFAULT]
backup_ceph_chunk_size = 134217728   (IntOpt) The chunk size, in bytes, that a backup is broken into before transfer to the Ceph object store.  
backup_ceph_conf = /etc/ceph/ceph.conf   (StrOpt) Ceph configuration file to use.  
backup_ceph_pool = backups   (StrOpt) The Ceph pool where volume backups are stored.  
backup_ceph_stripe_count = 0   (IntOpt) RBD stripe count to use when creating a backup image.  
backup_ceph_stripe_unit = 0   (IntOpt) RBD stripe unit to use when creating a backup image.  
backup_ceph_user = cinder   (StrOpt) The Ceph user to connect with. Default here is to use the same user as for Cinder volumes. If not using cephx this should be set to None.  
restore_discard_excess_bytes = True   (BoolOpt) If True, always discard excess bytes when restoring volumes i.e. pad with zeroes.  

This example shows the default options for the Ceph backup driver.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/c02c80a17653bbd9bfa021a9c3eda478.html