]>
git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/ceph_volume/devices/lvm/create.py
1 from __future__
import print_function
2 from textwrap
import dedent
3 from ceph_volume
.util
import system
4 from ceph_volume
import decorators
5 from .common
import create_parser
6 from .prepare
import Prepare
7 from .activate
import Activate
12 help = 'Create a new OSD from an LVM device'
14 def __init__(self
, argv
):
17 @decorators.needs_root
18 def create(self
, args
):
20 args
.osd_fsid
= system
.generate_uuid()
21 Prepare([]).prepare(args
)
22 Activate([]).activate(args
)
25 sub_command_help
= dedent("""
26 Create an OSD by assigning an ID and FSID, registering them with the
27 cluster with an ID and FSID, formatting and mounting the volume, adding
28 all the metadata to the logical volumes using LVM tags, and starting
31 Most basic Usage looks like (journal will be collocated from the same volume group):
33 ceph-volume lvm create --data {volume group name}
36 Example calls for supported scenarios:
38 Dedicated volume group for Journal(s)
39 -------------------------------------
41 Existing logical volume (lv) or device:
43 ceph-volume lvm create --data {logical volume} --journal /path/to/{lv}|{device}
47 ceph-volume lvm create --data {data volume group} --journal {journal volume group}
49 Collocated (same group) for data and journal
50 --------------------------------------------
52 ceph-volume lvm create --data {volume group}
55 parser
= create_parser(
56 prog
='ceph-volume lvm create',
57 description
=sub_command_help
,
59 if len(self
.argv
) == 0:
60 print(sub_command_help
)
62 args
= parser
.parse_args(self
.argv
)