]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: fix filestore/dmcrypt activate
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 18 Nov 2020 07:26:27 +0000 (08:26 +0100)
committerJan Fajerski <jfajerski@suse.com>
Thu, 19 Nov 2020 21:17:18 +0000 (22:17 +0100)
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 <gabrioux@redhat.com>
(cherry picked from commit ee3aece808fd22e659c2c30c0674f7ec200f411b)

src/ceph-volume/ceph_volume/devices/lvm/prepare.py

index 9cb306fa9f228e43ba27cc1e3ff6f1e1d34d7da6..f0c3959a6272485bdf0cf5e598aff94e6c09141c 100644 (file)
@@ -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):
         """