diff options
| author | Amy Fong <amy.fong@windriver.com> | 2014-07-24 13:04:41 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-07-25 15:45:25 -0400 |
| commit | 3bbd08214617f5a5e7b54253f9f8b786623546c8 (patch) | |
| tree | d782a074f3a013b302446817ef9d147ddee6bb60 /meta-openstack/recipes-devtools/python/python-cinder/cinder.init | |
| parent | ce99c21125614dfa72428a9ef3ed563db8c99c93 (diff) | |
| download | meta-cloud-services-3bbd08214617f5a5e7b54253f9f8b786623546c8.tar.gz | |
openstack initscript: add reset
Some of the openstack data is associated with external resources
(ie glance may have external files), we explicitly invoke the delete commands on those
in additional to dropping and recreating the databases.
Signed-off-by: Amy Fong <amy.fong@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-cinder/cinder.init')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-cinder/cinder.init | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-cinder/cinder.init b/meta-openstack/recipes-devtools/python/python-cinder/cinder.init index ecf9d66..f130ac8 100644 --- a/meta-openstack/recipes-devtools/python/python-cinder/cinder.init +++ b/meta-openstack/recipes-devtools/python/python-cinder/cinder.init | |||
| @@ -71,6 +71,39 @@ status() | |||
| 71 | echo "$DESC is not running" | 71 | echo "$DESC is not running" |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | reset() | ||
| 75 | { | ||
| 76 | . /etc/nova/openrc | ||
| 77 | |||
| 78 | # Cleanup cinder volume | ||
| 79 | simple_delete "cinder list --all-tenant" "cinder delete" 1 "cinder volume" | ||
| 80 | |||
| 81 | # Cleanup cinder backup | ||
| 82 | simple_delete "cinder backup-list" "cinder backup-delete" 1 "cinder backup" | ||
| 83 | |||
| 84 | stop | ||
| 85 | |||
| 86 | if ! pidof postmaster > /dev/null; then | ||
| 87 | /etc/init.d/postgresql-init | ||
| 88 | /etc/init.d/postgresql start | ||
| 89 | fi | ||
| 90 | [ ! -d /var/log/cinder ] && mkdir /var/log/cinder | ||
| 91 | sudo -u postgres dropdb cinder | ||
| 92 | sudo -u postgres createdb cinder | ||
| 93 | cinder-manage db sync | ||
| 94 | |||
| 95 | if [ ! -f /etc/cinder/nfs_shares ]; then | ||
| 96 | /bin/bash /etc/cinder/drivers/nfs_setup.sh | ||
| 97 | fi | ||
| 98 | |||
| 99 | # Create Cinder glusterfs_share config file with default glusterfs server | ||
| 100 | if [ ! -f /etc/cinder/glusterfs_shares ] && [ -f /usr/sbin/glusterfsd ]; then | ||
| 101 | /bin/bash /etc/cinder/drivers/glusterfs_setup.sh | ||
| 102 | fi | ||
| 103 | |||
| 104 | start | ||
| 105 | } | ||
| 106 | |||
| 74 | case "$1" in | 107 | case "$1" in |
| 75 | start) | 108 | start) |
| 76 | start | 109 | start |
| @@ -85,8 +118,11 @@ case "$1" in | |||
| 85 | status) | 118 | status) |
| 86 | status | 119 | status |
| 87 | ;; | 120 | ;; |
| 121 | reset) | ||
| 122 | reset | ||
| 123 | ;; | ||
| 88 | *) | 124 | *) |
| 89 | echo "Usage: $0 {start|stop|force-reload|restart|reload|status}" | 125 | echo "Usage: $0 {start|stop|force-reload|restart|reload|status|reset}" |
| 90 | exit 1 | 126 | exit 1 |
| 91 | ;; | 127 | ;; |
| 92 | esac | 128 | esac |
