Merge "Implement upgrade procedure"

This commit is contained in:
Jenkins 2017-02-22 16:04:43 +00:00 committed by Gerrit Code Review
commit 174a58f33b
3 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,5 @@
FROM {{ image_spec("cinder-base") }}
MAINTAINER {{ maintainer }}
RUN apt-get install -y --no-install-recommends mysql-client \
&& apt-get clean

View File

@ -0,0 +1,6 @@
#!/bin/bash -ex
set -o pipefail
BACKUP_FILE="/var/ccp/backup/cinder/backup-$(date "+%Y%m%d%H%M%S").sql"
mysqldump -h {{ address(service.database) }} \
-u {{ cinder.db.username }} -p{{ cinder.db.password }} \
--single-transaction {{ cinder.db.name }} > "${BACKUP_FILE}"

View File

@ -0,0 +1,42 @@
upgrade:
name: upgrade-cinder
image: cinder-upgrade
steps:
- name: backup
command: /opt/ccp/bin/backup.sh
files:
- backup-sh
volumes:
- name: backup-dir
path: /var/ccp/backup/cinder
type: host
readOnly: false
topology_key: backup
- name: db-sync
command: cinder-manage db sync
files:
- cinder-conf
- name: roll-api
type: rolling-upgrade
services:
- cinder-api
- name: roll-scheduler
type: rolling-upgrade
services:
- cinder-scheduler
- name: roll-volume
type: rolling-upgrade
services:
- cinder-volume
- name: roll-backup
type: rolling-upgrade
services:
- cinder-backup
files:
cinder-conf:
path: /etc/cinder/cinder.conf
content: cinder.conf.j2
backup-sh:
path: /opt/ccp/bin/backup.sh
content: backup.sh.j2
perm: "500"