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 <samuel.presatoledo@windriver.com>
Change-Id: Icb2b026ccac583295089e922e98d2acd207cabdb
This commit is contained in:
Samuel Presa Toledo 2022-05-09 16:00:23 -04:00
parent 730c2d69c0
commit 2ba470a29f
2 changed files with 11 additions and 0 deletions

View File

@ -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. """

View File

@ -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 + "/"