mirror of
https://github.com/ceph/ceph
synced 2025-02-22 02:27:29 +00:00
ceph-daemon: add ceph-volume subcommand
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
1aea25d264
commit
a99d1a5fe8
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user