From 47a03edc3bfe0ce41dbe6f2dd06e07214586415c Mon Sep 17 00:00:00 2001 From: Angie Wang Date: Fri, 16 Apr 2021 12:46:52 -0400 Subject: [PATCH] AIO-DX: Controller-1 fails to be unlocked after downgrade During stx4.0 to stx5.0 upgrade, controller-1 fails to be unlocked after downgrade due to the incorrect disk partition and physical volume information stored in stx4.0 DB that causes the puppet manifest apply failed during unlock. This is because cgts-vg size is decreased in stx5.0 and after controller-1 is upgraded to stx5.0, additional partition and pv are created at stx5.0 side to match the size in stx4.0. However, controller-0 is still running stx4.0 DB and it gets updated with the new created partition and pv info sent from controller-1 sysinv agent audit. This commit updates to ignore the disk partition and physical volume information sent back from a different version during upgrade. Tested: - AIO-DX upgrade from stx4.0 to stx5.0, verified upgrade is completed - controller-1 downgrade after it is upgraded and unlocked, verified upgrade abort is completed Change-Id: I5d7858e4b29d096437a5ddf94cd78c74fadfacad Closes-Bug: 1924786 Signed-off-by: Angie Wang (cherry picked from commit a24cd707a5cafaa2d49b25d1d5285c5c8582eb5d) --- .../sysinv/sysinv/sysinv/conductor/manager.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sysinv/sysinv/sysinv/sysinv/conductor/manager.py b/sysinv/sysinv/sysinv/sysinv/conductor/manager.py index cc982f54ca..fd012ac32a 100644 --- a/sysinv/sysinv/sysinv/sysinv/conductor/manager.py +++ b/sysinv/sysinv/sysinv/sysinv/conductor/manager.py @@ -3767,6 +3767,17 @@ class ConductorManager(service.PeriodicService): LOG.exception("Invalid ihost_uuid %s" % ihost_uuid) return + try: + self.dbapi.software_upgrade_get_one() + except exception.NotFound: + # No upgrade in progress + pass + else: + if db_host.software_load != tsc.SW_VERSION: + LOG.info("Ignore updating disk partition for host: %s. Version " + "%s mismatch." % (db_host.hostname, db_host.software_load)) + return + # Get the id of the host. forihostid = db_host['id'] @@ -3958,6 +3969,17 @@ class ConductorManager(service.PeriodicService): LOG.exception("Invalid ihost_uuid %s" % ihost_uuid) return + try: + self.dbapi.software_upgrade_get_one() + except exception.NotFound: + # No upgrade in progress + pass + else: + if ihost.software_load != tsc.SW_VERSION: + LOG.info("Ignore updating physical volume for host: %s. Version " + "%s mismatch." % (ihost.hostname, ihost.software_load)) + return + forihostid = ihost['id'] ipvs = self.dbapi.ipv_get_by_ihost(ihost_uuid)