Sébastien Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 1 | # ceph.sh - DevStack extras script to install Ceph |
| 2 | |
| 3 | if is_service_enabled ceph; then |
| 4 | if [[ "$1" == "source" ]]; then |
| 5 | # Initial source |
| 6 | source $TOP_DIR/lib/ceph |
| 7 | elif [[ "$1" == "stack" && "$2" == "pre-install" ]]; then |
| 8 | echo_summary "Installing Ceph" |
Sébastien Han | 4eb04a5 | 2014-12-04 16:22:41 +0100 | [diff] [blame] | 9 | check_os_support_ceph |
| 10 | if [ "$REMOTE_CEPH" = "False" ]; then |
| 11 | install_ceph |
| 12 | echo_summary "Configuring Ceph" |
| 13 | configure_ceph |
| 14 | # NOTE (leseb): Do everything here because we need to have Ceph started before the main |
| 15 | # OpenStack components. Ceph OSD must start here otherwise we can't upload any images. |
| 16 | echo_summary "Initializing Ceph" |
| 17 | init_ceph |
| 18 | start_ceph |
| 19 | else |
| 20 | install_ceph_remote |
| 21 | fi |
Sébastien Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 22 | elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then |
| 23 | if is_service_enabled glance; then |
| 24 | echo_summary "Configuring Glance for Ceph" |
| 25 | configure_ceph_glance |
| 26 | fi |
| 27 | if is_service_enabled nova; then |
| 28 | echo_summary "Configuring Nova for Ceph" |
| 29 | configure_ceph_nova |
| 30 | fi |
| 31 | if is_service_enabled cinder; then |
| 32 | echo_summary "Configuring Cinder for Ceph" |
| 33 | configure_ceph_cinder |
Sébastien Han | fa16ae9 | 2014-10-06 00:15:33 +0200 | [diff] [blame] | 34 | fi |
| 35 | if is_service_enabled cinder || is_service_enabled nova; then |
| 36 | # NOTE (leseb): the part below is a requirement to attach Ceph block devices |
Sébastien Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 37 | echo_summary "Configuring libvirt secret" |
| 38 | import_libvirt_secret_ceph |
| 39 | fi |
Sébastien Han | 4eb04a5 | 2014-12-04 16:22:41 +0100 | [diff] [blame] | 40 | |
| 41 | if [ "$REMOTE_CEPH" = "False" ]; then |
| 42 | if is_service_enabled glance; then |
| 43 | echo_summary "Configuring Glance for Ceph" |
| 44 | configure_ceph_embedded_glance |
| 45 | fi |
| 46 | if is_service_enabled nova; then |
| 47 | echo_summary "Configuring Nova for Ceph" |
| 48 | configure_ceph_embedded_nova |
| 49 | fi |
| 50 | if is_service_enabled cinder; then |
| 51 | echo_summary "Configuring Cinder for Ceph" |
| 52 | configure_ceph_embedded_cinder |
| 53 | fi |
| 54 | fi |
Sébastien Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 55 | fi |
| 56 | |
| 57 | if [[ "$1" == "unstack" ]]; then |
Sébastien Han | 4eb04a5 | 2014-12-04 16:22:41 +0100 | [diff] [blame] | 58 | if [ "$REMOTE_CEPH" = "True" ]; then |
| 59 | cleanup_ceph_remote |
| 60 | else |
| 61 | cleanup_ceph_embedded |
| 62 | stop_ceph |
| 63 | fi |
| 64 | cleanup_ceph_general |
Sébastien Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 65 | fi |
| 66 | |
| 67 | if [[ "$1" == "clean" ]]; then |
Sébastien Han | 4eb04a5 | 2014-12-04 16:22:41 +0100 | [diff] [blame] | 68 | if [ "$REMOTE_CEPH" = "True" ]; then |
| 69 | cleanup_ceph_remote |
| 70 | else |
| 71 | cleanup_ceph_embedded |
| 72 | fi |
| 73 | cleanup_ceph_general |
Sébastien Han | 36f2f02 | 2014-01-06 18:09:26 +0100 | [diff] [blame] | 74 | fi |
| 75 | fi |