Fix for AllNodesExtraConfig and fix environment files to create swap files/partitions
This submission:
- Fix an error in the AllNodesExtraConfig resource.
(Can't merge servers multiple times).
- Add environment files to deploy swap file/partition
without manual edit over the templates.
- If a swap partition is mounted without having it available
the deployment will fail, the fix checks that if the
partition is not created then the deployment continues.
- Removing empty extra lines in swap templates.
- Adjust description and remove unnecessary comments in
swap templates.
Closes-Bug: 1652184
Change-Id: I828bbbbd4c178956aac74af49f80fcd4f62fa16b
(cherry picked from commit 92e203aab6
)
This commit is contained in:
parent
c705c5fa9b
commit
a8d5ec2629
3
environments/enable-swap-partition.yaml
Normal file
3
environments/enable-swap-partition.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Use this environment to create a swap partition in all Overcloud nodes
|
||||||
|
resource_registry:
|
||||||
|
OS::TripleO::AllNodesExtraConfig: ../extraconfig/all_nodes/swap-partition.yaml
|
3
environments/enable-swap.yaml
Normal file
3
environments/enable-swap.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Use this environment to create a swap file in all Overcloud nodes
|
||||||
|
resource_registry:
|
||||||
|
OS::TripleO::AllNodesExtraConfig: ../extraconfig/all_nodes/swap.yaml
|
@ -1,11 +1,7 @@
|
|||||||
heat_template_version: 2014-10-16
|
heat_template_version: 2014-10-16
|
||||||
|
|
||||||
description: >
|
description: Template file to add a swap partition to a node.
|
||||||
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:
|
parameters:
|
||||||
servers:
|
servers:
|
||||||
type: json
|
type: json
|
||||||
@ -14,9 +10,7 @@ parameters:
|
|||||||
description: Swap partition label
|
description: Swap partition label
|
||||||
default: 'swap1'
|
default: 'swap1'
|
||||||
|
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
|
|
||||||
SwapConfig:
|
SwapConfig:
|
||||||
type: OS::Heat::SoftwareConfig
|
type: OS::Heat::SoftwareConfig
|
||||||
properties:
|
properties:
|
||||||
@ -25,8 +19,13 @@ resources:
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eux
|
set -eux
|
||||||
swap_partition=$(realpath /dev/disk/by-label/$swap_partition_label)
|
swap_partition=$(realpath /dev/disk/by-label/$swap_partition_label)
|
||||||
swapon $swap_partition
|
if [ -f "$swap_partition" ]; then
|
||||||
echo "$swap_partition swap swap defaults 0 0" >> /etc/fstab
|
swapon $swap_partition
|
||||||
|
echo "$swap_partition swap swap defaults 0 0" >> /etc/fstab
|
||||||
|
else
|
||||||
|
echo "$swap_partition needs to be a valid path"
|
||||||
|
echo "Check that $swap_partition_label is a valid partition label"
|
||||||
|
fi
|
||||||
inputs:
|
inputs:
|
||||||
- name: swap_partition_label
|
- name: swap_partition_label
|
||||||
description: Swap partition label
|
description: Swap partition label
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
heat_template_version: 2014-10-16
|
heat_template_version: 2014-10-16
|
||||||
|
|
||||||
description: >
|
description: Template file to add a swap file to a node.
|
||||||
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:
|
parameters:
|
||||||
servers:
|
servers:
|
||||||
type: json
|
type: json
|
||||||
@ -18,9 +14,7 @@ parameters:
|
|||||||
description: Full path to location of swap file
|
description: Full path to location of swap file
|
||||||
default: '/swap'
|
default: '/swap'
|
||||||
|
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
|
|
||||||
SwapConfig:
|
SwapConfig:
|
||||||
type: OS::Heat::SoftwareConfig
|
type: OS::Heat::SoftwareConfig
|
||||||
properties:
|
properties:
|
||||||
|
@ -535,8 +535,9 @@ resources:
|
|||||||
- {{role.name}}AllNodesValidationDeployment
|
- {{role.name}}AllNodesValidationDeployment
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
properties:
|
properties:
|
||||||
|
servers:
|
||||||
{% for role in roles %}
|
{% for role in roles %}
|
||||||
servers: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
|
{{role.name}}: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
# Post deployment steps for all roles
|
# Post deployment steps for all roles
|
||||||
|
Loading…
Reference in New Issue
Block a user