Merge "Make the openvswitch 2.4->2.5 upgrade more robust"
This commit is contained in:
commit
6ec44d98b4
|
@ -5,18 +5,7 @@
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Special-case OVS for https://bugs.launchpad.net/tripleo/+bug/1635205
|
# Special-case OVS for https://bugs.launchpad.net/tripleo/+bug/1635205
|
||||||
if [[ -n $(rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep "systemctl.*try-restart") ]]; then
|
special_case_ovs_upgrade_if_needed
|
||||||
echo "Manual upgrade of openvswitch - restart in postun detected"
|
|
||||||
mkdir OVS_UPGRADE || true
|
|
||||||
pushd OVS_UPGRADE
|
|
||||||
echo "Attempting to downloading latest openvswitch with yumdownloader"
|
|
||||||
yumdownloader --resolve openvswitch
|
|
||||||
echo "Updating openvswitch with nopostun option"
|
|
||||||
rpm -U --replacepkgs --nopostun ./*.rpm
|
|
||||||
popd
|
|
||||||
else
|
|
||||||
echo "Skipping manual upgrade of openvswitch - no restart in postun detected"
|
|
||||||
fi
|
|
||||||
|
|
||||||
yum -y install python-zaqarclient # needed for os-collect-config
|
yum -y install python-zaqarclient # needed for os-collect-config
|
||||||
yum -y -q update
|
yum -y -q update
|
||||||
|
|
|
@ -8,7 +8,9 @@ set -o pipefail
|
||||||
|
|
||||||
UPGRADE_SCRIPT=/root/tripleo_upgrade_node.sh
|
UPGRADE_SCRIPT=/root/tripleo_upgrade_node.sh
|
||||||
|
|
||||||
cat > $UPGRADE_SCRIPT << 'ENDOFCAT'
|
declare -f special_case_ovs_upgrade_if_needed > $UPGRADE_SCRIPT
|
||||||
|
# use >> here so we don't lose the declaration we added above
|
||||||
|
cat >> $UPGRADE_SCRIPT << 'ENDOFCAT'
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
### DO NOT MODIFY THIS FILE
|
### DO NOT MODIFY THIS FILE
|
||||||
### This file is automatically delivered to the ceph-storage nodes as part of the
|
### This file is automatically delivered to the ceph-storage nodes as part of the
|
||||||
|
@ -49,19 +51,7 @@ timeout 60 bash -c "while kill -0 ${OSD_PIDS} 2> /dev/null; do
|
||||||
sleep 2;
|
sleep 2;
|
||||||
done"
|
done"
|
||||||
|
|
||||||
# Special-case OVS for https://bugs.launchpad.net/tripleo/+bug/1635205
|
special_case_ovs_upgrade_if_needed
|
||||||
if [[ -n $(rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep "systemctl.*try-restart") ]]; then
|
|
||||||
echo "Manual upgrade of openvswitch - restart in postun detected"
|
|
||||||
mkdir OVS_UPGRADE || true
|
|
||||||
pushd OVS_UPGRADE
|
|
||||||
echo "Attempting to downloading latest openvswitch with yumdownloader"
|
|
||||||
yumdownloader --resolve openvswitch
|
|
||||||
echo "Updating openvswitch with nopostun option"
|
|
||||||
rpm -U --replacepkgs --nopostun ./*.rpm
|
|
||||||
popd
|
|
||||||
else
|
|
||||||
echo "Skipping manual upgrade of openvswitch - no restart in postun detected"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Update (Ceph to Jewel)
|
# Update (Ceph to Jewel)
|
||||||
yum -y install python-zaqarclient # needed for os-collect-config
|
yum -y install python-zaqarclient # needed for os-collect-config
|
||||||
|
|
|
@ -18,19 +18,8 @@ set -eu
|
||||||
|
|
||||||
crudini --set /etc/nova/nova.conf upgrade_levels compute $upgrade_level_nova_compute
|
crudini --set /etc/nova/nova.conf upgrade_levels compute $upgrade_level_nova_compute
|
||||||
|
|
||||||
# Special-case OVS for https://bugs.launchpad.net/tripleo/+bug/1635205
|
$(declare -f special_case_ovs_upgrade_if_needed)
|
||||||
if [[ -n \$(rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep "systemctl.*try-restart") ]]; then
|
special_case_ovs_upgrade_if_needed
|
||||||
echo "Manual upgrade of openvswitch - restart in postun detected"
|
|
||||||
mkdir OVS_UPGRADE || true
|
|
||||||
pushd OVS_UPGRADE
|
|
||||||
echo "Attempting to downloading latest openvswitch with yumdownloader"
|
|
||||||
yumdownloader --resolve openvswitch
|
|
||||||
echo "Updating openvswitch with nopostun option"
|
|
||||||
rpm -U --replacepkgs --nopostun ./*.rpm
|
|
||||||
popd
|
|
||||||
else
|
|
||||||
echo "Skipping manual upgrade of openvswitch - no restart in postun detected"
|
|
||||||
fi
|
|
||||||
|
|
||||||
yum -y install python-zaqarclient # needed for os-collect-config
|
yum -y install python-zaqarclient # needed for os-collect-config
|
||||||
yum -y update
|
yum -y update
|
||||||
|
|
|
@ -100,18 +100,7 @@ if [ $DO_MYSQL_UPGRADE -eq 1 ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Special-case OVS for https://bugs.launchpad.net/tripleo/+bug/1635205
|
# Special-case OVS for https://bugs.launchpad.net/tripleo/+bug/1635205
|
||||||
if [[ -n $(rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep "systemctl.*try-restart") ]]; then
|
special_case_ovs_upgrade_if_needed
|
||||||
echo "Manual upgrade of openvswitch - restart in postun detected"
|
|
||||||
mkdir OVS_UPGRADE || true
|
|
||||||
pushd OVS_UPGRADE
|
|
||||||
echo "Attempting to downloading latest openvswitch with yumdownloader"
|
|
||||||
yumdownloader --resolve openvswitch
|
|
||||||
echo "Updating openvswitch with nopostun option"
|
|
||||||
rpm -U --replacepkgs --nopostun ./*.rpm
|
|
||||||
popd
|
|
||||||
else
|
|
||||||
echo "Skipping manual upgrade of openvswitch - no restart in postun detected"
|
|
||||||
fi
|
|
||||||
|
|
||||||
yum -y install python-zaqarclient # needed for os-collect-config
|
yum -y install python-zaqarclient # needed for os-collect-config
|
||||||
yum -y -q update
|
yum -y -q update
|
||||||
|
|
|
@ -23,19 +23,8 @@ function systemctl_swift {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Special-case OVS for https://bugs.launchpad.net/tripleo/+bug/1635205
|
$(declare -f special_case_ovs_upgrade_if_needed)
|
||||||
if [[ -n \$(rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep "systemctl.*try-restart") ]]; then
|
special_case_ovs_upgrade_if_needed
|
||||||
echo "Manual upgrade of openvswitch - restart in postun detected"
|
|
||||||
mkdir OVS_UPGRADE || true
|
|
||||||
pushd OVS_UPGRADE
|
|
||||||
echo "Attempting to downloading latest openvswitch with yumdownloader"
|
|
||||||
yumdownloader --resolve openvswitch
|
|
||||||
echo "Updating openvswitch with nopostun option"
|
|
||||||
rpm -U --replacepkgs --nopostun ./*.rpm
|
|
||||||
popd
|
|
||||||
else
|
|
||||||
echo "Skipping manual upgrade of openvswitch - no restart in postun detected"
|
|
||||||
fi
|
|
||||||
|
|
||||||
systemctl_swift stop
|
systemctl_swift stop
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,11 @@ resources:
|
||||||
depends_on: ControllerPacemakerUpgradeDeployment_Step1
|
depends_on: ControllerPacemakerUpgradeDeployment_Step1
|
||||||
properties:
|
properties:
|
||||||
group: script
|
group: script
|
||||||
config: {get_file: major_upgrade_block_storage.sh}
|
config:
|
||||||
|
list_join:
|
||||||
|
- ''
|
||||||
|
- - get_file: pacemaker_common_functions.sh
|
||||||
|
- get_file: major_upgrade_block_storage.sh
|
||||||
|
|
||||||
BlockStorageUpgradeDeployment:
|
BlockStorageUpgradeDeployment:
|
||||||
type: OS::Heat::SoftwareDeploymentGroup
|
type: OS::Heat::SoftwareDeploymentGroup
|
||||||
|
|
|
@ -54,19 +54,28 @@ resources:
|
||||||
upgrade_level_nova_compute='UPGRADE_LEVEL_NOVA_COMPUTE'
|
upgrade_level_nova_compute='UPGRADE_LEVEL_NOVA_COMPUTE'
|
||||||
params:
|
params:
|
||||||
UPGRADE_LEVEL_NOVA_COMPUTE: {get_param: UpgradeLevelNovaCompute}
|
UPGRADE_LEVEL_NOVA_COMPUTE: {get_param: UpgradeLevelNovaCompute}
|
||||||
|
- get_file: pacemaker_common_functions.sh
|
||||||
- get_file: major_upgrade_compute.sh
|
- get_file: major_upgrade_compute.sh
|
||||||
|
|
||||||
ObjectStorageDeliverUpgradeScriptConfig:
|
ObjectStorageDeliverUpgradeScriptConfig:
|
||||||
type: OS::Heat::SoftwareConfig
|
type: OS::Heat::SoftwareConfig
|
||||||
properties:
|
properties:
|
||||||
group: script
|
group: script
|
||||||
config: {get_file: major_upgrade_object_storage.sh}
|
config:
|
||||||
|
list_join:
|
||||||
|
- ''
|
||||||
|
- - get_file: pacemaker_common_functions.sh
|
||||||
|
- get_file: major_upgrade_object_storage.sh
|
||||||
|
|
||||||
CephStorageDeliverUpgradeScriptConfig:
|
CephStorageDeliverUpgradeScriptConfig:
|
||||||
type: OS::Heat::SoftwareConfig
|
type: OS::Heat::SoftwareConfig
|
||||||
properties:
|
properties:
|
||||||
group: script
|
group: script
|
||||||
config: {get_file: major_upgrade_ceph_storage.sh}
|
config:
|
||||||
|
list_join:
|
||||||
|
- ''
|
||||||
|
- - get_file: pacemaker_common_functions.sh
|
||||||
|
- get_file: major_upgrade_ceph_storage.sh
|
||||||
|
|
||||||
{% for role in roles %}
|
{% for role in roles %}
|
||||||
UpgradeInit{{role.name}}Deployment:
|
UpgradeInit{{role.name}}Deployment:
|
||||||
|
|
|
@ -297,3 +297,27 @@ function systemctl_swift {
|
||||||
manage_systemd_service $action $service
|
manage_systemd_service $action $service
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Special-case OVS for https://bugs.launchpad.net/tripleo/+bug/1635205
|
||||||
|
function special_case_ovs_upgrade_if_needed {
|
||||||
|
if [[ -n $(rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep "systemctl.*try-restart") ]]; then
|
||||||
|
echo "Manual upgrade of openvswitch - restart in postun detected"
|
||||||
|
rm -rf OVS_UPGRADE
|
||||||
|
mkdir OVS_UPGRADE && pushd OVS_UPGRADE
|
||||||
|
echo "Attempting to downloading latest openvswitch with yumdownloader"
|
||||||
|
yumdownloader --resolve openvswitch
|
||||||
|
for pkg in $(ls -1 *.rpm); do
|
||||||
|
if rpm -U --test $pkg 2>&1 | grep "already installed" ; then
|
||||||
|
echo "Looks like newer version of $pkg is already installed, skipping"
|
||||||
|
else
|
||||||
|
echo "Updating $pkg with nopostun option"
|
||||||
|
rpm -U --replacepkgs --nopostun $pkg
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
popd
|
||||||
|
else
|
||||||
|
echo "Skipping manual upgrade of openvswitch - no restart in postun detected"
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,18 +63,7 @@ if [[ "$pacemaker_status" == "active" && \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Special-case OVS for https://bugs.launchpad.net/tripleo/+bug/1635205
|
# Special-case OVS for https://bugs.launchpad.net/tripleo/+bug/1635205
|
||||||
if [[ -n $(rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep "systemctl.*try-restart") ]]; then
|
special_case_ovs_upgrade_if_needed
|
||||||
echo "Manual upgrade of openvswitch - restart in postun detected"
|
|
||||||
mkdir OVS_UPGRADE || true
|
|
||||||
pushd OVS_UPGRADE
|
|
||||||
echo "Attempting to downloading latest openvswitch with yumdownloader"
|
|
||||||
yumdownloader --resolve openvswitch
|
|
||||||
echo "Updating openvswitch with nopostun option"
|
|
||||||
rpm -U --replacepkgs --nopostun ./*.rpm
|
|
||||||
popd
|
|
||||||
else
|
|
||||||
echo "Skipping manual upgrade of openvswitch - no restart in postun detected"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$pacemaker_status" == "active" ]] ; then
|
if [[ "$pacemaker_status" == "active" ]] ; then
|
||||||
echo "Pacemaker running, stopping cluster node and doing full package update"
|
echo "Pacemaker running, stopping cluster node and doing full package update"
|
||||||
|
|
|
@ -9,7 +9,12 @@ resources:
|
||||||
type: OS::Heat::SoftwareConfig
|
type: OS::Heat::SoftwareConfig
|
||||||
properties:
|
properties:
|
||||||
group: script
|
group: script
|
||||||
config: {get_file: yum_update.sh}
|
config:
|
||||||
|
list_join:
|
||||||
|
- ''
|
||||||
|
- - get_file: pacemaker_common_functions.sh
|
||||||
|
- get_file: yum_update.sh
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
- name: update_identifier
|
- name: update_identifier
|
||||||
description: yum will only run for previously unused values of update_identifier
|
description: yum will only run for previously unused values of update_identifier
|
||||||
|
|
Loading…
Reference in New Issue