From: Guillaume Abrioux Date: Wed, 18 Nov 2020 07:26:27 +0000 (+0100) Subject: ceph-volume: fix filestore/dmcrypt activate X-Git-Tag: v14.2.15~1^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9f6677e9101e9f87553997f7c30b866245e621c4;p=ceph.git ceph-volume: fix filestore/dmcrypt activate The uuid set for tags['ceph.journal_uuid'] should point to its corresponding lv_uuid instead of the uuid generated for the lv_name. The variable name 'uuid' used so far was probably too confusing so let's change it to make it more clear. Closes: https://tracker.ceph.com/issues/48271 Signed-off-by: Guillaume Abrioux (cherry picked from commit ee3aece808fd22e659c2c30c0674f7ec200f411b) --- diff --git a/src/ceph-volume/ceph_volume/devices/lvm/prepare.py b/src/ceph-volume/ceph_volume/devices/lvm/prepare.py index 9cb306fa9f2..f0c3959a627 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/prepare.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/prepare.py @@ -157,16 +157,15 @@ class Prepare(object): lv = None if lv: - uuid = lv.lv_uuid + lv_uuid = lv.lv_uuid path = lv.lv_path - tags['ceph.%s_uuid' % device_type] = uuid + tags['ceph.%s_uuid' % device_type] = lv_uuid tags['ceph.%s_device' % device_type] = path lv.set_tags(tags) elif disk.is_device(device_name): # We got a disk, create an lv lv_type = "osd-{}".format(device_type) - uuid = system.generate_uuid() - tags['ceph.{}_uuid'.format(device_type)] = uuid + name_uuid = system.generate_uuid() kwargs = { 'device': device_name, 'tags': tags, @@ -178,18 +177,21 @@ class Prepare(object): kwargs['size'] = size lv = api.create_lv( lv_type, - uuid, + name_uuid, **kwargs) path = lv.lv_path tags['ceph.{}_device'.format(device_type)] = path + tags['ceph.{}_uuid'.format(device_type)] = lv.lv_uuid + lv_uuid = lv.lv_uuid lv.set_tags(tags) else: # otherwise assume this is a regular disk partition - uuid = self.get_ptuuid(device_name) + name_uuid = self.get_ptuuid(device_name) path = device_name - tags['ceph.%s_uuid' % device_type] = uuid + tags['ceph.%s_uuid' % device_type] = name_uuid tags['ceph.%s_device' % device_type] = path - return path, uuid, tags + lv_uuid = name_uuid + return path, lv_uuid, tags def prepare_data_device(self, device_type, osd_uuid): """