From 2ba470a29f7f706aeb5889adfa4657356fc65b35 Mon Sep 17 00:00:00 2001 From: Samuel Presa Toledo Date: Mon, 9 May 2022 16:00:23 -0400 Subject: [PATCH] Adjust pxeboot config files path in an upgrade During the upgrade from stx6.0 to stx7.0, the content of /opt/platform/config/22.06/pxelinux.cfg/ is copied from the previous release. This way, the grub.cfg, which is a symlink, points to /pxeboot/pxelinux.cfg.files/grub.cfg. As in release stx7.0 /pxeboot was moved to /var/pxeboot, the symlink should be recreated to point the correct path, which is /var/pxeboot/pxelinux.cfg.files/grub.cfg. This fix recriates the symlink pointing to the correct path. Note: cert-manager nginx-ingress-controller oidc-auth-apps platform-integ-apps The above apps were removed from upgrade path on 65-k8s-app-upgrade.sh script to finish upgrade process successfully Test plan PASS: Run initial bootstrap successfully PASS: Upgrade AIO-DX from stx6.0 to stx7.0 Closes-bug:1972572 Signed-off-by: Samuel Presa Toledo Change-Id: Icb2b026ccac583295089e922e98d2acd207cabdb --- .../controllerconfig/upgrades/controller.py | 10 ++++++++++ tsconfig/tsconfig/tsconfig/tsconfig.py | 1 + 2 files changed, 11 insertions(+) diff --git a/controllerconfig/controllerconfig/controllerconfig/upgrades/controller.py b/controllerconfig/controllerconfig/controllerconfig/upgrades/controller.py index c5d220d9fb..eb7451c950 100644 --- a/controllerconfig/controllerconfig/controllerconfig/upgrades/controller.py +++ b/controllerconfig/controllerconfig/controllerconfig/upgrades/controller.py @@ -32,6 +32,7 @@ from sysinv.puppet import common as puppet_common # (the platform.conf file will not have been updated with dynamic values). from tsconfig.tsconfig import SW_VERSION from tsconfig.tsconfig import PLATFORM_PATH +from tsconfig.tsconfig import VOLATILE_PXEBOOT_PATH from tsconfig.tsconfig import KEYRING_PATH from tsconfig.tsconfig import PLATFORM_CONF_FILE from tsconfig.tsconfig import CONTROLLER_UPGRADE_FLAG @@ -282,6 +283,7 @@ def migrate_pxeboot_config(from_release, to_release): "pxelinux.cfg", "") dest_pxelinux = os.path.join(PLATFORM_PATH, "config", to_release, "pxelinux.cfg") + try: subprocess.check_call( ["rsync", @@ -293,6 +295,14 @@ def migrate_pxeboot_config(from_release, to_release): LOG.exception("Failed to migrate %s" % source_pxelinux) raise + to_release_symlink_target = os.path.join(VOLATILE_PXEBOOT_PATH, + "pxelinux.cfg.files", "grub.cfg") + + dest_symlink_exists = os.path.islink(dest_pxelinux + "/grub.cfg") + if dest_symlink_exists: + os.unlink(dest_pxelinux + "/grub.cfg") + os.symlink(to_release_symlink_target, dest_pxelinux + "/grub.cfg") + def migrate_armada_config(from_release, to_release): """ Migrates armada configuration. """ diff --git a/tsconfig/tsconfig/tsconfig/tsconfig.py b/tsconfig/tsconfig/tsconfig/tsconfig.py index b843cd21f5..5d048205f3 100644 --- a/tsconfig/tsconfig/tsconfig/tsconfig.py +++ b/tsconfig/tsconfig/tsconfig/tsconfig.py @@ -180,6 +180,7 @@ _load() # Platform configuration paths and files VOLATILE_PATH = "/var/run" +VOLATILE_PXEBOOT_PATH = "/var/pxeboot" PLATFORM_PATH = "/opt/platform" CONFIG_PATH = PLATFORM_PATH + "/config/" + SW_VERSION + "/" PUPPET_PATH = PLATFORM_PATH + "/puppet/" + SW_VERSION + "/"