diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-07-08 14:22:33 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-07-08 14:22:33 +0000 |
| commit | fb7ced9cea5243e02a1e072f4ea4e09ed73cfc7e (patch) | |
| tree | a93b2dcada73644067143287292a943ff9646485 /docker/common/cinder-app/cinder-backup | |
| parent | 4c4181d54a5fe5491db8e3f4f29a615005d23c64 (diff) | |
| parent | a5a469c102c091255ffacd284be123da9a98a539 (diff) | |
| download | kolla-fb7ced9cea5243e02a1e072f4ea4e09ed73cfc7e.tar.gz kolla-fb7ced9cea5243e02a1e072f4ea4e09ed73cfc7e.zip | |
Merge "Add config-internal/config-external for cinder"
Diffstat (limited to 'docker/common/cinder-app/cinder-backup')
| -rw-r--r-- | docker/common/cinder-app/cinder-backup/config-external.sh | 9 | ||||
| -rw-r--r-- | docker/common/cinder-app/cinder-backup/config-internal.sh | 45 | ||||
| -rwxr-xr-x | docker/common/cinder-app/cinder-backup/start.sh | 47 |
3 files changed, 62 insertions, 39 deletions
diff --git a/docker/common/cinder-app/cinder-backup/config-external.sh b/docker/common/cinder-app/cinder-backup/config-external.sh new file mode 100644 index 000000000..b3d258251 --- /dev/null +++ b/docker/common/cinder-app/cinder-backup/config-external.sh @@ -0,0 +1,9 @@ +OURCE="/opt/kolla/cinder/cinder.conf" +TARGET="/etc/cinder/cinder.conf" +OWNER="cinder" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker/common/cinder-app/cinder-backup/config-internal.sh b/docker/common/cinder-app/cinder-backup/config-internal.sh new file mode 100644 index 000000000..3227ddab2 --- /dev/null +++ b/docker/common/cinder-app/cinder-backup/config-internal.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +set -e + +. /opt/kolla/kolla-common.sh +. /opt/kolla/config-cinder.sh + +check_required_vars CINDER_BACKUP_DRIVER CINDER_BACKUP_MANAGER \ + CINDER_BACKUP_API_CLASS CINDER_BACKUP_NAME_TEMPLATE + +cfg=/etc/cinder/cinder.conf + +# volume backup configuration +crudini --set $cfg \ + DEFAULT \ + backup_driver \ + "${CINDER_BACKUP_DRIVER}" +crudini --set $cfg \ + DEFAULT \ + backup_topic \ + "cinder-backup" +crudini --set $cfg \ + DEFAULT \ + backup_manager \ + "${CINDER_BACKUP_MANAGER}" +crudini --set $cfg \ + DEFAULT \ + backup_api_class \ + "${CINDER_BACKUP_API_CLASS}" +crudini --set $cfg \ + DEFAULT \ + backup_name_template \ + "${CINDER_BACKUP_NAME_TEMPLATE}" + +# https://bugs.launchpad.net/kolla/+bug/1461635 +# Cinder requires mounting /dev in the cinder-volume, nova-compute, +# and libvirt containers. If /dev/pts/ptmx does not have proper permissions +# on the host, then libvirt will fail to boot an instance. +# This is a bug in Docker where it is not correctly mounting /dev/pts +# Tech Debt tracker: https://bugs.launchpad.net/kolla/+bug/1468962 +# **Temporary fix** +chmod 666 /dev/pts/ptmx + +echo "Starting cinder-backup" +exec /usr/bin/cinder-backup --config-file $cfg diff --git a/docker/common/cinder-app/cinder-backup/start.sh b/docker/common/cinder-app/cinder-backup/start.sh index 3227ddab2..1cc902db6 100755 --- a/docker/common/cinder-app/cinder-backup/start.sh +++ b/docker/common/cinder-app/cinder-backup/start.sh @@ -1,45 +1,14 @@ #!/bin/bash -set -e +set -o errexit -. /opt/kolla/kolla-common.sh -. /opt/kolla/config-cinder.sh +CMD="/usr/bin/cinder-backup" +ARGS="" -check_required_vars CINDER_BACKUP_DRIVER CINDER_BACKUP_MANAGER \ - CINDER_BACKUP_API_CLASS CINDER_BACKUP_NAME_TEMPLATE +# Loading common functions. +source /opt/kolla/kolla-common.sh -cfg=/etc/cinder/cinder.conf +# Config-internal script exec out of this function, it does not return here. +set_configs -# volume backup configuration -crudini --set $cfg \ - DEFAULT \ - backup_driver \ - "${CINDER_BACKUP_DRIVER}" -crudini --set $cfg \ - DEFAULT \ - backup_topic \ - "cinder-backup" -crudini --set $cfg \ - DEFAULT \ - backup_manager \ - "${CINDER_BACKUP_MANAGER}" -crudini --set $cfg \ - DEFAULT \ - backup_api_class \ - "${CINDER_BACKUP_API_CLASS}" -crudini --set $cfg \ - DEFAULT \ - backup_name_template \ - "${CINDER_BACKUP_NAME_TEMPLATE}" - -# https://bugs.launchpad.net/kolla/+bug/1461635 -# Cinder requires mounting /dev in the cinder-volume, nova-compute, -# and libvirt containers. If /dev/pts/ptmx does not have proper permissions -# on the host, then libvirt will fail to boot an instance. -# This is a bug in Docker where it is not correctly mounting /dev/pts -# Tech Debt tracker: https://bugs.launchpad.net/kolla/+bug/1468962 -# **Temporary fix** -chmod 666 /dev/pts/ptmx - -echo "Starting cinder-backup" -exec /usr/bin/cinder-backup --config-file $cfg +exec $CMD $ARGS |
