Sean Dague | e263c82 | 2014-12-05 14:25:28 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
Sébastien Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 3 | # lib/cinder_backends/ceph |
| 4 | # Configure the ceph backend |
| 5 | |
| 6 | # Enable with: |
| 7 | # |
| 8 | # CINDER_ENABLED_BACKENDS+=,ceph:ceph |
Sébastien Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 9 | |
| 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 Wienand | 523f488 | 2015-10-13 11:03:03 +1100 | [diff] [blame] | 19 | _XTRACE_CINDER_CEPH=$(set +o | grep xtrace) |
Sébastien Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 20 | set +o xtrace |
| 21 | |
| 22 | |
| 23 | # Defaults |
| 24 | # -------- |
| 25 | |
Sébastien Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 26 | |
| 27 | # Entry Points |
| 28 | # ------------ |
| 29 | |
| 30 | # configure_cinder_backend_ceph - Set config files, create data dirs, etc |
| 31 | # configure_cinder_backend_ceph $name |
| 32 | function 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 Han | 556139e | 2016-08-18 15:09:44 +0200 | [diff] [blame] | 37 | iniset $CINDER_CONF $be_name rbd_ceph_conf "$CEPH_CONF_FILE" |
Sébastien Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 38 | iniset $CINDER_CONF $be_name rbd_pool "$CINDER_CEPH_POOL" |
| 39 | iniset $CINDER_CONF $be_name rbd_user "$CINDER_CEPH_USER" |
Matt Riedemann | aa47a0a | 2016-10-20 22:27:25 -0400 | [diff] [blame] | 40 | iniset $CINDER_CONF $be_name rbd_secret_uuid "$CINDER_CEPH_UUID" |
Sébastien Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 41 | 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 Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | # Restore xtrace |
Ian Wienand | 523f488 | 2015-10-13 11:03:03 +1100 | [diff] [blame] | 47 | $_XTRACE_CINDER_CEPH |
Sébastien Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 48 | |
| 49 | # Local variables: |
| 50 | # mode: shell-script |
| 51 | # End: |