]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: add iscsi and nfs to upgrade
authorAdam King <adking@redhat.com>
Wed, 24 Feb 2021 21:44:57 +0000 (16:44 -0500)
committerSage Weil <sage@newdream.net>
Tue, 16 Mar 2021 12:56:18 +0000 (07:56 -0500)
Fixes: https://tracker.ceph.com/issues/49462
Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit 20e7b4d5aaaf60442f5600dc914080b3c9615795)

qa/suites/rados/cephadm/upgrade/fixed-2.yaml
src/pybind/mgr/cephadm/module.py
src/pybind/mgr/cephadm/serve.py
src/pybind/mgr/cephadm/upgrade.py
src/pybind/mgr/cephadm/utils.py

index 8c79ebe96bf6fc6b4569691241f5f5bd2edabc33..a0ec7a192cbb31cd4d0ebf700105b324d4f8c3f1 100644 (file)
@@ -20,6 +20,7 @@ roles:
   - prometheus.a
   - grafana.a
   - node-exporter.b
+  - ceph.iscsi.iscsi.a
 openstack:
 - volumes: # attached to each instance
     count: 4
index b46b7e3db71ae98a4a09fcb0abfbbc25633e0b69..50fede4e15e47007856997b88e2851f742c09a6d 100644 (file)
@@ -57,9 +57,9 @@ from .services.monitoring import GrafanaService, AlertmanagerService, Prometheus
 from .services.exporter import CephadmExporter, CephadmExporterConfig
 from .schedule import HostAssignment
 from .inventory import Inventory, SpecStore, HostCache, EventStore
-from .upgrade import CEPH_UPGRADE_ORDER, CephadmUpgrade
+from .upgrade import CephadmUpgrade
 from .template import TemplateMgr
-from .utils import forall_hosts, cephadmNoImage
+from .utils import CEPH_TYPES, GATEWAY_TYPES, forall_hosts, cephadmNoImage
 from .configchecks import CephadmConfigChecks
 
 try:
@@ -90,8 +90,6 @@ Host *
   ConnectTimeout=30
 """
 
-CEPH_TYPES = set(CEPH_UPGRADE_ORDER)
-
 # Default container images -----------------------------------------------------
 DEFAULT_IMAGE = 'docker.io/ceph/ceph'
 DEFAULT_PROMETHEUS_IMAGE = 'docker.io/prom/prometheus:v2.18.1'
@@ -1228,8 +1226,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
         daemon_type = daemon_name.split('.', 1)[0]  # type: ignore
         image: Optional[str] = None
         if daemon_type in CEPH_TYPES or \
-                daemon_type == 'nfs' or \
-                daemon_type == 'iscsi':
+                daemon_type in GATEWAY_TYPES:
             # get container image
             image = str(self.get_foreign_ceph_option(
                 utils.name_to_config_section(daemon_name),
@@ -1736,10 +1733,10 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
             if action != 'redeploy':
                 raise OrchestratorError(
                     f'Cannot execute {action} with new image. `action` needs to be `redeploy`')
-            if daemon_type not in CEPH_TYPES:
+            if daemon_type not in CEPH_TYPES and daemon_type not in GATEWAY_TYPES:
                 raise OrchestratorError(
                     f'Cannot redeploy {daemon_type}.{daemon_id} with a new image: Supported '
-                    f'types are: {", ".join(CEPH_TYPES)}')
+                    f'types are: {", ".join(CEPH_TYPES + GATEWAY_TYPES)}')
 
             self.check_mon_command({
                 'prefix': 'config set',
index ae8436839c9b2b65748374ddda6a06b27b5dc26b..e2c2fa9a72749185bd8d9c05d4a42ffc40929617 100644 (file)
@@ -24,7 +24,7 @@ from orchestrator import OrchestratorError, set_exception_subject, OrchestratorE
 from cephadm.services.cephadmservice import CephadmDaemonDeploySpec
 from cephadm.schedule import HostAssignment
 from cephadm.utils import forall_hosts, cephadmNoImage, is_repo_digest, \
-    CephadmNoImage, CEPH_UPGRADE_ORDER, ContainerInspectInfo
+    CephadmNoImage, CEPH_TYPES, ContainerInspectInfo
 from mgr_module import MonCommandFailed
 
 from . import utils
@@ -35,8 +35,6 @@ if TYPE_CHECKING:
 
 logger = logging.getLogger(__name__)
 
-CEPH_TYPES = set(CEPH_UPGRADE_ORDER)
-
 
 class CephadmServe:
     """
index 1e655ee5f8faa27ec2ebdeddd2d0c8e51040b7f1..24b36fa8fc393c5b230806a0d35c9d87fde4c2ac 100644 (file)
@@ -475,10 +475,11 @@ class CephadmUpgrade:
                         to_upgrade.append(d)
                     continue
 
-                # NOTE: known_ok_to_stop is an output argument for
-                # _wait_for_ok_to_stop
-                if not self._wait_for_ok_to_stop(d, known_ok_to_stop):
-                    return
+                if d.daemon_type in ['mon', 'osd', 'mds']:
+                    # NOTE: known_ok_to_stop is an output argument for
+                    # _wait_for_ok_to_stop
+                    if not self._wait_for_ok_to_stop(d, known_ok_to_stop):
+                        return
 
                 to_upgrade.append(d)
 
index 82ad06576535c28aadb669a4f564a42136f071e2..bde3d1f4e261d5e6fc1ef238ba84eb5fd2a46c56 100644 (file)
@@ -20,8 +20,10 @@ class CephadmNoImage(Enum):
 
 
 # ceph daemon types that use the ceph container image.
-# NOTE: listed in upgrade order!
-CEPH_UPGRADE_ORDER = ['mgr', 'mon', 'crash', 'osd', 'mds', 'rgw', 'rbd-mirror', 'cephfs-mirror']
+# NOTE: order important here as these are used for upgrade order
+CEPH_TYPES = ['mgr', 'mon', 'crash', 'osd', 'mds', 'rgw', 'rbd-mirror', 'cephfs-mirror']
+GATEWAY_TYPES = ['iscsi', 'nfs']
+CEPH_UPGRADE_ORDER = CEPH_TYPES + GATEWAY_TYPES
 
 
 # Used for _run_cephadm used for check-host etc that don't require an --image parameter