diff options
| author | Mark Asselstine <mark.asselstine@windriver.com> | 2018-04-30 14:51:41 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2018-05-01 23:15:31 -0400 |
| commit | edb9fed9aca8452e54624d9da109cdd7cabcf30c (patch) | |
| tree | d4e82ce24e800b24d08548a138b3df0488eda780 /meta-openstack/recipes-devtools/python/python-cinder/cinder.init | |
| parent | db5a6a32fed0b97dcaa590120558c857f30c1bec (diff) | |
| download | meta-cloud-services-edb9fed9aca8452e54624d9da109cdd7cabcf30c.tar.gz | |
python-cinder: uprev to latest stable/pike
Requires the introduction of python-oauth2client and
python-google-api-python-client packages/recipes. As with other
openstack component uprev's we move some of the initialization from
the first run scripts to the cinder-init.service which is run on first
boot. This allows for someone to disable the default configuration by
not including the cinder-init package in their image.
The initialization is done following the guide at:
At this point we have cinder up and running, which we can verify using
the "openstack volume service list" command.
root@controller:~# openstack volume service list
+------------------+----------------------+------+---------+-------+----------------------------+
| Binary | Host | Zone | Status | State | Updated At |
+------------------+----------------------+------+---------+-------+----------------------------+
| cinder-backup | controller | nova | enabled | down | 2018-04-30T15:31:08.330770 |
| cinder-volume | controller@nfsdriver | nova | enabled | down | 2018-04-30T15:31:10.477678 |
| cinder-scheduler | controller | nova | enabled | down | 2018-04-30T15:31:10.653041 |
+------------------+----------------------+------+---------+-------+----------------------------+
We will have to adjust the configuration for a compute node but at
this point we are concentrating on the initial configuration for the
controller image.
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@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 | 130 |
1 files changed, 0 insertions, 130 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-cinder/cinder.init b/meta-openstack/recipes-devtools/python/python-cinder/cinder.init deleted file mode 100644 index 4c97962..0000000 --- a/meta-openstack/recipes-devtools/python/python-cinder/cinder.init +++ /dev/null | |||
| @@ -1,130 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | ### BEGIN INIT INFO | ||
| 4 | # Provides: cinder-api | ||
| 5 | # Required-Start: $remote_fs $syslog | ||
| 6 | # Required-Stop: $remote_fs $syslog | ||
| 7 | # Should-Start: postgresql rabbitmq-server | ||
| 8 | # Should-Stop: postgresql rabbitmq-server | ||
| 9 | # Default-Start: 3 5 | ||
| 10 | # Default-Stop: 0 1 2 6 | ||
| 11 | # Short-Description: OpenStack Block Storage (Cinder) - API | ||
| 12 | # Description: OpenStack Block Storage (Cinder) - API | ||
| 13 | ### END INIT INFO | ||
| 14 | |||
| 15 | SUFFIX=@suffix@ | ||
| 16 | DESC="cinder-$SUFFIX" | ||
| 17 | DAEMON="/usr/bin/cinder-$SUFFIX" | ||
| 18 | PIDFILE="/var/run/cinder-$SUFFIX.pid" | ||
| 19 | |||
| 20 | start() | ||
| 21 | { | ||
| 22 | if [ -e $PIDFILE ]; then | ||
| 23 | PIDDIR=/proc/$(cat $PIDFILE) | ||
| 24 | if [ -d ${PIDDIR} ]; then | ||
| 25 | echo "$DESC already running." | ||
| 26 | exit 1 | ||
| 27 | else | ||
| 28 | echo "Removing stale PID file $PIDFILE" | ||
| 29 | rm -f $PIDFILE | ||
| 30 | fi | ||
| 31 | fi | ||
| 32 | |||
| 33 | if [ ! -d /var/log/cinder ]; then | ||
| 34 | mkdir /var/log/cinder | ||
| 35 | fi | ||
| 36 | |||
| 37 | echo -n "Starting $DESC..." | ||
| 38 | |||
| 39 | start-stop-daemon --start --quiet --background \ | ||
| 40 | --pidfile ${PIDFILE} --make-pidfile --exec ${DAEMON} \ | ||
| 41 | -- --log-dir=/var/log/cinder | ||
| 42 | |||
| 43 | if [ $? -eq 0 ]; then | ||
| 44 | echo "done." | ||
| 45 | else | ||
| 46 | echo "failed." | ||
| 47 | fi | ||
| 48 | } | ||
| 49 | |||
| 50 | stop() | ||
| 51 | { | ||
| 52 | echo -n "Stopping $DESC..." | ||
| 53 | start-stop-daemon --stop --quiet --pidfile $PIDFILE | ||
| 54 | if [ $? -eq 0 ]; then | ||
| 55 | echo "done." | ||
| 56 | else | ||
| 57 | echo "failed." | ||
| 58 | fi | ||
| 59 | rm -f $PIDFILE | ||
| 60 | } | ||
| 61 | |||
| 62 | status() | ||
| 63 | { | ||
| 64 | pid=`cat $PIDFILE 2>/dev/null` | ||
| 65 | if [ -n "$pid" ]; then | ||
| 66 | if ps -p $pid > /dev/null 2>&1 ; then | ||
| 67 | echo "$DESC is running" | ||
| 68 | return | ||
| 69 | fi | ||
| 70 | fi | ||
| 71 | echo "$DESC is not running" | ||
| 72 | } | ||
| 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 | |||
| 107 | case "$1" in | ||
| 108 | start) | ||
| 109 | start | ||
| 110 | ;; | ||
| 111 | stop) | ||
| 112 | stop | ||
| 113 | ;; | ||
| 114 | restart|force-reload|reload) | ||
| 115 | stop | ||
| 116 | start | ||
| 117 | ;; | ||
| 118 | status) | ||
| 119 | status | ||
| 120 | ;; | ||
| 121 | reset) | ||
| 122 | reset | ||
| 123 | ;; | ||
| 124 | *) | ||
| 125 | echo "Usage: $0 {start|stop|force-reload|restart|reload|status|reset}" | ||
| 126 | exit 1 | ||
| 127 | ;; | ||
| 128 | esac | ||
| 129 | |||
| 130 | exit 0 | ||
