]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: fix upgrades with nvmeof 53862/head
authorAdam King <adking@redhat.com>
Fri, 6 Oct 2023 15:20:57 +0000 (11:20 -0400)
committerAdam King <adking@redhat.com>
Fri, 6 Oct 2023 15:30:21 +0000 (11:30 -0400)
Currently, nvmeof was being treated as if it used
a ceph image during upgrades. This would cause logging
of messages like (I've removed the nvmeof daemon id)

log [WRN] :     Upgrade daemon: nvmeof.<id>: Cannot redeploy
nvmeof.<id> with a new image: Supported types are: mgr, mon,
crash, osd, mds, rgw, rbd-mirror, cephfs-mirror, ceph-exporter,
iscsi, nfs

and if you had set a custom image for the
mgr/cephadm/container_image_nvmeof setting, this would
be undone as part of the upgrade process.

Fixes: https://tracker.ceph.com/issues/63127
Signed-off-by: Adam King <adking@redhat.com>
src/pybind/mgr/cephadm/upgrade.py
src/pybind/mgr/cephadm/utils.py

index 64daa5eeedc85d74d4d7484707886c5c1d89b430..de4b1a1902fe6bc317432fe71723ac46f61adb25 100644 (file)
@@ -9,7 +9,7 @@ from cephadm.registry import Registry
 from cephadm.serve import CephadmServe
 from cephadm.services.cephadmservice import CephadmDaemonDeploySpec
 from cephadm.utils import ceph_release_to_major, name_to_config_section, CEPH_UPGRADE_ORDER, \
-    MONITORING_STACK_TYPES, CEPH_TYPES, GATEWAY_TYPES
+    CEPH_TYPES, NON_CEPH_IMAGE_TYPES, GATEWAY_TYPES
 from cephadm.ssh import HostConnectionError
 from orchestrator import OrchestratorError, DaemonDescription, DaemonDescriptionStatus, daemon_type_to_service
 
@@ -398,7 +398,7 @@ class CephadmUpgrade:
         # in order for the user's selection of daemons to upgrade to be valid. for example,
         # if they say --daemon-types 'osd,mds' but mons have not been upgraded, we block.
         daemons = [d for d in self.mgr.cache.get_daemons(
-        ) if d.daemon_type not in MONITORING_STACK_TYPES]
+        ) if d.daemon_type not in NON_CEPH_IMAGE_TYPES]
         err_msg_base = 'Cannot start upgrade. '
         # "dtypes" will later be filled in with the types of daemons that will be upgraded with the given parameters
         dtypes = []
@@ -767,7 +767,7 @@ class CephadmUpgrade:
             if (
                 (self.mgr.use_repo_digest and d.matches_digests(target_digests))
                 or (not self.mgr.use_repo_digest and d.matches_image_name(target_name))
-                or (d.daemon_type in MONITORING_STACK_TYPES)
+                or (d.daemon_type in NON_CEPH_IMAGE_TYPES)
             ):
                 logger.debug('daemon %s.%s on correct image' % (
                     d.daemon_type, d.daemon_id))
@@ -1162,7 +1162,7 @@ class CephadmUpgrade:
                 # and monitoring stack daemons. Additionally, this case is only valid if
                 # the active mgr is already upgraded.
                 if any(d in target_digests for d in self.mgr.get_active_mgr_digests()):
-                    if daemon_type not in MONITORING_STACK_TYPES and daemon_type != 'mgr':
+                    if daemon_type not in NON_CEPH_IMAGE_TYPES and daemon_type != 'mgr':
                         continue
                 else:
                     self._mark_upgrade_complete()
@@ -1175,8 +1175,8 @@ class CephadmUpgrade:
             upgraded_daemon_count += done
             self._update_upgrade_progress(upgraded_daemon_count / len(daemons))
 
-            # make sure mgr and monitoring stack daemons are properly redeployed in staggered upgrade scenarios
-            if daemon_type == 'mgr' or daemon_type in MONITORING_STACK_TYPES:
+            # make sure mgr and non-ceph-image daemons are properly redeployed in staggered upgrade scenarios
+            if daemon_type == 'mgr' or daemon_type in NON_CEPH_IMAGE_TYPES:
                 if any(d in target_digests for d in self.mgr.get_active_mgr_digests()):
                     need_upgrade_names = [d[0].name() for d in need_upgrade] + \
                         [d[0].name() for d in need_upgrade_deployer]
index e920179710ce7953371bc0f552d31c0810779158..63672936c7cb317f5b8c435cf544dc0fa4551836 100644 (file)
@@ -33,6 +33,11 @@ CEPH_UPGRADE_ORDER = CEPH_TYPES + GATEWAY_TYPES + MONITORING_STACK_TYPES
 # these daemon types use the ceph container image
 CEPH_IMAGE_TYPES = CEPH_TYPES + ['iscsi', 'nfs']
 
+# these daemons do not use the ceph image. There are other daemons
+# that also don't use the ceph image, but we only care about those
+# that are part of the upgrade order here
+NON_CEPH_IMAGE_TYPES = MONITORING_STACK_TYPES + ['nvmeof']
+
 # Used for _run_cephadm used for check-host etc that don't require an --image parameter
 cephadmNoImage = CephadmNoImage.token