From: Sage Weil Date: Thu, 26 Jun 2014 18:37:15 +0000 (-0700) Subject: Revert "ceph-disk: Enable creating multiple osds per dev" X-Git-Tag: v0.83~33 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ad81a98e0909aa83a0f1e53b0b75e2bf5a644156;p=ceph.git Revert "ceph-disk: Enable creating multiple osds per dev" This reverts commit 200d0ae9c6e6701c06310230e180d4e739865bfe. This breaks ceph-disk. See #8644. Reverting for now. Signed-off-by: Sage Weil --- diff --git a/src/ceph-disk b/src/ceph-disk index a2a426aa754d..205037f0e581 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -978,8 +978,8 @@ def prepare_journal_dev( if journal == data: # we're sharing the disk between osd data and journal; # make journal be partition number 2, so it's pretty - num = get_free_partition_index(dev=journal) - journal_part = '{num}:+0:+{size}M'.format( + num = 2 + journal_part = '{num}:0:{size}M'.format( num=num, size=journal_size, ) @@ -1193,7 +1193,6 @@ def prepare_dir( def prepare_dev( data, - data_size, journal, fstype, mkfs_args, @@ -1230,41 +1229,19 @@ def prepare_dev( LOG.debug('Creating osd partition on %s', data) try: - if data_size is None: - num = 1 - command_check_call( - [ - 'sgdisk', - '--largest-new=1', - '--change-name=1:ceph data', - '--partition-guid=1:{osd_uuid}'.format( - osd_uuid=osd_uuid, - ), - '--typecode=1:%s' % ptype_tobe, - '--', - data, - ], - ) - else: - num = get_free_partition_index(dev=data) - part = '{num}:+0:+{size}M'.format( - num=num, - size=data_size) - command_check_call( - [ - 'sgdisk', - '--new={part}'.format(part=part), - '--change-name={num}:ceph data'.format(num=num), - '--partition-guid={num}:{osd_uuid}'.format( - num=num, - osd_uuid=osd_uuid, - ), - '--typecode={num}:{ptype}'.format(num=num, ptype=ptype_tobe), - '--', - data, - ], - ) - + command_check_call( + [ + 'sgdisk', + '--largest-new=1', + '--change-name=1:ceph data', + '--partition-guid=1:{osd_uuid}'.format( + osd_uuid=osd_uuid, + ), + '--typecode=1:%s' % ptype_tobe, + '--', + data, + ], + ) command( [ 'partprobe', @@ -1281,7 +1258,7 @@ def prepare_dev( except subprocess.CalledProcessError as e: raise Error(e) - rawdev = get_partition_dev(data, num) + rawdev = get_partition_dev(data, 1) dev = None if osd_dm_keypath: @@ -1339,7 +1316,7 @@ def prepare_dev( command_check_call( [ 'sgdisk', - '--typecode={num}:{ptype}'.format(num=num, ptype=ptype_osd), + '--typecode=1:%s' % ptype_osd, '--', data, ], @@ -1430,11 +1407,6 @@ def main_prepare(args): ) journal_size = int(journal_size) - if args.data_size is not None: - data_size = int(args.data_size) - else: - data_size = None - # colocate journal with data? if stat.S_ISBLK(dmode) and not is_partition(args.data) and args.journal is None and args.journal_file is None: LOG.info('Will colocate journal with data on %s', args.data) @@ -1478,7 +1450,6 @@ def main_prepare(args): raise Error('data path is not a directory', args.data) prepare_dev( data=args.data, - data_size=data_size, journal=journal_symlink, fstype=args.fs_type, mkfs_args=mkfs_args, @@ -2493,11 +2464,6 @@ def parse_args(): default='/etc/ceph/dmcrypt-keys', help='directory where dm-crypt keys are stored', ) - prepare_parser.add_argument( - '--data-size', - default=None, - help='size of data partition' - ) prepare_parser.add_argument( 'data', metavar='DATA',