]> git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/ceph_volume/devices/raw/common.py
08cfd02890cb0c7b588fb5f9d3a4d55f897d8415
[ceph.git] / ceph / src / ceph-volume / ceph_volume / devices / raw / common.py
1 import argparse
2 from ceph_volume.util import arg_validators
3
4 def create_parser(prog, description):
5 """
6 Both prepare and create share the same parser, those are defined here to
7 avoid duplication
8 """
9 parser = argparse.ArgumentParser(
10 prog=prog,
11 formatter_class=argparse.RawDescriptionHelpFormatter,
12 description=description,
13 )
14 parser.add_argument(
15 '--data',
16 required=True,
17 type=arg_validators.ValidDevice(as_string=True),
18 help='a raw device to use for the OSD',
19 )
20 parser.add_argument(
21 '--bluestore',
22 action='store_true',
23 help='Use BlueStore backend')
24 parser.add_argument(
25 '--crush-device-class',
26 dest='crush_device_class',
27 help='Crush device class to assign this OSD to',
28 )
29 parser.add_argument(
30 '--no-tmpfs',
31 action='store_true',
32 help='Do not use a tmpfs mount for OSD data dir'
33 )
34 parser.add_argument(
35 '--block.db',
36 dest='block_db',
37 help='Path to bluestore block.db block device'
38 )
39 parser.add_argument(
40 '--block.wal',
41 dest='block_wal',
42 help='Path to bluestore block.wal block device'
43 )
44 parser.add_argument(
45 '--dmcrypt',
46 action='store_true',
47 help='Enable device encryption via dm-crypt',
48 )
49 return parser