]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: add osdspec_affinity flag to ceph-osd 34436/head
authorJoshua Schmid <jschmid@suse.de>
Wed, 29 Apr 2020 15:49:52 +0000 (17:49 +0200)
committerJoshua Schmid <jschmid@suse.de>
Thu, 30 Apr 2020 10:07:36 +0000 (12:07 +0200)
Signed-off-by: Joshua Schmid <jschmid@suse.de>
src/ceph-volume/ceph_volume/util/prepare.py

index fdbed111156abf4077387c76daf4df6f3ce43c1b..85c3480a9509434a5e52a734331fcc30a2ff1037 100644 (file)
@@ -399,6 +399,10 @@ def get_monmap(osd_id):
     ])
 
 
+def get_osdspec_affinity():
+    return os.environ.get('CEPH_VOLUME_OSDSPEC_AFFINITY', '')
+
+
 def osd_mkfs_bluestore(osd_id, fsid, keyring=None, wal=False, db=False):
     """
     Create the files for the OSD to function. A normal call will look like:
@@ -449,6 +453,9 @@ def osd_mkfs_bluestore(osd_id, fsid, keyring=None, wal=False, db=False):
         )
         system.chown(db)
 
+    if get_osdspec_affinity():
+        base_command.extend(['--osdspec-affinity', get_osdspec_affinity()])
+
     command = base_command + supplementary_command
 
     _, _, returncode = process.call(command, stdin=keyring, show_command=True)
@@ -456,10 +463,6 @@ 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:
@@ -489,6 +492,9 @@ def osd_mkfs_filestore(osd_id, fsid, keyring):
         '--monmap', monmap,
     ]
 
+    if get_osdspec_affinity():
+        command.extend(['--osdspec-affinity', get_osdspec_affinity()])
+
     if __release__ != 'luminous':
         # goes through stdin
         command.extend(['--keyfile', '-'])