Skip podman purge on Undercloud

With the undercloud using ephemeral Heat, there will be images for
ephemeral Heat in the local container storage that do not have any
associated containers. Podman purge would delete these images, and they
then wouldn't be available for overcloud commands.

Instead, skip running the podman purge tasks on the Undercloud. This
means that the local container image storage will grow over time. Given
the reduced number of services on the undercloud, the storage usage is
not as bad as it was previously. However, operators will need to be
aware.

While "podman image prune" does have a --filter option to preserve
images, it does not work in the version of podman in
container-tools:3.0. When the needed patch[1] is available, the podman
purge tasks can be re-enabled, which would address the issue of growing
local storage.

[1] a5ad36c65e
[2] https://github.com/containers/podman/pull/10390

Change-Id: Ibd2200aa912960b267a9975571e05665a29e40f0
Signed-off-by: James Slagle <jslagle@redhat.com>
(cherry picked from commit 7eb280ace8)
This commit is contained in:
James Slagle 2022-02-02 12:40:21 -05:00
parent 058243c551
commit c7170b7ac7
2 changed files with 31 additions and 0 deletions

View File

@ -68,6 +68,10 @@ parameters:
additional ordering dependencies for the systemd
scopes associated to podman containers.
type: boolean
deployment_source_hosts:
default: 'Undercloud'
type: string
description: Host or hostgroup that runs the deployment
conditions:
insecure_registry_is_empty: {equals : [{get_param: DockerInsecureRegistryAddress}, []]}
@ -221,19 +225,37 @@ outputs:
when: pcs_stat.stat.exists
post_upgrade_tasks:
# Podman purge tasks are disabled on the undercloud since the ephemeral
# Heat images need to be kept. When commit
# https://github.com/containers/podman/commit/a5ad36c65ea07d839fd9bf55a820c8cb9884eed1
# is available in the podman version used by TripleO, the ephemeral
# Heat images could be labeled in a way that they could be kept with
# --fitler, and these tasks could be re-enabled on the undercloud.
- name: Purge Podman
when:
- (step | int) == 3
- container_cli == 'podman'
- deployment_source_hosts not in group_names
include_role:
name: tripleo_podman
tasks_from: tripleo_podman_purge.yml
vars:
deployment_source_hosts: {get_param: deployment_source_hosts}
post_update_tasks:
# Podman purge tasks are disabled on the undercloud since the ephemeral
# Heat images need to be kept. When commit
# https://github.com/containers/podman/commit/a5ad36c65ea07d839fd9bf55a820c8cb9884eed1
# is available in the podman version used by TripleO, the ephemeral
# Heat images could be labeled in a way that they could be kept with
# --fitler, and these tasks could be re-enabled on the undercloud.
- name: Purge Podman
when:
- (step | int) == 3
- container_cli == 'podman'
- deployment_source_hosts not in group_names
include_role:
name: tripleo_podman
tasks_from: tripleo_podman_purge.yml
vars:
deployment_source_hosts: {get_param: deployment_source_hosts}

View File

@ -0,0 +1,9 @@
---
other:
- |
"podman image prune" is no longer used on the undercloud to remove unused
images during the undercloud update/upgrade. With the usage of ephemeral
Heat, not all images will always be used by running or stopped containers,
so "podman image prune" should not be used to clean up the local container
image storage. Images that are no longer being used can still be removed
individually with "podman rmi".