]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: add ceph.osdspec_affinity tag
authorJoshua Schmid <jschmid@suse.de>
Tue, 7 Apr 2020 09:23:10 +0000 (11:23 +0200)
committerJoshua Schmid <jschmid@suse.de>
Thu, 30 Apr 2020 10:07:35 +0000 (12:07 +0200)
Signed-off-by: Joshua Schmid <jschmid@suse.de>
src/ceph-volume/ceph_volume/api/lvm.py
src/ceph-volume/ceph_volume/devices/lvm/prepare.py
src/ceph-volume/ceph_volume/util/prepare.py

index 14ecba3b84fb9d5f847cb2caa9c25e15b59ee29e..b8932f38d4df616b4ed6f5f9bc0e78cd59341253 100644 (file)
@@ -946,6 +946,7 @@ class Volume(object):
                 'type': type_,
                 'osd_fsid': self.tags['ceph.osd_fsid'],
                 'cluster_fsid': self.tags['ceph.cluster_fsid'],
+                'osdspec_affinity': self.tags.get('ceph.osdspec_affinity', ''),
             }
             type_uuid = '{}_uuid'.format(type_)
             report[type_uuid] = self.tags['ceph.{}'.format(type_uuid)]
index 4440109417438164c8f6581ce6c712f9e09c0aa7..284f3c43ac1a4e05fad6d556a5e4e0ffc87838bf 100644 (file)
@@ -294,6 +294,7 @@ class Prepare(object):
             'ceph.cluster_fsid': cluster_fsid,
             'ceph.cluster_name': conf.cluster,
             'ceph.crush_device_class': crush_device_class,
+            'ceph.osdspec_affinity': prepare_utils.get_osdspec_affinity()
         }
         if self.args.filestore:
             #TODO: allow auto creation of journal on passed device, only works
index 867e2e2ec1072fd755469e52186c3870e78fb682..fdbed111156abf4077387c76daf4df6f3ce43c1b 100644 (file)
@@ -456,6 +456,10 @@ def osd_mkfs_bluestore(osd_id, fsid, keyring=None, wal=False, db=False):
         raise RuntimeError('Command failed with exit code %s: %s' % (returncode, ' '.join(command)))
 
 
+def get_osdspec_affinity():
+    return os.environ.get('CEPH_VOLUME_OSDSPEC_AFFINITY', '')
+
+
 def osd_mkfs_filestore(osd_id, fsid, keyring):
     """
     Create the files for the OSD to function. A normal call will look like: