]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk-prepare: Use the OSD uuid as the partition GUID.
authorTommi Virtanen <tv@inktank.com>
Thu, 4 Oct 2012 23:03:40 +0000 (16:03 -0700)
committerTommi Virtanen <tv@inktank.com>
Fri, 5 Oct 2012 22:41:35 +0000 (15:41 -0700)
This will make locating the right data partition for a given journal
partition a lot easier.

Signed-off-by: Tommi Virtanen <tv@inktank.com>
src/ceph-disk-prepare

index 03c1527bd936a1996ec09ebbe43782d0fd74b293..b69f21e4bf3e612246bd5427a2c5f1104f4733de 100755 (executable)
@@ -184,6 +184,8 @@ def prepare(
     WARNING: This will unconditionally overwrite anything given to
     it.
     """
+    osd_uuid = str(uuid.uuid4())
+
     try:
         subprocess.check_call(
             args=[
@@ -193,6 +195,9 @@ def prepare(
                 '--mbrtogpt',
                 '--largest-new=1',
                 '--change-name=1:ceph data',
+                '--partition-guid=1:{osd_uuid}'.format(
+                    osd_uuid=osd_uuid,
+                    ),
                 '--typecode=1:89c57f98-2fe5-4dc0-89c1-f3ad0ceff2be',
                 '--',
                 disk,
@@ -222,7 +227,6 @@ def prepare(
     path = mount(dev=dev, fstype=fstype, options=mount_options)
     try:
         write_one_line(path, 'ceph_fsid', cluster_uuid)
-        osd_uuid = str(uuid.uuid4())
         write_one_line(path, 'fsid', osd_uuid)
         write_one_line(path, 'magic', CEPH_OSD_ONDISK_MAGIC)
     finally: