]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: make setting --cgroups=split configurable 47640/head
authorAdam King <adking@redhat.com>
Tue, 16 Aug 2022 14:43:39 +0000 (10:43 -0400)
committerAdam King <adking@redhat.com>
Tue, 16 Aug 2022 14:43:39 +0000 (10:43 -0400)
Previously, we were just always setting this as long
as users were using podman with a high enough version,
but it seems a user has run into an issue where their
daemons are failing to deploy with

Error: could not find cgroup mount in "/proc/self/cgroup"

despite having a podman with high enough version.

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

index 0410fbd86d0dfa17b6482acddbb63569887c2c27..a810f6f6601500bf8e86789afc2b2b5e36156368 100755 (executable)
@@ -3160,7 +3160,7 @@ def get_container(ctx: CephadmContext,
             '--cidfile',
             runtime_dir + '/ceph-%s@%s.%s.service-cid' % (fsid, daemon_type, daemon_id),
         ])
-        if ctx.container_engine.version >= CGROUPS_SPLIT_PODMAN_VERSION:
+        if ctx.container_engine.version >= CGROUPS_SPLIT_PODMAN_VERSION and not ctx.no_cgroups_split:
             container_args.append('--cgroups=split')
 
     return CephContainer.for_daemon(
@@ -9073,6 +9073,11 @@ def _get_parser():
         action='store_true',
         default=not CONTAINER_INIT,
         help='Do not run podman/docker with `--init`')
+    parser.add_argument(
+        '--no-cgroups-split',
+        action='store_true',
+        default=False,
+        help='Do not run containers with --cgroups=split (currently only relevant when using podman)')
 
     subparsers = parser.add_subparsers(help='sub-command')
 
index 4758a7eea4ca35a3a0084415fd8fcfcd1fe5903d..fd4182048e87e16a69b5d6a5bdd032525e92356b 100644 (file)
@@ -429,6 +429,12 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
             default=8765,
             desc='cephadm service discovery port'
         ),
+        Option(
+            'cgroups_split',
+            type='bool',
+            default=True,
+            desc='Pass --cgroups=split when cephadm creates containers (currently podman only)'
+        ),
     ]
 
     def __init__(self, *args: Any, **kwargs: Any):
@@ -504,6 +510,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
             self.apply_spec_fails: List[Tuple[str, str]] = []
             self.max_osd_draining_count = 10
             self.device_enhanced_scan = False
+            self.cgroups_split = True
 
         self.notify(NotifyType.mon_map, None)
         self.config_notify()
index 7596b3f5344e48287aa155426d84fff36f4026e7..8916b6f78488e05782d5cf774ae23c920bfe18d8 100644 (file)
@@ -1309,6 +1309,9 @@ class CephadmServe:
         if not self.mgr.container_init:
             final_args += ['--no-container-init']
 
+        if not self.mgr.cgroups_split:
+            final_args += ['--no-cgroups-split']
+
         # subcommand
         final_args.append(command)