From b4ff60f0a8dc1e602a0e2f7a20c1d91ef0b2f07e Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 1 Apr 2020 12:35:05 -0400 Subject: [PATCH] Exclude /var/lib/ironic/* from container-puppet.sh rsync Exclude /var/lib/ironic/* from container-puppet.sh rsync, this is a leftover from the initial containerization of TripleO; now we have host prep tasks, the ironic conductor and inspector bind mount /var/lib/ironic and generate the data that they need. But this data should not be in the config volume or it can conflict from each other when rsync runs at the same time. TripleO upgrade tasks and host prep tasks will take care of removing the var directory from the config volumes and the containers will just use the bind mount, like it should be doing now. These tasks will run during a minor update, major upgrade, and fast forward upgrade. Note: this will have to be backported to stable/train, and cleaned up later after Ussuri as the tasks won't be needed anymore. Root cause patches: - I3a195466a5039e7641e843c11e5436440bfc5a01 - Ibcff99f03e6751fbf3197adefd5d344178b71fc2 Related-Bug: #1868934 Co-Authored-By: Alex Schultz Change-Id: I69a1d1059bdfc0b99cf6a4a3dc78a1eb9a43ad0b --- common/container-puppet.sh | 2 +- .../ironic/ironic-conductor-container-puppet.yaml | 14 ++++++++++++++ .../ironic/ironic-inspector-container-puppet.yaml | 14 ++++++++++++++ ...onic_cleanup_config_data-1d4ae909c0869a90.yaml | 15 +++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/ironic_cleanup_config_data-1d4ae909c0869a90.yaml diff --git a/common/container-puppet.sh b/common/container-puppet.sh index 9b0ff468b8..4ea088be49 100644 --- a/common/container-puppet.sh +++ b/common/container-puppet.sh @@ -72,7 +72,7 @@ verbosity="" # Disables archiving if [ -z "$NO_ARCHIVE" ]; then - archivedirs=("/etc" "/root" "/opt" "/var/lib/ironic/tftpboot" "/var/lib/ironic/httpboot" "/var/www" "/var/spool/cron" "/var/lib/nova/.ssh") + archivedirs=("/etc" "/root" "/opt" "/var/www" "/var/spool/cron" "/var/lib/nova/.ssh") rsync_srcs="" for d in "${archivedirs[@]}"; do if [ -d "$d" ]; then diff --git a/deployment/ironic/ironic-conductor-container-puppet.yaml b/deployment/ironic/ironic-conductor-container-puppet.yaml index 502eec90bb..864d2a61a8 100644 --- a/deployment/ironic/ironic-conductor-container-puppet.yaml +++ b/deployment/ironic/ironic-conductor-container-puppet.yaml @@ -584,6 +584,20 @@ outputs: with_items: - httpboot - tftpboot + # TODO(emilien): remove the cleanup tasks after Ussuri + # https://bugs.launchpad.net/tripleo/+bug/1868934 + - name: Cleanup unnecessary container config-data + block: &ironic_config_data_cleanup + - name: Remove /var/lib/config-data/puppet-generated/ironic/var + file: + path: /var/lib/config-data/puppet-generated/ironic/var + state: absent + upgrade_tasks: + - name: Cleanup unnecessary container config-data + when: + - step|int == 0 + tags: common + block: *ironic_config_data_cleanup fast_forward_upgrade_tasks: - when: - step|int == 0 diff --git a/deployment/ironic/ironic-inspector-container-puppet.yaml b/deployment/ironic/ironic-inspector-container-puppet.yaml index c5b0d84427..0eeedec808 100644 --- a/deployment/ironic/ironic-inspector-container-puppet.yaml +++ b/deployment/ironic/ironic-inspector-container-puppet.yaml @@ -497,3 +497,17 @@ outputs: path: /var/lib/ironic-inspector/dhcp-hostsdir state: directory setype: container_file_t + # TODO(emilien): remove the cleanup tasks after Ussuri + # https://bugs.launchpad.net/tripleo/+bug/1868934 + - name: Cleanup unnecessary container config-data + block: &ironic_config_data_cleanup + - name: Remove /var/lib/config-data/puppet-generated/ironic_inspector/var + file: + path: /var/lib/config-data/puppet-generated/ironic_inspector/var + state: absent + upgrade_tasks: + - name: Cleanup unnecessary container config-data + when: + - step|int == 0 + tags: common + block: *ironic_config_data_cleanup diff --git a/releasenotes/notes/ironic_cleanup_config_data-1d4ae909c0869a90.yaml b/releasenotes/notes/ironic_cleanup_config_data-1d4ae909c0869a90.yaml new file mode 100644 index 0000000000..8433cf2d5d --- /dev/null +++ b/releasenotes/notes/ironic_cleanup_config_data-1d4ae909c0869a90.yaml @@ -0,0 +1,15 @@ +--- +upgrade: + - | + Exclude /var/lib/ironic/* from container-puppet.sh rsync, this is a + leftover from the initial containerization of TripleO; now we have + host prep tasks, the ironic conductor and inspector bind mount + /var/lib/ironic and generate the data that they need. But this data should + not be in the config volume or it can conflict from each other when rsync + runs at the same time. Check `launchpad bug 1868934 + `_. + TripleO upgrade tasks and host prep tasks will take care of removing + the var directory from the config volumes and the containers will just use + the bind mount, like it should be doing now. + These tasks will run during a minor update, major upgrade, and fast + forward upgrade.