From a10816eb81d02aa8104990523b0844fa428a0597 Mon Sep 17 00:00:00 2001 From: Luca Miccini Date: Wed, 6 Dec 2023 12:16:01 +0100 Subject: [PATCH] Remove anonymous volumes when deleting container There are cases where the container storage gets out of sync, resulting in errors like: 2023-12-05T17:03:17.695962054+00:00 stderr F Error: creating container storage: the container name "nova_virtlogd" is already in use by 322ea2c1e5b194774b49c6605efd8284cf7d96663cb4a723396f8cb3f6897c33. You have to remove that container to be able to reuse that name: that name is already in use Deleting the container via 'podman rm -v' should avoid this scenario Change-Id: I3555c51f26d3e58024e9c1da769ca120bb0e758b --- templates/nova/virtlogd.epp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/nova/virtlogd.epp b/templates/nova/virtlogd.epp index f05603a03..bc2a4d16f 100644 --- a/templates/nova/virtlogd.epp +++ b/templates/nova/virtlogd.epp @@ -21,7 +21,7 @@ case ${CONTAINER_STATUS_SHORT} in Exited| exited| EXITED| Created| created| CREATED) echo "Removing orphaned ${NAME} container ${CONTAINER_ID}" $CLI stop ${CONTAINER_ID} || true - $CLI rm -f ${CONTAINER_ID} || true + $CLI rm -f -v ${CONTAINER_ID} || true ;& *) echo "Starting a new child container ${NAME}"