From 1531fc45b86f409d7ed790f9fefbd6e5112bb97a Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Tue, 5 Nov 2024 08:27:43 -0600 Subject: [PATCH] ironic: ensure reasonable tempdir default Ironic will create temporary images, like ISOs, which are then hard linked into the images directory. Hard links don't work across file system boundaries so the tempdir that's used must be within the same file system that's used for the images. Change-Id: Ide735dc6f302aefd4269adda129b28d95664fe17 Signed-off-by: Doug Goldstein --- ironic/Chart.yaml | 2 +- ironic/templates/bin/_ironic-conductor-init.sh.tpl | 7 +++++++ ironic/values.yaml | 3 +++ releasenotes/notes/ironic.yaml | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ironic/Chart.yaml b/ironic/Chart.yaml index 7397b3a3da..02b37605aa 100644 --- a/ironic/Chart.yaml +++ b/ironic/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Ironic name: ironic -version: 0.2.19 +version: 0.2.20 home: https://docs.openstack.org/ironic/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Ironic/OpenStack_Project_Ironic_vertical.png sources: diff --git a/ironic/templates/bin/_ironic-conductor-init.sh.tpl b/ironic/templates/bin/_ironic-conductor-init.sh.tpl index 6555865b57..54b5ad96a0 100644 --- a/ironic/templates/bin/_ironic-conductor-init.sh.tpl +++ b/ironic/templates/bin/_ironic-conductor-init.sh.tpl @@ -34,6 +34,13 @@ if [ "x" == "x${PXE_IP}" ]; then exit 1 fi +# ensure the tempdir exists, read it from the config +ironictmpdir=$(python -c 'from configparser import ConfigParser;cfg = ConfigParser();cfg.read("ironic.conf");print(cfg.get("DEFAULT", "tempdir", fallback=""))') +if [ -n "${ironictmpdir}" -a ! -d "${ironictmpdir}" ]; then + mkdir -p "${ironictmpdir}" + chmod 1777 "${ironictmpdir}" +fi + tee /tmp/pod-shared/conductor-local-ip.conf << EOF [DEFAULT] diff --git a/ironic/values.yaml b/ironic/values.yaml index be58b1279d..8ef63063d0 100644 --- a/ironic/values.yaml +++ b/ironic/values.yaml @@ -101,6 +101,9 @@ conf: ironic: DEFAULT: log_config_append: /etc/ironic/logging.conf + # conductor may use hardlinks to images for certain boot modes so the default path needs + # to be on the same filesystem + tempdir: /var/lib/openstack-helm/tmp api: port: null conductor: diff --git a/releasenotes/notes/ironic.yaml b/releasenotes/notes/ironic.yaml index 6c26aa115f..dc3679ffdc 100644 --- a/releasenotes/notes/ironic.yaml +++ b/releasenotes/notes/ironic.yaml @@ -23,4 +23,5 @@ ironic: - 0.2.17 Allow overriding of hostNetwork and hostIPC for Ironic conductor - 0.2.18 Use service tokens - 0.2.19 Allow extra containers for the conductor + - 0.2.20 ensure tempdir is set to a reasonable default ...