diff options
author | Joshua Schmid <jschmid@suse.de> | 2020-04-29 17:49:52 +0200 |
---|---|---|
committer | Joshua Schmid <jschmid@suse.de> | 2020-04-30 12:07:36 +0200 |
commit | 815f8e6470c6e72d9e2f51630dd3c26d388847aa (patch) | |
tree | 50e30d036470e2cc4efe306577342a2fb3761a76 /src/ceph-volume/ceph_volume/util | |
parent | ceph-volume: add ceph.osdspec_affinity tag (diff) | |
download | ceph-815f8e6470c6e72d9e2f51630dd3c26d388847aa.tar.xz ceph-815f8e6470c6e72d9e2f51630dd3c26d388847aa.zip |
ceph-volume: add osdspec_affinity flag to ceph-osd
Signed-off-by: Joshua Schmid <jschmid@suse.de>
Diffstat (limited to '')
-rw-r--r-- | src/ceph-volume/ceph_volume/util/prepare.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/ceph-volume/ceph_volume/util/prepare.py b/src/ceph-volume/ceph_volume/util/prepare.py index fdbed111156..85c3480a950 100644 --- a/src/ceph-volume/ceph_volume/util/prepare.py +++ b/src/ceph-volume/ceph_volume/util/prepare.py @@ -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', '-']) |