]> git-server-git.apps.pok.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>
Tue, 16 Jan 2018 15:20:34 +0000 (09:20 -0600)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
src/ceph-volume/ceph_volume/devices/lvm/prepare.py

index 18d504ca4180dbdad21c733f5e30503bbf95c079..4d90efd0bfe74aa7883ad3cf224ab48cc6ea23d1 100644 (file)
@@ -190,6 +190,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 = {
@@ -197,7 +200,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: