Cinder volume update_host support for upgrade-db
This commit adds cinder-manage volume update_host for graph-based upgrade-db. Change-Id: Ibe937391ab95a085167ddda6d04c2999bb650ad0 Closes-Bug: 1641070
This commit is contained in:
parent
de0a2c1903
commit
08fa42d4ad
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
PUPPET_TYPE=$1
|
||||
RESOURCE_NAME=$2
|
||||
RESOURCE_PARAM=$3
|
||||
|
||||
echo `puppet resource ${PUPPET_TYPE} ${RESOURCE_NAME} | grep ${RESOURCE_PARAM} | awk '{print $3}' | tr -d "',"`
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
STORE_PATH=$1
|
||||
SCRIPT=`readlink -f $0`
|
||||
DIR=`dirname ${SCRIPT}`
|
||||
|
||||
|
||||
CINDER_HOST=`bash ${DIR}/fetch_puppet_resource_param.sh cinder_config DEFAULT/host value`
|
||||
CINDER_BACKEND=`bash ${DIR}/fetch_puppet_resource_param.sh cinder_config DEFAULT/volume_backend_name value`
|
||||
|
||||
echo "export CURRENT_HOST=\"${CINDER_HOST}#${CINDER_BACKEND}\"" > ${STORE_PATH}
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
STORE_PATH=$1
|
||||
SCRIPT=`readlink -f $0`
|
||||
DIR=`dirname ${SCRIPT}`
|
||||
|
||||
|
||||
CINDER_HOST=`bash ${DIR}/fetch_puppet_resource_param.sh cinder_config DEFAULT/host value`
|
||||
|
||||
if [[ -z ${CINDER_HOST} ]]; then
|
||||
CINDER_HOST=`bash ${DIR}/fetch_puppet_resource_param.sh cinder_config RBD-backend/backend_host value`
|
||||
fi
|
||||
|
||||
CINDER_BACKEND=`bash ${DIR}/fetch_puppet_resource_param.sh cinder_config RBD-backend/volume_backend_name value`
|
||||
|
||||
echo "export NEW_HOST=\"${CINDER_HOST}#${CINDER_BACKEND}\"" > ${STORE_PATH}
|
|
@ -82,3 +82,24 @@
|
|||
parameters:
|
||||
cmd: rm /etc/hiera/override/common.yaml || true
|
||||
timeout: 60
|
||||
|
||||
- id: store_cinder_current_host
|
||||
type: shell
|
||||
version: 2.1.0
|
||||
groups: [primary-controller]
|
||||
requires: [mysqldump_upload_to_master]
|
||||
required_for: []
|
||||
parameters:
|
||||
cmd: bash /etc/fuel/octane/puppet/octane_tasks/files/store_current_host.sh /tmp/cinder_current_host
|
||||
timeout: 60
|
||||
|
||||
- id: cinder_current_host_upload_to_master
|
||||
type: sync
|
||||
version: 2.1.0
|
||||
groups: [primary-controller]
|
||||
requires: [store_cinder_current_host]
|
||||
required_for: []
|
||||
parameters:
|
||||
src: /tmp/cinder_current_host
|
||||
dst: rsync://{MASTER_IP}:/octane_data/
|
||||
timeout: 180
|
||||
|
|
|
@ -114,3 +114,40 @@
|
|||
parameters:
|
||||
cmd: rm /etc/hiera/override/common.yaml || true
|
||||
timeout: 60
|
||||
|
||||
- id: cinder_current_host_download_from_master
|
||||
type: sync
|
||||
version: 2.0.0
|
||||
groups: [primary-controller]
|
||||
requires: []
|
||||
required_for: []
|
||||
condition:
|
||||
yaql_exp: "$.upgrade.relation_info.orig_cluster_version =~ '7\\.0'"
|
||||
parameters:
|
||||
src: rsync://{MASTER_IP}:/octane_data/cinder_current_host
|
||||
dst: /tmp
|
||||
timeout: 180
|
||||
|
||||
- id: store_cinder_new_host
|
||||
type: shell
|
||||
version: 2.1.0
|
||||
groups: [primary-controller]
|
||||
requires: []
|
||||
required_for: []
|
||||
condition:
|
||||
yaql_exp: "$.upgrade.relation_info.orig_cluster_version =~ '7\\.0'"
|
||||
parameters:
|
||||
cmd: bash /etc/fuel/octane/puppet/octane_tasks/files/store_new_host.sh /tmp/cinder_new_host
|
||||
timeout: 60
|
||||
|
||||
- id: cinder_update_host
|
||||
type: shell
|
||||
version: 2.1.0
|
||||
groups: [primary-controller]
|
||||
requires: [db_sync, cinder_current_host_download_from_master, store_cinder_new_host]
|
||||
required_for: []
|
||||
condition:
|
||||
yaql_exp: "$.upgrade.relation_info.orig_cluster_version =~ '7\\.0'"
|
||||
parameters:
|
||||
cmd: 'source /tmp/cinder_current_host; source /tmp/cinder_new_host; cinder-manage volume update_host --currenthost ${CURRENT_HOST} --newhost ${NEW_HOST}'
|
||||
timeout: 60
|
||||
|
|
Loading…
Reference in New Issue