DevStack plugin to configure Ceph backend.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

plugin.sh 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. # ceph.sh - DevStack extras script to install Ceph
  2. if [[ "$1" == "source" ]]; then
  3. # Initial source
  4. source $TOP_DIR/lib/ceph
  5. elif [[ "$1" == "stack" && "$2" == "pre-install" ]]; then
  6. if [[ "$ENABLE_CEPH_RGW" = "True" ]] && (is_service_enabled swift); then
  7. die $LINENO \
  8. "You cannot activate both Swift and Ceph Rados Gateway, \
  9. please disable Swift or set ENABLE_CEPH_RGW=False"
  10. fi
  11. echo_summary "Installing Ceph"
  12. check_os_support_ceph
  13. if [ "$REMOTE_CEPH" = "False" ]; then
  14. if [ "$CEPH_CONTAINERIZED" = "True" ]; then
  15. echo_summary "Configuring and initializing Ceph"
  16. deploy_containerized_ceph
  17. else
  18. install_ceph
  19. echo_summary "Configuring Ceph"
  20. configure_ceph
  21. # NOTE (leseb): we do everything here
  22. # because we need to have Ceph started before the main
  23. # OpenStack components.
  24. # Ceph OSD must start here otherwise we can't upload any images.
  25. echo_summary "Initializing Ceph"
  26. init_ceph
  27. start_ceph
  28. fi
  29. else
  30. install_ceph_remote
  31. fi
  32. elif [[ "$1" == "stack" && "$2" == "install" ]]; then
  33. # FIXME(melwitt): This is a hack to get around a namespacing issue with
  34. # Paste and PasteDeploy. Recently, we updated to use the Pike UCA packages
  35. # and the Ceph packages in the Pike UCA are pulling in python-paste and
  36. # python-pastedeploy packages. The python-pastedeploy package satisfies the
  37. # upper-constraints but python-paste does not, so devstack pip installs a
  38. # newer version of it, while python-pastedeploy remains. The mismatch
  39. # between the install path of paste and paste.deploy causes Keystone to
  40. # fail to start, with "ImportError: cannot import name deploy."
  41. pip_install -U --force PasteDeploy
  42. elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
  43. if is_ceph_enabled_for_service glance; then
  44. echo_summary "Configuring Glance for Ceph"
  45. configure_ceph_glance
  46. fi
  47. if is_ceph_enabled_for_service nova; then
  48. echo_summary "Configuring Nova for Ceph"
  49. configure_ceph_nova
  50. fi
  51. if is_ceph_enabled_for_service cinder; then
  52. echo_summary "Configuring Cinder for Ceph"
  53. configure_ceph_cinder
  54. fi
  55. if is_ceph_enabled_for_service cinder || \
  56. is_ceph_enabled_for_service nova; then
  57. # NOTE (leseb): the part below is a requirement
  58. # to attach Ceph block devices
  59. echo_summary "Configuring libvirt secret"
  60. import_libvirt_secret_ceph
  61. fi
  62. if is_ceph_enabled_for_service manila; then
  63. echo_summary "Configuring Manila for Ceph"
  64. configure_ceph_manila
  65. fi
  66. if [ "$REMOTE_CEPH" = "False" ]; then
  67. if is_ceph_enabled_for_service glance; then
  68. echo_summary "Configuring Glance for Ceph"
  69. configure_ceph_embedded_glance
  70. fi
  71. if is_ceph_enabled_for_service nova; then
  72. echo_summary "Configuring Nova for Ceph"
  73. configure_ceph_embedded_nova
  74. fi
  75. if is_ceph_enabled_for_service cinder; then
  76. echo_summary "Configuring Cinder for Ceph"
  77. configure_ceph_embedded_cinder
  78. fi
  79. if is_ceph_enabled_for_service manila; then
  80. echo_summary "Configuring Manila for Ceph"
  81. configure_ceph_embedded_manila
  82. fi
  83. if [ "$ENABLE_CEPH_RGW" = "True" ]; then
  84. echo_summary "Configuring Rados Gateway with Keystone for Swift"
  85. configure_ceph_embedded_rgw
  86. if [ "$CEPH_CONTAINERIZED" = "False" ]; then
  87. start_ceph_embedded_rgw
  88. else
  89. _configure_ceph_rgw_container
  90. fi
  91. fi
  92. fi
  93. elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then
  94. if is_service_enabled tempest; then
  95. iniset $TEMPEST_CONFIG compute-feature-enabled swap_volume False
  96. # This is only being set because the tempest test
  97. # test_shelve_unshelve_server fails with an
  98. # "After unshelve, shelved image is not deleted"
  99. # failure. Re-enable this feature when that test is fixed.
  100. # https://review.openstack.org/#/c/471352/
  101. iniset $TEMPEST_CONFIG compute-feature-enabled shelve False
  102. fi
  103. fi
  104. if [[ "$1" == "unstack" ]]; then
  105. if [ "$CEPH_CONTAINERIZED" = "False" ]; then
  106. if [ "$REMOTE_CEPH" = "True" ]; then
  107. cleanup_ceph_remote
  108. else
  109. stop_ceph
  110. cleanup_ceph_embedded
  111. fi
  112. else
  113. cleanup_containerized_ceph
  114. fi
  115. cleanup_ceph_general
  116. fi
  117. if [[ "$1" == "clean" ]]; then
  118. if [ "$REMOTE_CEPH" = "True" ]; then
  119. cleanup_ceph_remote
  120. else
  121. cleanup_ceph_embedded
  122. fi
  123. cleanup_ceph_general
  124. fi