]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/ceph-volume/ceph_volume/util/prepare.py
update ceph source to reef 18.2.0
[ceph.git] / ceph / src / ceph-volume / ceph_volume / util / prepare.py
index ff7427eedd207bd7782655bc7be147ea71184012..576c086170847d70cca03eb5946aaf9bb9023071 100644 (file)
@@ -53,28 +53,6 @@ def write_keyring(osd_id, secret, keyring_name='keyring', name=None):
     system.chown(osd_keyring)
 
 
-def get_journal_size(lv_format=True):
-    """
-    Helper to retrieve the size (defined in megabytes in ceph.conf) to create
-    the journal logical volume, it "translates" the string into a float value,
-    then converts that into gigabytes, and finally (optionally) it formats it
-    back as a string so that it can be used for creating the LV.
-
-    :param lv_format: Return a string to be used for ``lv_create``. A 5 GB size
-    would result in '5G', otherwise it will return a ``Size`` object.
-    """
-    conf_journal_size = conf.ceph.get_safe('osd', 'osd_journal_size', '5120')
-    logger.debug('osd_journal_size set to %s' % conf_journal_size)
-    journal_size = disk.Size(mb=str_to_int(conf_journal_size))
-
-    if journal_size < disk.Size(gb=2):
-        mlogger.error('Refusing to continue with configured size for journal')
-        raise RuntimeError('journal sizes must be larger than 2GB, detected: %s' % journal_size)
-    if lv_format:
-        return '%sG' % journal_size.gb.as_int()
-    return journal_size
-
-
 def get_block_db_size(lv_format=True):
     """
     Helper to retrieve the size (defined in megabytes in ceph.conf) to create
@@ -366,9 +344,6 @@ def _validate_bluestore_device(device, excepted_device_type, osd_uuid):
         terminal.error('device %s is used by another osd %s as %s, should be %s'% (device, current_osd_uuid, current_device_type, osd_uuid))
         raise SystemExit(1)
 
-def link_journal(journal_device, osd_id):
-    _link_device(journal_device, 'journal', osd_id)
-
 
 def link_block(block_device, osd_id):
     _link_device(block_device, 'block', osd_id)
@@ -483,50 +458,3 @@ def osd_mkfs_bluestore(osd_id, fsid, keyring=None, wal=False, db=False):
             else:
                 raise RuntimeError('Command failed with exit code %s: %s' % (returncode, ' '.join(command)))
 
-
-def osd_mkfs_filestore(osd_id, fsid, keyring):
-    """
-    Create the files for the OSD to function. A normal call will look like:
-
-          ceph-osd --cluster ceph --mkfs --mkkey -i 0 \
-                   --monmap /var/lib/ceph/osd/ceph-0/activate.monmap \
-                   --osd-data /var/lib/ceph/osd/ceph-0 \
-                   --osd-journal /var/lib/ceph/osd/ceph-0/journal \
-                   --osd-uuid 8d208665-89ae-4733-8888-5d3bfbeeec6c \
-                   --keyring /var/lib/ceph/osd/ceph-0/keyring \
-                   --setuser ceph --setgroup ceph
-
-    """
-    path = '/var/lib/ceph/osd/%s-%s/' % (conf.cluster, osd_id)
-    monmap = os.path.join(path, 'activate.monmap')
-    journal = os.path.join(path, 'journal')
-
-    system.chown(journal)
-    system.chown(path)
-
-    command = [
-        'ceph-osd',
-        '--cluster', conf.cluster,
-        '--osd-objectstore', 'filestore',
-        '--mkfs',
-        '-i', osd_id,
-        '--monmap', monmap,
-    ]
-
-    if get_osdspec_affinity():
-        command.extend(['--osdspec-affinity', get_osdspec_affinity()])
-
-    command.extend([
-        '--keyfile', '-',
-        '--osd-data', path,
-        '--osd-journal', journal,
-        '--osd-uuid', fsid,
-        '--setuser', 'ceph',
-        '--setgroup', 'ceph'
-    ])
-
-    _, _, returncode = process.call(
-        command, stdin=keyring, terminal_verbose=True, show_command=True
-    )
-    if returncode != 0:
-        raise RuntimeError('Command failed with exit code %s: %s' % (returncode, ' '.join(command)))