From: Joshua Schmid Date: Tue, 7 Apr 2020 09:23:10 +0000 (+0200) Subject: ceph-volume: add ceph.osdspec_affinity tag X-Git-Tag: v15.2.4~71^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e4894f0f15f50573d041e6eb04fef84f0dab9d95;p=ceph.git ceph-volume: add ceph.osdspec_affinity tag Signed-off-by: Joshua Schmid (cherry picked from commit b7bc6f7607d79af6d43e788ea2a26785f4ed5d45) --- diff --git a/src/ceph-volume/ceph_volume/api/lvm.py b/src/ceph-volume/ceph_volume/api/lvm.py index 30746805f651..e0592cfd75e0 100644 --- a/src/ceph-volume/ceph_volume/api/lvm.py +++ b/src/ceph-volume/ceph_volume/api/lvm.py @@ -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)] diff --git a/src/ceph-volume/ceph_volume/devices/lvm/prepare.py b/src/ceph-volume/ceph_volume/devices/lvm/prepare.py index c602a705fb92..4db8532806a9 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/prepare.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/prepare.py @@ -290,6 +290,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 diff --git a/src/ceph-volume/ceph_volume/util/prepare.py b/src/ceph-volume/ceph_volume/util/prepare.py index 867e2e2ec107..fdbed111156a 100644 --- a/src/ceph-volume/ceph_volume/util/prepare.py +++ b/src/ceph-volume/ceph_volume/util/prepare.py @@ -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: