Config & deployments to update overcloud packages

This change adds config and deployment resources to trigger package
updates on nodes. The deployments are triggered by doing a stack-update
and setting one of the parameters to a unique value.

The intent is that rolling update will be controlled by setting
breakpoints on all of the UpdateDeployment resources inside the
role resource groups.

Change-Id: I56bbf944ecd6cbdbf116021b8a53f9f9111c134f
This commit is contained in:
Steve Baker 2015-05-05 11:25:40 +12:00 committed by Jan Provaznik
parent b00bae6c5a
commit fa477ef380
15 changed files with 203 additions and 0 deletions

View File

@ -33,6 +33,12 @@ parameters:
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry.
type: json
UpdateIdentifier:
default: ''
type: string
description: >
Setting to a previously unused value during stack-update will trigger
package update on all nodes
resources:
CephStorage:

View File

@ -100,6 +100,13 @@ parameters:
description: The user password for SNMPd with readonly rights running on all Overcloud nodes
type: string
hidden: true
UpdateIdentifier:
default: ''
type: string
description: >
Setting to a previously unused value during stack-update will trigger
package update on all nodes
resources:
BlockStorage:
type: OS::Nova::Server

View File

@ -248,6 +248,12 @@ parameters:
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry.
type: json
UpdateIdentifier:
default: ''
type: string
description: >
Setting to a previously unused value during stack-update will trigger
package update on all nodes
resources:

View File

@ -438,6 +438,12 @@ parameters:
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry.
type: json
UpdateIdentifier:
default: ''
type: string
description: >
Setting to a previously unused value during stack-update will trigger
package update on all nodes
resources:

41
extraconfig/tasks/yum_update.sh Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
# A heat-config-script which runs yum update during a stack-update.
# Inputs:
# deploy_action - yum will only be run if this is UPDATE
# update_identifier - yum will only run for previously unused values of update_identifier
# command - yum sub-command to run, defaults to "update"
# command_arguments - yum command arguments, defaults to ""
echo "Started yum_update.sh on server $deploy_server_id at `date`"
if [[ -z "$update_identifier" ]]; then
echo "Not running due to unset update_identifier"
exit 0
fi
timestamp_dir=/var/lib/overcloud-yum-update
mkdir -p $timestamp_dir
# sanitise to remove unusual characters
update_identifier=${update_identifier//[^a-zA-Z0-9-_]/}
timestamp_file="$timestamp_dir/$update_identifier"
if [[ -a "$timestamp_file" ]]; then
echo "Not running for already-run timestamp \"$update_identifier\""
exit 0
fi
touch "$timestamp_file"
command=${command:-update}
full_command="yum -y $command $command_arguments"
echo "Running: $full_command"
result=$($full_command)
return_code=$?
echo "$result"
echo "yum return code: $return_code"
echo "Finished yum_update.sh on server $deploy_server_id at `date`"
exit $return_code

View File

@ -0,0 +1,26 @@
heat_template_version: 2014-10-16
description: >
Software-config for performing package updates using yum
resources:
config:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: {get_file: yum_update.sh}
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:
OS::stack_id:
value: {get_resource: config}

View File

@ -23,6 +23,7 @@ resource_registry:
OS::TripleO::BootstrapNode::SoftwareConfig: puppet/bootstrap-config.yaml
OS::TripleO::NodeUserData: firstboot/userdata_default.yaml
OS::TripleO::NodeExtraConfigPost: extraconfig/post_deploy/default.yaml
OS::TripleO::Tasks::PackageUpdate: extraconfig/tasks/yum_update.yaml
# TripleO overcloud networks
OS::TripleO::Network: network/networks.yaml

View File

@ -21,6 +21,7 @@ resource_registry:
OS::TripleO::BootstrapNode::SoftwareConfig: bootstrap-config.yaml
OS::TripleO::NodeUserData: firstboot/userdata_default.yaml
OS::TripleO::NodeExtraConfigPost: extraconfig/post_deploy/default.yaml
OS::TripleO::Tasks::PackageUpdate: extraconfig/tasks/yum_update.yaml
# TripleO overcloud networks
OS::TripleO::Network: network/networks.yaml

View File

@ -562,6 +562,14 @@ parameters:
constraints:
- custom_constraint: nova.flavor
# Identifiers to trigger tasks on nodes
UpdateIdentifier:
default: ''
type: string
description: >
Setting to a previously unused value during stack-update will trigger
package update on all nodes
resources:
HeatAuthEncryptionKey:
@ -672,6 +680,7 @@ resources:
MysqlVirtualIP: {get_attr: [VipMap, net_ip_map, {get_param: [ServiceNetMap, MysqlNetwork]}]}
KeystonePublicApiVirtualIP: {get_attr: [VipMap, net_ip_map, {get_param: [ServiceNetMap, KeystonePublicApiNetwork]}]}
NeutronApiVirtualIP: {get_attr: [VipMap, net_ip_map, {get_param: [ServiceNetMap, NeutronApiNetwork]}]}
UpdateIdentifier: {get_param: UpdateIdentifier}
Compute:
type: OS::Heat::ResourceGroup
@ -729,6 +738,7 @@ resources:
SnmpdReadonlyUserName: {get_param: SnmpdReadonlyUserName}
SnmpdReadonlyUserPassword: {get_param: SnmpdReadonlyUserPassword}
ServiceNetMap: {get_param: ServiceNetMap}
UpdateIdentifier: {get_param: UpdateIdentifier}
BlockStorage:
type: OS::Heat::ResourceGroup
@ -753,6 +763,7 @@ resources:
RabbitClientUseSSL: {get_param: RabbitClientUseSSL}
RabbitClientPort: {get_param: RabbitClientPort}
NtpServer: {get_param: NtpServer}
UpdateIdentifier: {get_param: UpdateIdentifier}
ObjectStorage:
type: OS::Heat::ResourceGroup
@ -771,6 +782,7 @@ resources:
Image: {get_param: SwiftStorageImage}
Replicas: { get_param: SwiftReplicas}
NtpServer: {get_param: NtpServer}
UpdateIdentifier: {get_param: UpdateIdentifier}
CephStorage:
type: OS::Heat::ResourceGroup
@ -785,6 +797,7 @@ resources:
Flavor: {get_param: OvercloudCephStorageFlavor}
NtpServer: {get_param: NtpServer}
ServiceNetMap: {get_param: ServiceNetMap}
UpdateIdentifier: {get_param: UpdateIdentifier}
ControllerIpListMap:
type: OS::TripleO::Network::Ports::NetIpListMap

View File

@ -33,6 +33,12 @@ parameters:
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry.
type: json
UpdateIdentifier:
default: ''
type: string
description: >
Setting to a previously unused value during stack-update will trigger
package update on all nodes
resources:
CephStorage:
@ -116,6 +122,18 @@ resources:
ceph::profile::params::cluster_network: {get_input: ceph_cluster_network}
ceph::profile::params::public_network: {get_input: ceph_public_network}
UpdateConfig:
type: OS::TripleO::Tasks::PackageUpdate
UpdateDeployment:
type: OS::Heat::SoftwareDeployment
properties:
config: {get_resource: UpdateConfig}
server: {get_resource: CephStorage}
input_values:
update_identifier:
get_param: UpdateIdentifier
outputs:
hosts_entry:
value:

View File

@ -111,6 +111,12 @@ parameters:
default: 'false'
description: Set to true to enable package installation via Puppet
type: boolean
UpdateIdentifier:
default: ''
type: string
description: >
Setting to a previously unused value during stack-update will trigger
package update on all nodes
resources:
BlockStorage:
@ -221,6 +227,18 @@ resources:
snmpd_readonly_user_name: {get_input: snmpd_readonly_user_name}
snmpd_readonly_user_password: {get_input: snmpd_readonly_user_password}
UpdateConfig:
type: OS::TripleO::Tasks::PackageUpdate
UpdateDeployment:
type: OS::Heat::SoftwareDeployment
properties:
config: {get_resource: UpdateConfig}
server: {get_resource: BlockStorage}
input_values:
update_identifier:
get_param: UpdateIdentifier
outputs:
hosts_entry:
value:

View File

@ -252,6 +252,12 @@ parameters:
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry.
type: json
UpdateIdentifier:
default: ''
type: string
description: >
Setting to a previously unused value during stack-update will trigger
package update on all nodes
resources:
@ -466,6 +472,18 @@ resources:
server: {get_param: NtpServer}
enable_package_install: {get_param: EnablePackageInstall}
UpdateConfig:
type: OS::TripleO::Tasks::PackageUpdate
UpdateDeployment:
type: OS::Heat::SoftwareDeployment
properties:
config: {get_resource: UpdateConfig}
server: {get_resource: NovaCompute}
input_values:
update_identifier:
get_param: UpdateIdentifier
outputs:
ip_address:
description: IP address of the server in the ctlplane network

View File

@ -446,6 +446,12 @@ parameters:
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry.
type: json
UpdateIdentifier:
default: ''
type: string
description: >
Setting to a previously unused value during stack-update will trigger
package update on all nodes
resources:
@ -976,6 +982,18 @@ resources:
tripleo::loadbalancer::public_virtual_interface: {get_input: public_virtual_interface}
enable_package_install: {get_input: enable_package_install}
UpdateConfig:
type: OS::TripleO::Tasks::PackageUpdate
UpdateDeployment:
type: OS::Heat::SoftwareDeployment
properties:
config: {get_resource: UpdateConfig}
server: {get_resource: Controller}
input_values:
update_identifier:
get_param: UpdateIdentifier
outputs:
ip_address:
description: IP address of the server in the ctlplane network

View File

@ -51,6 +51,12 @@ parameters:
default: 'false'
description: Set to true to enable package installation via Puppet
type: boolean
UpdateIdentifier:
default: ''
type: string
description: >
Setting to a previously unused value during stack-update will trigger
package update on all nodes
resources:
@ -151,6 +157,18 @@ resources:
server: {get_param: NtpServer}
enable_package_install: {get_param: EnablePackageInstall}
UpdateConfig:
type: OS::TripleO::Tasks::PackageUpdate
UpdateDeployment:
type: OS::Heat::SoftwareDeployment
properties:
config: {get_resource: UpdateConfig}
server: {get_resource: SwiftStorage}
input_values:
update_identifier:
get_param: UpdateIdentifier
outputs:
hosts_entry:
value:

View File

@ -82,6 +82,12 @@ parameters:
description: The user password for SNMPd with readonly rights running on all Overcloud nodes
type: string
hidden: true
UpdateIdentifier:
default: ''
type: string
description: >
Setting to a previously unused value during stack-update will trigger
package update on all nodes
resources:
SwiftConfig: