Remove the heat upgrade steps for Q upgrade workflow

This removes most of the Heat driver upgrade workflow, including
the script delivery and stepwise upgrade tasks with invocation
of ansible via heat

For Q upgrades the operator should use
    openstack overcloud upgrade --init-upgrade --container-registry-file file
    openstack overcloud upgrade --nodes Controller
etc.

Depends-On: I54f8fc57b758e34c620d607be15d2291d545ff6f
Change-Id: I75f087dc456c50327c3b4ad98a1f89a7e012dc68
This commit is contained in:
marios 2017-12-06 11:54:03 +02:00 committed by mandreou
parent 5ed2221959
commit 5cbe298f59
6 changed files with 5 additions and 323 deletions

View File

@ -1,252 +0,0 @@
{% set enabled_roles = roles|rejectattr('disable_upgrade_deployment')|list -%}
{% set batch_upgrade_steps_max = 3 -%}
{% set upgrade_steps_max = 6 -%}
{% set deliver_script = {'deliver': False} -%}
heat_template_version: queens
description: 'Upgrade steps for all roles'
parameters:
servers:
type: json
stack_name:
type: string
description: Name of the topmost stack
role_data:
type: json
description: Mapping of Role name e.g Controller to the per-role data
ctlplane_service_ips:
type: json
blacklisted_ip_addresses:
description: List of IP addresses belong to blacklisted servers
type: comma_delimited_list
default: []
blacklisted_hostnames:
description: List of hostnames belong to blacklisted servers
type: comma_delimited_list
default: []
UpdateIdentifier:
type: string
default: ''
description: >
Setting to a previously unused value during stack-update will trigger
the Upgrade resources to re-run on all roles.
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
KeystoneRegion:
type: string
default: 'regionOne'
description: Keystone region for endpoint
NovaPassword:
description: The password for the nova service and db account
type: string
hidden: true
resources:
{% for role in roles if role.disable_upgrade_deployment|default(false) %}
{{role.name}}DeliverUpgradeScriptConfig:
type: OS::Heat::SoftwareConfig
properties:
name: {{role.name}}DeliverUpgradeScriptConfig
group: script
config:
list_join:
- ''
- - "#!/bin/bash\n\n"
- "set -eu\n\n"
- str_replace:
template: |
ROLE='ROLE_NAME'
params:
ROLE_NAME: {{role.name}}
- get_file: ../extraconfig/tasks/pacemaker_common_functions.sh
- get_file: ../extraconfig/tasks/tripleo_upgrade_node.sh
{{role.name}}DeliverUpgradeScriptDeployment:
type: OS::Heat::SoftwareDeploymentGroup
properties:
name: {{role.name}}DeliverUpgradeScriptDeployment
servers: {get_param: [servers, {{role.name}}]}
config: {get_resource: {{role.name}}DeliverUpgradeScriptConfig}
{% endfor %}
# Upgrade Steps for all roles, batched updates
# The UpgradeConfig resources could actually be created without
# serialization, but the event output is easier to follow if we
# do, and there should be minimal performance hit (creating the
# config is cheap compared to the time to apply the deployment).
{% for step in range(0, batch_upgrade_steps_max) %}
# Batch config resources step {{step}}
{%- for role in roles %}
{{role.name}}UpgradeBatchConfig_Step{{step}}:
type: OS::TripleO::UpgradeConfig
{%- if step > 0 %}
depends_on:
{%- for role_inside in enabled_roles %}
- {{role_inside.name}}UpgradeBatch_Step{{step -1}}
{%- endfor %}
{% else %}
{% for role in roles if role.disable_upgrade_deployment|default(false) %}
{% if deliver_script.update({'deliver': True}) %} {% endif %}
{% endfor %}
{% if deliver_script.deliver %}
depends_on:
{% for dep in roles if dep.disable_upgrade_deployment|default(false) %}
- {{dep.name}}DeliverUpgradeScriptDeployment
{% endfor %}
{% endif %}
{% endif %}
properties:
UpgradeStepConfig: {get_param: [role_data, {{role.name}}, upgrade_batch_tasks]}
step: {{step}}
{%- endfor %}
# Batch deployment resources for step {{step}} (only for enabled roles)
{%- for role in enabled_roles %}
{{role.name}}UpgradeBatch_Step{{step}}:
type: OS::Heat::SoftwareDeploymentGroup
{%- if step > 0 %}
depends_on:
{%- for role_inside in enabled_roles %}
- {{role_inside.name}}UpgradeBatch_Step{{step -1}}
{%- endfor %}
{% else %}
{% for role in roles if role.disable_upgrade_deployment|default(false) %}
{% if deliver_script.update({'deliver': True}) %} {% endif %}
{% endfor %}
{% if deliver_script.deliver %}
depends_on:
{% for dep in roles if dep.disable_upgrade_deployment|default(false) %}
- {{dep.name}}DeliverUpgradeScriptDeployment
{% endfor %}
{% endif %}
{% endif %}
update_policy:
batch_create:
max_batch_size: {{role.upgrade_batch_size|default(1)}}
rolling_update:
max_batch_size: {{role.upgrade_batch_size|default(1)}}
properties:
name: {{role.name}}UpgradeBatch_Step{{step}}
servers: {get_param: [servers, {{role.name}}]}
config: {get_resource: {{role.name}}UpgradeBatchConfig_Step{{step}}}
input_values:
role: {{role.name}}
update_identifier: {get_param: UpdateIdentifier}
{%- endfor %}
{%- endfor %}
# Upgrade Steps for all roles
{%- for step in range(0, upgrade_steps_max) %}
# Config resources for step {{step}}
{%- for role in roles %}
{{role.name}}UpgradeConfig_Step{{step}}:
type: OS::TripleO::UpgradeConfig
# The UpgradeConfig resources could actually be created without
# serialization, but the event output is easier to follow if we
# do, and there should be minimal performance hit (creating the
# config is cheap compared to the time to apply the deployment).
depends_on:
{%- for role_inside in enabled_roles %}
{%- if step > 0 %}
- {{role_inside.name}}Upgrade_Step{{step -1}}
{%- else %}
- {{role_inside.name}}UpgradeBatch_Step{{batch_upgrade_steps_max -1}}
{%- endif %}
{%- endfor %}
properties:
UpgradeStepConfig: {get_param: [role_data, {{role.name}}, upgrade_tasks]}
step: {{step}}
{%- endfor %}
# Deployment resources for step {{step}} (only for enabled roles)
{%- for role in enabled_roles %}
{{role.name}}Upgrade_Step{{step}}:
type: OS::Heat::SoftwareDeploymentGroup
depends_on:
{%- for role_inside in enabled_roles %}
{%- if step > 0 %}
- {{role_inside.name}}Upgrade_Step{{step -1}}
{%- else %}
- {{role_inside.name}}UpgradeBatch_Step{{batch_upgrade_steps_max -1}}
{%- endif %}
{%- endfor %}
properties:
name: {{role.name}}Upgrade_Step{{step}}
servers: {get_param: [servers, {{role.name}}]}
config: {get_resource: {{role.name}}UpgradeConfig_Step{{step}}}
input_values:
role: {{role.name}}
update_identifier: {get_param: UpdateIdentifier}
{%- endfor %}
{%- endfor %}
# Post upgrade deployment steps for all roles
# This runs the normal configuration (e.g puppet) steps unless upgrade
# is disabled for the role
AllNodesPostUpgradeSteps:
type: OS::TripleO::PostUpgradeSteps
depends_on:
{%- for dep in enabled_roles %}
- {{dep.name}}Upgrade_Step{{upgrade_steps_max - 1}}
{%- endfor %}
properties:
servers: {get_param: servers}
stack_name: {get_param: stack_name}
role_data: {get_param: role_data}
ctlplane_service_ips: {get_param: ctlplane_service_ips}
{%- for step in range(0, upgrade_steps_max) %}
{%- for role in roles %}
{{role.name}}PostUpgradeConfig_Config{{step}}:
type: OS::TripleO::UpgradeConfig
depends_on:
{%- for role_inside in enabled_roles %}
{%- if step > 0 %}
- {{role_inside.name}}PostUpgradeConfig_Deployment{{step -1}}
{%- else %}
- AllNodesPostUpgradeSteps
{%- endif %}
{%- endfor %}
properties:
UpgradeStepConfig: {get_param: [role_data, {{role.name}}, post_upgrade_tasks]}
step: {{step}}
{%- endfor %}
{%- for role in enabled_roles %}
{{role.name}}PostUpgradeConfig_Deployment{{step}}:
type: OS::Heat::SoftwareDeploymentGroup
depends_on:
{%- for role_inside in enabled_roles %}
{%- if step > 0 %}
- {{role_inside.name}}PostUpgradeConfig_Deployment{{step -1}}
{%- else %}
- AllNodesPostUpgradeSteps
{%- endif %}
{%- endfor %}
properties:
name: {{role.name}}PostUpgradeConfig_Deployment{{step}}
servers: {get_param: [servers, {{role.name}}]}
config: {get_resource: {{role.name}}PostUpgradeConfig_Config{{step}}}
input_values:
role: {{role.name}}
update_identifier: {get_param: UpdateIdentifier}
{%- endfor %}
{%- endfor %}
outputs:
# Output the config for each role, just use Step1 as the config should be
# the same for all steps (only the tag provided differs)
upgrade_configs:
description: The per-role upgrade configuration used
value:
{% for role in roles %}
{{role.name.lower()}}: {get_attr: [{{role.name}}UpgradeConfig_Step1, upgrade_config]}
{% endfor %}
RoleConfig:
description: Mapping of config data for all roles
value: {get_attr: [AllNodesPostUpgradeSteps, RoleConfig]}

View File

@ -1,4 +0,0 @@
# Note the include here is the same as post.j2.yaml but the data used at
# # the time of rendering is different if any roles disable upgrades
{% set enabled_roles = roles|rejectattr('disable_upgrade_deployment')|list -%}
{% include 'deploy-steps.j2' %}

View File

@ -1,5 +1,7 @@
resource_registry:
OS::TripleO::PostDeploySteps: ../common/major_upgrade_steps.yaml
OS::TripleO::DeploymentSteps: OS::Heat::None
OS::TripleO::Tasks::*PreConfig: OS::Heat::None
OS::TripleO::Tasks::*PostConfig: OS::Heat::None
parameter_defaults:
EnableConfigPurge: false
StackUpdateType: UPGRADE
@ -7,8 +9,7 @@ parameter_defaults:
UpgradeInitCommonCommand: |
#!/bin/bash
set -eu
# Ocata to Pike, put any needed host-level workarounds here
# Pike to Queens, put any needed host-level workarounds here
yum update -y ansible
yum install -y ansible-pacemaker
MigrationSshPort: 22
UpgradeRemoveUnusedPackages: false

View File

@ -1,5 +1,4 @@
resource_registry:
OS::TripleO::PostDeploySteps: ../common/major_upgrade_steps.yaml
#DEPRECATED: This environment file was last used for upgrades to stable/pike.
parameter_defaults:
EnableConfigPurge: true
StackUpdateType: UPGRADE

View File

@ -2,7 +2,6 @@ resource_registry:
OS::TripleO::SoftwareDeployment: OS::Heat::StructuredDeployment
OS::TripleO::PostDeploySteps: common/post.yaml
OS::TripleO::PostUpgradeSteps: common/post-upgrade.yaml
OS::TripleO::AllNodes::SoftwareConfig: puppet/all-nodes-config.yaml
OS::TripleO::AllNodesDeployment: OS::Heat::StructuredDeployments
OS::TripleO::Hosts::SoftwareConfig: hosts-config.yaml
@ -103,9 +102,6 @@ resource_registry:
# validation resources
OS::TripleO::AllNodes::Validation: all-nodes-validation.yaml
# Upgrade resources
OS::TripleO::UpgradeConfig: puppet/upgrade_config.yaml
OS::TripleO::DeployedServerEnvironment: OS::Heat::None
OS::TripleO::DeploymentSteps: OS::Heat::StructuredDeploymentGroup

View File

@ -1,58 +0,0 @@
heat_template_version: queens
description: 'Upgrade for via ansible by applying a step related tag'
parameters:
UpgradeStepConfig:
type: json
description: Config (ansible yaml) that will be used to step through the deployment.
default: ''
step:
type: string
description: Step number of the upgrade
SkipUpgradeConfigTags:
type: comma_delimited_list
description: Ansible tags to skip during upgrade, e.g validation skips pre-upgrade validations
default: []
resources:
AnsibleConfig:
type: OS::Heat::Value
properties:
value:
str_replace:
template: CONFIG
params:
CONFIG:
- hosts: localhost
connection: local
tasks: {get_param: UpgradeStepConfig}
AnsibleUpgradeConfigImpl:
type: OS::Heat::SoftwareConfig
properties:
group: ansible
options:
skip_tags:
list_join:
- ","
- {get_param: SkipUpgradeConfigTags}
tags:
str_replace:
template: "common,stepSTEP"
params:
STEP: {get_param: step}
modulepath: /usr/share/ansible-modules
inputs:
- name: role
config: {get_attr: [AnsibleConfig, value]}
outputs:
OS::stack_id:
description: The software config which runs ansible with tags
value: {get_resource: AnsibleUpgradeConfigImpl}
upgrade_config:
description: The configuration file used for upgrade
value: {get_attr: [AnsibleConfig, value]}