]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-daemon: add ceph-volume subcommand
authorSage Weil <sage@redhat.com>
Tue, 1 Oct 2019 16:33:32 +0000 (11:33 -0500)
committerSage Weil <sage@redhat.com>
Sat, 5 Oct 2019 01:33:35 +0000 (20:33 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/ceph-daemon

index 4beba43d4d7e0e74617bb15ddad83e7b31bb5b1b..a9e5ff0445710ff307aaf20acc021a169b335e79 100755 (executable)
@@ -677,6 +677,20 @@ def command_exec():
 
 ##################################
 
+def command_ceph_volume():
+    log_dir = get_log_dir(args.log_dir, args.fsid)
+    makedirs(log_dir)
+    c = CephContainer(
+        image=args.image,
+        entrypoint='/usr/sbin/ceph-volume',
+        args=args.command,
+        podman_args=['--privileged'],
+        volume_mounts=get_container_mounts(args.fsid, 'osd', None),
+    )
+    subprocess.call(c.run_cmd())
+
+##################################
+
 def command_unit():
     (daemon_type, daemon_id) = args.name.split('.')
     unit_name = get_unit_name(args.fsid, daemon_type, daemon_id)
@@ -890,6 +904,17 @@ parser_exec.add_argument(
     'command', nargs='+',
     help='command')
 
+parser_ceph_volume = subparsers.add_parser(
+    'ceph-volume', help='run ceph-volume inside a container')
+parser_ceph_volume.set_defaults(func=command_ceph_volume)
+parser_ceph_volume.add_argument(
+    '--fsid',
+    required=True,
+    help='cluster FSID')
+parser_ceph_volume.add_argument(
+    'command', nargs='+',
+    help='command')
+
 parser_unit = subparsers.add_parser(
     'unit', help='operate on the daemon\'s systemd unit')
 parser_unit.set_defaults(func=command_unit)