From: Sage Weil Date: Tue, 1 Oct 2019 16:33:32 +0000 (-0500) Subject: ceph-daemon: add ceph-volume subcommand X-Git-Tag: v15.1.0~1313^2~36 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a99d1a5fe896d10962f85cf96aff3f2325b1e7f9;p=ceph.git ceph-daemon: add ceph-volume subcommand Signed-off-by: Sage Weil --- diff --git a/src/ceph-daemon b/src/ceph-daemon index 4beba43d4d7e..a9e5ff044571 100755 --- a/src/ceph-daemon +++ b/src/ceph-daemon @@ -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)