blob: 38b901b7679b162240e824276bc3907e4d85a086 [file] [log] [blame]
Sébastien Han36f2f022014-01-06 18:09:26 +01001# ceph.sh - DevStack extras script to install Ceph
2
3if 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 Han4eb04a52014-12-04 16:22:41 +01009 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 Han36f2f022014-01-06 18:09:26 +010022 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 Hanfa16ae92014-10-06 00:15:33 +020034 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 Han36f2f022014-01-06 18:09:26 +010037 echo_summary "Configuring libvirt secret"
38 import_libvirt_secret_ceph
39 fi
Sébastien Han4eb04a52014-12-04 16:22:41 +010040
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 Han36f2f022014-01-06 18:09:26 +010055 fi
56
57 if [[ "$1" == "unstack" ]]; then
Sébastien Han4eb04a52014-12-04 16:22:41 +010058 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 Han36f2f022014-01-06 18:09:26 +010065 fi
66
67 if [[ "$1" == "clean" ]]; then
Sébastien Han4eb04a52014-12-04 16:22:41 +010068 if [ "$REMOTE_CEPH" = "True" ]; then
69 cleanup_ceph_remote
70 else
71 cleanup_ceph_embedded
72 fi
73 cleanup_ceph_general
Sébastien Han36f2f022014-01-06 18:09:26 +010074 fi
75fi