aboutsummaryrefslogtreecommitdiffstats
path: root/extraconfig
diff options
context:
space:
mode:
Diffstat (limited to 'extraconfig')
-rw-r--r--extraconfig/all_nodes/mac_hostname.yaml6
-rw-r--r--extraconfig/all_nodes/random_string.yaml2
-rw-r--r--extraconfig/all_nodes/swap-partition.yaml90
-rw-r--r--extraconfig/all_nodes/swap.yaml108
-rw-r--r--extraconfig/post_deploy/example.yaml1
-rw-r--r--extraconfig/pre_deploy/rhel-registration/rhel-registration.yaml2
-rw-r--r--extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration41
-rw-r--r--extraconfig/pre_deploy/rhel-registration/scripts/rhel-unregistration2
-rw-r--r--extraconfig/tasks/major_upgrade_compute.sh26
-rwxr-xr-xextraconfig/tasks/major_upgrade_controller_pacemaker_1.sh55
-rwxr-xr-xextraconfig/tasks/major_upgrade_controller_pacemaker_2.sh67
-rw-r--r--extraconfig/tasks/major_upgrade_object_storage.sh38
-rw-r--r--extraconfig/tasks/major_upgrade_pacemaker.yaml71
-rw-r--r--extraconfig/tasks/major_upgrade_pacemaker_migrations.sh14
-rw-r--r--extraconfig/tasks/major_upgrade_script_delivery.yaml65
-rw-r--r--extraconfig/tasks/noop.yaml16
-rwxr-xr-xextraconfig/tasks/pacemaker_common_functions.sh48
-rwxr-xr-xextraconfig/tasks/pacemaker_resource_restart.sh35
-rw-r--r--extraconfig/tasks/post_puppet_pacemaker.yaml6
-rwxr-xr-xextraconfig/tasks/yum_update.sh22
-rw-r--r--extraconfig/tasks/yum_update_noop.yaml29
21 files changed, 692 insertions, 52 deletions
diff --git a/extraconfig/all_nodes/mac_hostname.yaml b/extraconfig/all_nodes/mac_hostname.yaml
index 739cbf0a..5883e06a 100644
--- a/extraconfig/all_nodes/mac_hostname.yaml
+++ b/extraconfig/all_nodes/mac_hostname.yaml
@@ -40,6 +40,7 @@ resources:
CollectMacDeploymentsController:
type: OS::Heat::SoftwareDeployments
properties:
+ name: CollectMacDeploymentsController
servers: {get_param: controller_servers}
config: {get_resource: CollectMacConfig}
actions: ['CREATE'] # Only do this on CREATE
@@ -47,6 +48,7 @@ resources:
CollectMacDeploymentsCompute:
type: OS::Heat::SoftwareDeployments
properties:
+ name: CollectMacDeploymentsCompute
servers: {get_param: compute_servers}
config: {get_resource: CollectMacConfig}
actions: ['CREATE'] # Only do this on CREATE
@@ -54,6 +56,7 @@ resources:
CollectMacDeploymentsBlockStorage:
type: OS::Heat::SoftwareDeployments
properties:
+ name: CollectMacDeploymentsBlockStorage
servers: {get_param: blockstorage_servers}
config: {get_resource: CollectMacConfig}
actions: ['CREATE'] # Only do this on CREATE
@@ -61,6 +64,7 @@ resources:
CollectMacDeploymentsObjectStorage:
type: OS::Heat::SoftwareDeployments
properties:
+ name: CollectMacDeploymentsObjectStorage
servers: {get_param: objectstorage_servers}
config: {get_resource: CollectMacConfig}
actions: ['CREATE'] # Only do this on CREATE
@@ -68,6 +72,7 @@ resources:
CollectMacDeploymentsCephStorage:
type: OS::Heat::SoftwareDeployments
properties:
+ name: CollectMacDeploymentsCephStorage
servers: {get_param: cephstorage_servers}
config: {get_resource: CollectMacConfig}
actions: ['CREATE'] # Only do this on CREATE
@@ -95,6 +100,7 @@ resources:
DistributeMacDeploymentsController:
type: OS::Heat::SoftwareDeployments
properties:
+ name: DistributeMacDeploymentsController
servers: {get_param: controller_servers}
config: {get_resource: DistributeMacConfig}
input_values:
diff --git a/extraconfig/all_nodes/random_string.yaml b/extraconfig/all_nodes/random_string.yaml
index b4b30274..49d2d8b6 100644
--- a/extraconfig/all_nodes/random_string.yaml
+++ b/extraconfig/all_nodes/random_string.yaml
@@ -41,6 +41,7 @@ resources:
RandomDeploymentsController:
type: OS::Heat::SoftwareDeployments
properties:
+ name: RandomDeploymentsController
servers: {get_param: controller_servers}
config: {get_resource: RandomConfig}
actions: ['CREATE'] # Only do this on CREATE
@@ -50,6 +51,7 @@ resources:
RandomDeploymentsCompute:
type: OS::Heat::SoftwareDeployments
properties:
+ name: RandomDeploymentsCompute
servers: {get_param: compute_servers}
config: {get_resource: RandomConfig}
actions: ['CREATE'] # Only do this on CREATE
diff --git a/extraconfig/all_nodes/swap-partition.yaml b/extraconfig/all_nodes/swap-partition.yaml
new file mode 100644
index 00000000..89a2adb0
--- /dev/null
+++ b/extraconfig/all_nodes/swap-partition.yaml
@@ -0,0 +1,90 @@
+heat_template_version: 2014-10-16
+
+description: >
+ Extra config to add swap space to nodes.
+
+# Parameters passed from the parent template - note if you maintain
+# out-of-tree templates they may require additional parameters if the
+# in-tree templates add a new role.
+parameters:
+ controller_servers:
+ type: json
+ compute_servers:
+ type: json
+ blockstorage_servers:
+ type: json
+ objectstorage_servers:
+ type: json
+ cephstorage_servers:
+ type: json
+ swap_partition_label:
+ type: string
+ description: Swap partition label
+ default: 'swap1'
+
+
+resources:
+
+ SwapConfig:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: script
+ config: |
+ #!/bin/bash
+ set -eux
+ swap_partition=$(realpath /dev/disk/by-label/$swap_partition_label)
+ swapon $swap_partition
+ echo "$swap_partition swap swap defaults 0 0" >> /etc/fstab
+ inputs:
+ - name: swap_partition_label
+ description: Swap partition label
+ default: 'swap1'
+
+ ControllerSwapDeployment:
+ type: OS::Heat::SoftwareDeploymentGroup
+ properties:
+ config: {get_resource: SwapConfig}
+ servers: {get_param: controller_servers}
+ input_values:
+ swap_partition_label: {get_param: swap_partition_label}
+ actions: ["CREATE"]
+
+ ComputeSwapDeployment:
+ type: OS::Heat::SoftwareDeploymentGroup
+ properties:
+ config: {get_resource: SwapConfig}
+ servers: {get_param: compute_servers}
+ input_values:
+ swap_partition_label: {get_param: swap_partition_label}
+ actions: ["CREATE"]
+
+ BlockStorageSwapDeployment:
+ type: OS::Heat::SoftwareDeploymentGroup
+ properties:
+ config: {get_resource: SwapConfig}
+ servers: {get_param: blockstorage_servers}
+ input_values:
+ swap_partition_label: {get_param: swap_partition_label}
+ actions: ["CREATE"]
+
+ ObjectStorageSwapDeployment:
+ type: OS::Heat::SoftwareDeploymentGroup
+ properties:
+ config: {get_resource: SwapConfig}
+ servers: {get_param: objectstorage_servers}
+ input_values:
+ swap_partition_label: {get_param: swap_partition_label}
+ actions: ["CREATE"]
+
+ CephStorageSwapDeployment:
+ type: OS::Heat::SoftwareDeploymentGroup
+ properties:
+ config: {get_resource: SwapConfig}
+ servers: {get_param: cephstorage_servers}
+ input_values:
+ swap_partition_label: {get_param: swap_partition_label}
+ actions: ["CREATE"]
+
+outputs:
+ config_identifier:
+ value: none
diff --git a/extraconfig/all_nodes/swap.yaml b/extraconfig/all_nodes/swap.yaml
new file mode 100644
index 00000000..374b1e5d
--- /dev/null
+++ b/extraconfig/all_nodes/swap.yaml
@@ -0,0 +1,108 @@
+heat_template_version: 2014-10-16
+
+description: >
+ Extra config to add swap space to nodes.
+
+# Parameters passed from the parent template - note if you maintain
+# out-of-tree templates they may require additional parameters if the
+# in-tree templates add a new role.
+parameters:
+ controller_servers:
+ type: json
+ compute_servers:
+ type: json
+ blockstorage_servers:
+ type: json
+ objectstorage_servers:
+ type: json
+ cephstorage_servers:
+ type: json
+ swap_size_megabytes:
+ type: string
+ description: Amount of swap space to allocate in megabytes
+ default: '4096'
+ swap_path:
+ type: string
+ description: Full path to location of swap file
+ default: '/swap'
+
+
+resources:
+
+ SwapConfig:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: script
+ config: |
+ #!/bin/bash
+ set -eux
+ if [ ! -f $swap_path ]; then
+ dd if=/dev/zero of=$swap_path count=$swap_size_megabytes bs=1M
+ chmod 0600 $swap_path
+ mkswap $swap_path
+ swapon $swap_path
+ else
+ echo "$swap_path already exists"
+ fi
+ echo "$swap_path swap swap defaults 0 0" >> /etc/fstab
+ inputs:
+ - name: swap_size_megabytes
+ description: Amount of swap space to allocate in megabytes
+ default: '4096'
+ - name: swap_path
+ description: Full path to location of swap file
+ default: '/swap'
+
+ ControllerSwapDeployment:
+ type: OS::Heat::SoftwareDeploymentGroup
+ properties:
+ config: {get_resource: SwapConfig}
+ servers: {get_param: controller_servers}
+ input_values:
+ swap_size_megabytes: {get_param: swap_size_megabytes}
+ swap_path: {get_param: swap_path}
+ actions: ["CREATE"]
+
+ ComputeSwapDeployment:
+ type: OS::Heat::SoftwareDeploymentGroup
+ properties:
+ config: {get_resource: SwapConfig}
+ servers: {get_param: compute_servers}
+ input_values:
+ swap_size_megabytes: {get_param: swap_size_megabytes}
+ swap_path: {get_param: swap_path}
+ actions: ["CREATE"]
+
+ BlockStorageSwapDeployment:
+ type: OS::Heat::SoftwareDeploymentGroup
+ properties:
+ config: {get_resource: SwapConfig}
+ servers: {get_param: blockstorage_servers}
+ input_values:
+ swap_size_megabytes: {get_param: swap_size_megabytes}
+ swap_path: {get_param: swap_path}
+ actions: ["CREATE"]
+
+ ObjectStorageSwapDeployment:
+ type: OS::Heat::SoftwareDeploymentGroup
+ properties:
+ config: {get_resource: SwapConfig}
+ servers: {get_param: objectstorage_servers}
+ input_values:
+ swap_size_megabytes: {get_param: swap_size_megabytes}
+ swap_path: {get_param: swap_path}
+ actions: ["CREATE"]
+
+ CephStorageSwapDeployment:
+ type: OS::Heat::SoftwareDeploymentGroup
+ properties:
+ config: {get_resource: SwapConfig}
+ servers: {get_param: cephstorage_servers}
+ input_values:
+ swap_size_megabytes: {get_param: swap_size_megabytes}
+ swap_path: {get_param: swap_path}
+ actions: ["CREATE"]
+
+outputs:
+ config_identifier:
+ value: none
diff --git a/extraconfig/post_deploy/example.yaml b/extraconfig/post_deploy/example.yaml
index 1d3dca25..f83dff76 100644
--- a/extraconfig/post_deploy/example.yaml
+++ b/extraconfig/post_deploy/example.yaml
@@ -22,6 +22,7 @@ resources:
ExtraDeployments:
type: OS::Heat::SoftwareDeployments
properties:
+ name: ExtraDeployments
servers: {get_param: servers}
config: {get_resource: ExtraConfig}
actions: ['CREATE'] # Only do this on CREATE
diff --git a/extraconfig/pre_deploy/rhel-registration/rhel-registration.yaml b/extraconfig/pre_deploy/rhel-registration/rhel-registration.yaml
index d5160915..a884bdae 100644
--- a/extraconfig/pre_deploy/rhel-registration/rhel-registration.yaml
+++ b/extraconfig/pre_deploy/rhel-registration/rhel-registration.yaml
@@ -73,6 +73,7 @@ resources:
RHELRegistrationDeployment:
type: OS::Heat::SoftwareDeployment
properties:
+ name: RHELRegistrationDeployment
server: {get_param: server}
config: {get_resource: RHELRegistration}
actions: ['CREATE'] # Only do this on CREATE
@@ -106,6 +107,7 @@ resources:
RHELUnregistrationDeployment:
type: OS::Heat::SoftwareDeployment
properties:
+ name: RHELUnregistrationDeployment
server: {get_param: server}
config: {get_resource: RHELUnregistration}
actions: ['DELETE'] # Only do this on DELETE
diff --git a/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration b/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration
index cbbd6a1d..76fa63b4 100644
--- a/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration
+++ b/extraconfig/pre_deploy/rhel-registration/scripts/rhel-registration
@@ -13,6 +13,7 @@ fi
opts=
attach_opts=
+sat5_opts=
repos="repos --enable rhel-7-server-rpms"
satellite_repo="rhel-7-server-rh-common-rpms"
if [ -n "${REG_AUTO_ATTACH:-}" ]; then
@@ -49,6 +50,7 @@ fi
if [ -n "${REG_FORCE:-}" ]; then
opts="$opts --force"
+ sat5_opts="$sat5_opts --force"
fi
if [ -n "${REG_SERVER_URL:-}" ]; then
@@ -57,6 +59,7 @@ fi
if [ -n "${REG_ACTIVATION_KEY:-}" ]; then
opts="$opts --activationkey=$REG_ACTIVATION_KEY"
+ sat5_opts="$sat5_opts --activationkey=$REG_ACTIVATION_KEY"
if [ -z "${REG_ORG:-}" ]; then
echo "WARNING: REG_ACTIVATION_KEY set without REG_ORG."
@@ -75,10 +78,12 @@ fi
if [ -n "${REG_MACHINE_NAME:-}" ]; then
opts="$opts --name $REG_MACHINE_NAME"
+ sat5_opts="$sat5_opts --profilename=$REG_MACHINE_NAME"
fi
if [ -n "${REG_ORG:-}" ]; then
opts="$opts --org=$REG_ORG"
+ sat5_opts="$sat5_opts --systemorgid=$REG_ORG"
fi
if [ -n "${REG_REPOS:-}" ]; then
@@ -91,6 +96,20 @@ if [ -n "${REG_TYPE:-}" ]; then
opts="$opts --type=$REG_TYPE"
fi
+function detect_satellite_version {
+ ping_api=$REG_SAT_URL/katello/api/ping
+ if curl -k -s -D - -o /dev/null $ping_api | grep "200 OK"; then
+ echo Satellite 6 detected at $REG_SAT_URL
+ satellite_version=6
+ elif curl -k -s -D - -o /dev/null $REG_SAT_URL/rhn/Login.do | grep "200 OK"; then
+ echo Satellite 5 detected at $REG_SAT_URL
+ satellite_version=5
+ else
+ echo No Satellite detected at $REG_SAT_URL
+ exit 1
+ fi
+}
+
case "${REG_METHOD:-}" in
portal)
subscription-manager register $opts
@@ -100,13 +119,21 @@ case "${REG_METHOD:-}" in
subscription-manager $repos
;;
satellite)
- repos="$repos --enable ${satellite_repo}"
- rpm -Uvh "$REG_SAT_URL/pub/katello-ca-consumer-latest.noarch.rpm" || true
- subscription-manager register $opts
- subscription-manager $repos
- yum install -y katello-agent || true # needed for errata reporting to satellite6
- katello-package-upload
- subscription-manager repos --disable ${satellite_repo}
+ detect_satellite_version
+ if [ "satellite_version" = "6" ]; then
+ repos="$repos --enable ${satellite_repo}"
+ rpm -Uvh "$REG_SAT_URL/pub/katello-ca-consumer-latest.noarch.rpm" || true
+ subscription-manager register $opts
+ subscription-manager $repos
+ yum install -y katello-agent || true # needed for errata reporting to satellite6
+ katello-package-upload
+ subscription-manager repos --disable ${satellite_repo}
+ else
+ pushd /usr/share/rhn/
+ curl -k -O $REG_SAT_URL/pub/RHN-ORG-TRUSTED-SSL-CERT
+ popd
+ rhnreg_ks --serverUrl=$REG_SAT_URL/XMLRPC $sat5_opts
+ fi
;;
disable)
echo "Disabling RHEL registration"
diff --git a/extraconfig/pre_deploy/rhel-registration/scripts/rhel-unregistration b/extraconfig/pre_deploy/rhel-registration/scripts/rhel-unregistration
index 1e72e0a6..916f97e3 100644
--- a/extraconfig/pre_deploy/rhel-registration/scripts/rhel-unregistration
+++ b/extraconfig/pre_deploy/rhel-registration/scripts/rhel-unregistration
@@ -7,6 +7,8 @@ case "${REG_METHOD:-}" in
portal|satellite)
# Allow unregistration to fail.
# We don't want to fail stack deletes if unregistration fails.
+ # Note that this will be a no-op on satellite 5, which doesn't support
+ # unregistering from the cli.
subscription-manager unregister || true
subscription-manager clean || true
;;
diff --git a/extraconfig/tasks/major_upgrade_compute.sh b/extraconfig/tasks/major_upgrade_compute.sh
new file mode 100644
index 00000000..78628c8c
--- /dev/null
+++ b/extraconfig/tasks/major_upgrade_compute.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+#
+# This delivers the compute upgrade script to be invoked as part of the tripleo
+# major upgrade workflow.
+#
+set -eu
+
+UPGRADE_SCRIPT=/root/tripleo_upgrade_node.sh
+
+cat > $UPGRADE_SCRIPT << ENDOFCAT
+### DO NOT MODIFY THIS FILE
+### This file is automatically delivered to the compute nodes as part of the
+### tripleo upgrades workflow
+
+# pin nova to kilo (messaging +-1) for the nova-compute service
+
+crudini --set /etc/nova/nova.conf upgrade_levels compute $upgrade_level_nova_compute
+
+yum -y install python-zaqarclient # needed for os-collect-config
+yum -y update
+
+ENDOFCAT
+
+# ensure the permissions are OK
+chmod 0755 $UPGRADE_SCRIPT
+
diff --git a/extraconfig/tasks/major_upgrade_controller_pacemaker_1.sh b/extraconfig/tasks/major_upgrade_controller_pacemaker_1.sh
new file mode 100755
index 00000000..bf2ee330
--- /dev/null
+++ b/extraconfig/tasks/major_upgrade_controller_pacemaker_1.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+set -eu
+
+cluster_sync_timeout=600
+
+if pcs status 2>&1 | grep -E '(cluster is not currently running)|(OFFLINE:)'; then
+ echo_error "ERROR: upgrade cannot start with some cluster nodes being offline"
+ exit 1
+fi
+
+if [ "$(hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid)" = "$(facter hostname)" ]; then
+ pcs resource disable httpd
+ check_resource httpd stopped 1800
+ if pcs status | grep openstack-keystone; then
+ pcs resource disable openstack-keystone
+ check_resource openstack-keystone stopped 1800
+ fi
+ pcs resource disable redis
+ check_resource redis stopped 600
+ pcs resource disable mongod
+ check_resource mongod stopped 600
+ pcs resource disable rabbitmq
+ check_resource rabbitmq stopped 600
+ pcs resource disable memcached
+ check_resource memcached stopped 600
+ pcs resource disable galera
+ check_resource galera stopped 600
+ pcs cluster stop --all
+fi
+
+# Swift isn't controled by pacemaker
+systemctl_swift stop
+
+tstart=$(date +%s)
+while systemctl is-active pacemaker; do
+ sleep 5
+ tnow=$(date +%s)
+ if (( tnow-tstart > cluster_sync_timeout )) ; then
+ echo_error "ERROR: cluster shutdown timed out"
+ exit 1
+ fi
+done
+
+yum -y install python-zaqarclient # needed for os-collect-config
+yum -y -q update
+
+# Pin messages sent to compute nodes to kilo, these will be upgraded later
+crudini --set /etc/nova/nova.conf upgrade_levels compute "$upgrade_level_nova_compute"
+# https://bugzilla.redhat.com/show_bug.cgi?id=1284047
+# Change-Id: Ib3f6c12ff5471e1f017f28b16b1e6496a4a4b435
+crudini --set /etc/ceilometer/ceilometer.conf DEFAULT rpc_backend rabbit
+# https://bugzilla.redhat.com/show_bug.cgi?id=1284058
+# Ifd1861e3df46fad0e44ff9b5cbd58711bbc87c97 Swift Ceilometer middleware no longer exists
+crudini --set /etc/swift/proxy-server.conf pipeline:main pipeline "catch_errors healthcheck cache ratelimit tempurl formpost authtoken keystone staticweb proxy-logging proxy-server"
diff --git a/extraconfig/tasks/major_upgrade_controller_pacemaker_2.sh b/extraconfig/tasks/major_upgrade_controller_pacemaker_2.sh
new file mode 100755
index 00000000..10bea573
--- /dev/null
+++ b/extraconfig/tasks/major_upgrade_controller_pacemaker_2.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+set -eu
+
+cluster_form_timeout=600
+cluster_settle_timeout=600
+galera_sync_timeout=600
+
+if [ "$(hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid)" = "$(facter hostname)" ]; then
+ pcs cluster start --all
+
+ tstart=$(date +%s)
+ while pcs status 2>&1 | grep -E '(cluster is not currently running)|(OFFLINE:)'; do
+ sleep 5
+ tnow=$(date +%s)
+ if (( tnow-tstart > cluster_form_timeout )) ; then
+ echo_error "ERROR: timed out forming the cluster"
+ exit 1
+ fi
+ done
+
+ if ! timeout -k 10 $cluster_settle_timeout crm_resource --wait; then
+ echo_error "ERROR: timed out waiting for cluster to finish transition"
+ exit 1
+ fi
+
+ pcs resource enable galera
+ check_resource galera started 600
+ pcs resource enable mongod
+ check_resource mongod started 600
+
+ tstart=$(date +%s)
+ while ! clustercheck; do
+ sleep 5
+ tnow=$(date +%s)
+ if (( tnow-tstart > galera_sync_timeout )) ; then
+ echo_error "ERROR galera sync timed out"
+ exit 1
+ fi
+ done
+
+ # Run all the db syncs
+ # TODO: check if this can be triggered in puppet and removed from here
+ ceilometer-dbsync --config-file=/etc/ceilometer/ceilometer.conf
+ cinder-manage db sync
+ glance-manage --config-file=/etc/glance/glance-registry.conf db_sync
+ heat-manage --config-file /etc/heat/heat.conf db_sync
+ keystone-manage db_sync
+ neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head
+ nova-manage db sync
+
+ pcs resource enable memcached
+ check_resource memcached started 600
+ pcs resource enable rabbitmq
+ check_resource rabbitmq started 600
+ pcs resource enable redis
+ check_resource redis started 600
+ if pcs status | grep openstack-keystone; then
+ pcs resource enable openstack-keystone
+ check_resource openstack-keystone started 1800
+ fi
+ pcs resource enable httpd
+ check_resource httpd started 1800
+fi
+
+# Swift isn't controled by heat
+systemctl_swift start
diff --git a/extraconfig/tasks/major_upgrade_object_storage.sh b/extraconfig/tasks/major_upgrade_object_storage.sh
new file mode 100644
index 00000000..0f6d091e
--- /dev/null
+++ b/extraconfig/tasks/major_upgrade_object_storage.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+#
+# This delivers the swift-storage upgrade script to be invoked as part of the tripleo
+# major upgrade workflow.
+#
+set -eu
+
+UPGRADE_SCRIPT=/root/tripleo_upgrade_node.sh
+
+cat > $UPGRADE_SCRIPT << ENDOFCAT
+### DO NOT MODIFY THIS FILE
+### This file is automatically delivered to the swift-storage nodes as part of the
+### tripleo upgrades workflow
+
+
+function systemctl_swift {
+ action=$1
+ for S in openstack-swift-account-auditor openstack-swift-account-reaper openstack-swift-account-replicator openstack-swift-account \
+ openstack-swift-container-auditor openstack-swift-container-replicator openstack-swift-container-updater openstack-swift-container \
+ openstack-swift-object-auditor openstack-swift-object-replicator openstack-swift-object-updater openstack-swift-object openstack-swift-proxy; do
+ systemctl $action $S
+ done
+}
+
+
+systemctl_swift stop
+
+yum -y update
+
+systemctl_swift start
+
+
+
+ENDOFCAT
+
+# ensure the permissions are OK
+chmod 0755 $UPGRADE_SCRIPT
+
diff --git a/extraconfig/tasks/major_upgrade_pacemaker.yaml b/extraconfig/tasks/major_upgrade_pacemaker.yaml
new file mode 100644
index 00000000..b867d107
--- /dev/null
+++ b/extraconfig/tasks/major_upgrade_pacemaker.yaml
@@ -0,0 +1,71 @@
+heat_template_version: 2014-10-16
+description: 'Upgrade for Pacemaker deployments'
+
+parameters:
+ controller_servers:
+ type: json
+ compute_servers:
+ type: json
+ blockstorage_servers:
+ type: json
+ objectstorage_servers:
+ type: json
+ cephstorage_servers:
+ type: json
+ input_values:
+ type: json
+ description: input values for the software deployments
+
+ UpgradeLevelNovaCompute:
+ type: string
+ description: Nova Compute upgrade level
+ default: ''
+
+resources:
+ # TODO(jistr): for Mitaka->Newton upgrades and further we can use
+ # map_merge with input_values instead of feeding params into scripts
+ # via str_replace on bash snippets
+
+ ControllerPacemakerUpgradeConfig_Step1:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: script
+ config:
+ list_join:
+ - ''
+ - - str_replace:
+ template: |
+ #!/bin/bash
+ upgrade_level_nova_compute='UPGRADE_LEVEL_NOVA_COMPUTE'
+ params:
+ UPGRADE_LEVEL_NOVA_COMPUTE: {get_param: UpgradeLevelNovaCompute}
+ - get_file: pacemaker_common_functions.sh
+ - get_file: major_upgrade_pacemaker_migrations.sh
+ - get_file: major_upgrade_controller_pacemaker_1.sh
+
+ ControllerPacemakerUpgradeDeployment_Step1:
+ type: OS::Heat::SoftwareDeploymentGroup
+ properties:
+ servers: {get_param: controller_servers}
+ config: {get_resource: ControllerPacemakerUpgradeConfig_Step1}
+ input_values: {get_param: input_values}
+
+ ControllerPacemakerUpgradeConfig_Step2:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: script
+ config:
+ list_join:
+ - ''
+ - - get_file: pacemaker_common_functions.sh
+ - get_file: major_upgrade_pacemaker_migrations.sh
+ - get_file: major_upgrade_controller_pacemaker_2.sh
+
+ ControllerPacemakerUpgradeDeployment_Step2:
+ type: OS::Heat::SoftwareDeploymentGroup
+ depends_on: ControllerPacemakerUpgradeDeployment_Step1
+ properties:
+ servers: {get_param: controller_servers}
+ config: {get_resource: ControllerPacemakerUpgradeConfig_Step2}
+ input_values: {get_param: input_values}
+
diff --git a/extraconfig/tasks/major_upgrade_pacemaker_migrations.sh b/extraconfig/tasks/major_upgrade_pacemaker_migrations.sh
new file mode 100644
index 00000000..7fd26945
--- /dev/null
+++ b/extraconfig/tasks/major_upgrade_pacemaker_migrations.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Special pieces of upgrade migration logic go into this
+# file. E.g. Pacemaker cluster transitions for existing deployments,
+# matching changes to overcloud_controller_pacemaker.pp (Puppet
+# handles deployment, this file handles migrations).
+#
+# This file shouldn't execute any action on its own, all logic should
+# be wrapped into bash functions. Upgrade scripts will source this
+# file and call the functions defined in this file where appropriate.
+#
+# The migration functions should be idempotent. If the migration has
+# been already applied, it should be possible to call the function
+# again without damaging the deployment or failing the upgrade.
diff --git a/extraconfig/tasks/major_upgrade_script_delivery.yaml b/extraconfig/tasks/major_upgrade_script_delivery.yaml
new file mode 100644
index 00000000..f7faa7fc
--- /dev/null
+++ b/extraconfig/tasks/major_upgrade_script_delivery.yaml
@@ -0,0 +1,65 @@
+heat_template_version: 2014-10-16
+description: 'Upgrade for Pacemaker deployments'
+
+parameters:
+
+ controller_servers:
+ type: json
+ compute_servers:
+ type: json
+ blockstorage_servers:
+ type: json
+ objectstorage_servers:
+ type: json
+ cephstorage_servers:
+ type: json
+ input_values:
+ type: json
+ description: input values for the software deployments
+
+ UpgradeLevelNovaCompute:
+ type: string
+ description: Nova Compute upgrade level
+ default: ''
+
+resources:
+ # TODO(jistr): for Mitaka->Newton upgrades and further we can use
+ # map_merge with input_values instead of feeding params into scripts
+ # via str_replace on bash snippets
+
+ ComputeDeliverUpgradeScriptConfig:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: script
+ config:
+ list_join:
+ - ''
+ - - str_replace:
+ template: |
+ #!/bin/bash
+ upgrade_level_nova_compute='UPGRADE_LEVEL_NOVA_COMPUTE'
+ params:
+ UPGRADE_LEVEL_NOVA_COMPUTE: {get_param: UpgradeLevelNovaCompute}
+ - get_file: major_upgrade_compute.sh
+
+ ComputeDeliverUpgradeScriptDeployment:
+ type: OS::Heat::SoftwareDeploymentGroup
+ properties:
+ servers: {get_param: compute_servers}
+ config: {get_resource: ComputeDeliverUpgradeScriptConfig}
+ input_values: {get_param: input_values}
+
+
+ ObjectStoreDeliverUpgradeScriptConfig:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: script
+ config: {get_file: major_upgrade_object_storage.sh}
+
+ ObjectStoreDeliverUpgradeScriptDeployment:
+ type: OS::Heat::SoftwareDeploymentGroup
+ properties:
+ servers: {get_param: objectstorage_servers}
+ config: {get_resource: ObjectStoreDeliverUpgradeScriptConfig}
+ input_values: {get_param: input_values}
+
diff --git a/extraconfig/tasks/noop.yaml b/extraconfig/tasks/noop.yaml
index 0cff7469..dbb863be 100644
--- a/extraconfig/tasks/noop.yaml
+++ b/extraconfig/tasks/noop.yaml
@@ -4,6 +4,22 @@ description: 'No-op task'
parameters:
servers:
type: json
+ default: []
+ controller_servers:
+ type: json
+ default: []
+ compute_servers:
+ type: json
+ default: []
+ blockstorage_servers:
+ type: json
+ default: []
+ objectstorage_servers:
+ type: json
+ default: []
+ cephstorage_servers:
+ type: json
+ default: []
input_values:
type: json
default: {}
diff --git a/extraconfig/tasks/pacemaker_common_functions.sh b/extraconfig/tasks/pacemaker_common_functions.sh
new file mode 100755
index 00000000..ee3216e4
--- /dev/null
+++ b/extraconfig/tasks/pacemaker_common_functions.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+set -eu
+
+function check_resource {
+
+ if [ "$#" -ne 3 ]; then
+ echo_error "ERROR: check_resource function expects 3 parameters, $# given"
+ exit 1
+ fi
+
+ service=$1
+ state=$2
+ timeout=$3
+
+ if [ "$state" = "stopped" ]; then
+ match_for_incomplete='Started'
+ else # started
+ match_for_incomplete='Stopped'
+ fi
+
+ if timeout -k 10 $timeout crm_resource --wait; then
+ node_states=$(pcs status --full | grep "$service" | grep -v Clone)
+ if echo "$node_states" | grep -q "$match_for_incomplete"; then
+ echo_error "ERROR: cluster finished transition but $service was not in $state state, exiting."
+ exit 1
+ else
+ echo "$service has $state"
+ fi
+ else
+ echo_error "ERROR: cluster remained unstable for more than $timeout seconds, exiting."
+ exit 1
+ fi
+
+}
+
+function echo_error {
+ echo "$@" | tee /dev/fd2
+}
+
+function systemctl_swift {
+ action=$1
+ for S in openstack-swift-account-auditor openstack-swift-account-reaper openstack-swift-account-replicator openstack-swift-account \
+ openstack-swift-container-auditor openstack-swift-container-replicator openstack-swift-container-updater openstack-swift-container \
+ openstack-swift-object-auditor openstack-swift-object-replicator openstack-swift-object-updater openstack-swift-object openstack-swift-proxy; do
+ systemctl $action $S
+ done
+}
diff --git a/extraconfig/tasks/pacemaker_resource_restart.sh b/extraconfig/tasks/pacemaker_resource_restart.sh
index 4e8b20fd..b2bdc55a 100755
--- a/extraconfig/tasks/pacemaker_resource_restart.sh
+++ b/extraconfig/tasks/pacemaker_resource_restart.sh
@@ -3,37 +3,6 @@
set -eux
pacemaker_status=$(systemctl is-active pacemaker)
-check_interval=3
-
-function check_resource {
-
- service=$1
- state=$2
- timeout=$3
- tstart=$(date +%s)
- tend=$(( $tstart + $timeout ))
-
- if [ "$state" = "stopped" ]; then
- match_for_incomplete='Started'
- else # started
- match_for_incomplete='Stopped'
- fi
-
- while (( $(date +%s) < $tend )); do
- node_states=$(pcs status --full | grep "$service" | grep -v Clone)
- if echo "$node_states" | grep -q "$match_for_incomplete"; then
- echo "$service not yet $state, sleeping $check_interval seconds."
- sleep $check_interval
- else
- echo "$service has $state"
- return
- fi
- done
-
- echo "$service never $state after $timeout seconds" | tee /dev/fd/2
- exit 1
-
-}
# Run if pacemaker is running, we're the bootstrap node,
# and we're updating the deployment (not creating).
@@ -50,7 +19,7 @@ if [ "$pacemaker_status" = "active" -a \
pcs resource disable httpd
check_resource httpd stopped 300
pcs resource disable openstack-keystone
- check_resource openstack-keystone stopped 1200
+ check_resource openstack-keystone stopped 1800
if pcs status | grep haproxy-clone; then
pcs resource restart haproxy-clone
@@ -62,7 +31,7 @@ if [ "$pacemaker_status" = "active" -a \
pcs resource restart galera-master
pcs resource enable openstack-keystone
- check_resource openstack-keystone started 300
+ check_resource openstack-keystone started 1800
pcs resource enable httpd
check_resource httpd started 800
diff --git a/extraconfig/tasks/post_puppet_pacemaker.yaml b/extraconfig/tasks/post_puppet_pacemaker.yaml
index 7de41d94..fbed9ce5 100644
--- a/extraconfig/tasks/post_puppet_pacemaker.yaml
+++ b/extraconfig/tasks/post_puppet_pacemaker.yaml
@@ -33,7 +33,11 @@ resources:
type: OS::Heat::SoftwareConfig
properties:
group: script
- config: {get_file: pacemaker_resource_restart.sh}
+ config:
+ list_join:
+ - ''
+ - - get_file: pacemaker_common_functions.sh
+ - get_file: pacemaker_resource_restart.sh
ControllerPostPuppetRestartDeployment:
type: OS::Heat::SoftwareDeployments
diff --git a/extraconfig/tasks/yum_update.sh b/extraconfig/tasks/yum_update.sh
index 2d6b8cc2..59e4be45 100755
--- a/extraconfig/tasks/yum_update.sh
+++ b/extraconfig/tasks/yum_update.sh
@@ -123,10 +123,13 @@ openstack-nova-scheduler"
echo "Setting resource start/stop timeouts"
for service in $SERVICES; do
- pcs -f $pacemaker_dumpfile resource update $service op start timeout=100s op stop timeout=100s
+ pcs -f $pacemaker_dumpfile resource update $service op start timeout=200s op stop timeout=200s
done
# mongod start timeout is higher, setting only stop timeout
- pcs -f $pacemaker_dumpfile resource update mongod op stop timeout=100s
+ pcs -f $pacemaker_dumpfile resource update mongod op start timeout=370s op stop timeout=200s
+
+ echo "Making sure rabbitmq has the notify=true meta parameter"
+ pcs -f $pacemaker_dumpfile resource update rabbitmq meta notify=true
echo "Applying new Pacemaker config"
if ! pcs cluster cib-push $pacemaker_dumpfile; then
@@ -150,15 +153,15 @@ openstack-nova-scheduler"
kill $(ps ax | grep -e "keepalived.*\.pid-vrrp" | awk '{print $1}') 2>/dev/null || :
kill $(ps ax | grep -e "radvd.*\.pid\.radvd" | awk '{print $1}') 2>/dev/null || :
else
- echo "Excluding upgrading packages that are handled by config management tooling"
- command_arguments="$command_arguments --skip-broken"
- for exclude in $(cat /var/lib/tripleo/installed-packages/* | sort -u); do
- command_arguments="$command_arguments --exclude $exclude"
- done
+ echo "Upgrading openstack-puppet-modules"
+ yum -q -y update openstack-puppet-modules
+ echo "Upgrading other packages is handled by config management tooling"
+ echo -n "true" > $heat_outputs_path.update_managed_packages
+ exit 0
fi
command=${command:-update}
-full_command="yum -y $command $command_arguments"
+full_command="yum -q -y $command $command_arguments"
echo "Running: $full_command"
result=$($full_command)
@@ -199,9 +202,6 @@ if [[ "$pacemaker_status" == "active" ]] ; then
fi
pcs status
-
-else
- echo -n "true" > $heat_outputs_path.update_managed_packages
fi
echo "Finished yum_update.sh on server $deploy_server_id at `date`"
diff --git a/extraconfig/tasks/yum_update_noop.yaml b/extraconfig/tasks/yum_update_noop.yaml
new file mode 100644
index 00000000..b759d9c5
--- /dev/null
+++ b/extraconfig/tasks/yum_update_noop.yaml
@@ -0,0 +1,29 @@
+heat_template_version: 2014-10-16
+description: 'No-op yum update task'
+
+resources:
+
+ config:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: script
+ config: |
+ #!/bin/bash
+ echo -n "false" > $heat_outputs_path.update_managed_packages
+ inputs:
+ - name: update_identifier
+ description: yum will only run for previously unused values of update_identifier
+ default: ''
+ - name: command
+ description: yum sub-command to run, defaults to "update"
+ default: update
+ - name: command_arguments
+ description: yum command arguments, defaults to ""
+ default: ''
+ outputs:
+ - name: update_managed_packages
+ description: boolean value indicating whether to upgrade managed packages
+
+outputs:
+ OS::stack_id:
+ value: {get_resource: config}