ceph-volume: add osdspec_affinity flag to ceph-osd

Signed-off-by: Joshua Schmid <jschmid@suse.de>
This commit is contained in:
Joshua Schmid 2020-04-29 17:49:52 +02:00
parent b7bc6f7607
commit 815f8e6470

View 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', '-'])