blob: 0b465730c05b4cde8485c0a6aa5a5dbe973f7b4c [file] [log] [blame]
Sean Daguee263c822014-12-05 14:25:28 -05001#!/bin/bash
2#
Sébastien Han36f2f022014-01-06 18:09:26 +01003# lib/cinder_backends/ceph
4# Configure the ceph backend
5
6# Enable with:
7#
8# CINDER_ENABLED_BACKENDS+=,ceph:ceph
Sébastien Han36f2f022014-01-06 18:09:26 +01009
10# Dependencies:
11#
12# - ``functions`` file
13# - ``cinder`` configurations
14
15# configure_ceph_backend_lvm - called from configure_cinder()
16
17
18# Save trace setting
Ian Wienand523f4882015-10-13 11:03:03 +110019_XTRACE_CINDER_CEPH=$(set +o | grep xtrace)
Sébastien Han36f2f022014-01-06 18:09:26 +010020set +o xtrace
21
22
23# Defaults
24# --------
25
Sébastien Han36f2f022014-01-06 18:09:26 +010026
27# Entry Points
28# ------------
29
30# configure_cinder_backend_ceph - Set config files, create data dirs, etc
31# configure_cinder_backend_ceph $name
32function configure_cinder_backend_ceph {
33 local be_name=$1
34
35 iniset $CINDER_CONF $be_name volume_backend_name $be_name
36 iniset $CINDER_CONF $be_name volume_driver "cinder.volume.drivers.rbd.RBDDriver"
Sébastien Han556139e2016-08-18 15:09:44 +020037 iniset $CINDER_CONF $be_name rbd_ceph_conf "$CEPH_CONF_FILE"
Sébastien Han36f2f022014-01-06 18:09:26 +010038 iniset $CINDER_CONF $be_name rbd_pool "$CINDER_CEPH_POOL"
39 iniset $CINDER_CONF $be_name rbd_user "$CINDER_CEPH_USER"
Matt Riedemannaa47a0a2016-10-20 22:27:25 -040040 iniset $CINDER_CONF $be_name rbd_secret_uuid "$CINDER_CEPH_UUID"
Sébastien Han36f2f022014-01-06 18:09:26 +010041 iniset $CINDER_CONF $be_name rbd_flatten_volume_from_snapshot False
42 iniset $CINDER_CONF $be_name rbd_max_clone_depth 5
43 iniset $CINDER_CONF DEFAULT glance_api_version 2
Sébastien Han36f2f022014-01-06 18:09:26 +010044}
45
46# Restore xtrace
Ian Wienand523f4882015-10-13 11:03:03 +110047$_XTRACE_CINDER_CEPH
Sébastien Han36f2f022014-01-06 18:09:26 +010048
49# Local variables:
50# mode: shell-script
51# End: