]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: adds crush_device_class to json metadata for 'osd new'
authorAndrew Schoen <aschoen@redhat.com>
Thu, 11 Jan 2018 19:11:31 +0000 (13:11 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 1 Feb 2018 19:54:17 +0000 (13:54 -0600)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit 3404d8bba503f3f74f411b11108d39cb626d3bed)

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

index ad559e4ce6d70ec2223ac005453f6df503ddf078..c8c323053e896d233f62a673b1e4e9200819ed10 100644 (file)
@@ -189,6 +189,9 @@ class Prepare(object):
 
         cluster_fsid = conf.ceph.get('global', 'fsid')
         osd_fsid = args.osd_fsid or system.generate_uuid()
+        crush_device_class = args.crush_device_class
+        if crush_device_class:
+            secrets['crush_device_class'] = crush_device_class
         # allow re-using an id, in case a prepare failed
         self.osd_id = args.osd_id or prepare_utils.create_id(osd_fsid, json.dumps(secrets))
         tags = {
@@ -196,7 +199,7 @@ class Prepare(object):
             'ceph.osd_id': self.osd_id,
             'ceph.cluster_fsid': cluster_fsid,
             'ceph.cluster_name': conf.cluster,
-            'ceph.crush_device_class': args.crush_device_class,
+            'ceph.crush_device_class': crush_device_class,
         }
         if args.filestore:
             if not args.journal: