From 64eb5a1944332301900df1dc4fc2d226336d1bca Mon Sep 17 00:00:00 2001 From: James Slagle Date: Sun, 8 Jan 2017 11:07:13 -0500 Subject: [PATCH] Add UpgradeInitCommand to deployed-server The commands specified by UpgradeInitCommand need to be run before InstanceIdDeployment in deployed-server.yaml, otherwise the upgrades hang with the resource in progress. This is because the new python-heat-agent-apply-config has not yet been installed on the deployed server. Adding the UpgradeInitCommand (and corresponding SoftwareConfig/SoftwareDeployment to apply it) will cause the new repos and python-heat-agent-* rpm's to be installed before InstanceIdDeployment. An open question is whether or not Heat should even be triggering the InstanceIdDepoyment to IN_PROGRESS on upgrade when only the group is changing from os-apply-config to apply-config. If that turns out to be a Heat bug, then this patch wouldn't be necessary. Change-Id: I9d87f995744415b110a7d0bca8d2309d7167148c --- deployed-server/deployed-server.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/deployed-server/deployed-server.yaml b/deployed-server/deployed-server.yaml index 2929c5eb..3ff63613 100644 --- a/deployed-server/deployed-server.yaml +++ b/deployed-server/deployed-server.yaml @@ -38,6 +38,12 @@ parameters: type: json description: Optional scheduler hints to pass to nova default: {} + UpgradeInitCommand: + type: string + description: | + Command or script snippet to run on all overcloud nodes to + initialize the upgrade process. E.g. a repository switch. + default: '' resources: deployed-server: @@ -46,6 +52,25 @@ resources: name: {get_param: name} software_config_transport: {get_param: software_config_transport} + UpgradeInitConfig: + type: OS::Heat::SoftwareConfig + properties: + group: script + config: + list_join: + - '' + - - "#!/bin/bash\n\n" + - "if [[ -f /etc/resolv.conf.save ]] ; then rm /etc/resolv.conf.save; fi\n\n" + - get_param: UpgradeInitCommand + + UpgradeInitDeployment: + type: OS::Heat::SoftwareDeployment + properties: + name: UpgradeInitDeployment + server: {get_resource: deployed-server} + config: {get_resource: UpgradeInitConfig} + + InstanceIdConfig: type: OS::Heat::StructuredConfig properties: @@ -58,6 +83,7 @@ resources: properties: config: {get_resource: InstanceIdConfig} server: {get_resource: deployed-server} + depends_on: UpgradeInitDeployment HostsEntryConfig: type: OS::Heat::SoftwareConfig -- 2.16.6