summaryrefslogtreecommitdiffstats
path: root/src/ceph-volume/ceph_volume/devices/lvm/prepare.py
diff options
context:
space:
mode:
authorAndrew Schoen <aschoen@redhat.com>2018-01-10 19:19:54 +0100
committerAndrew Schoen <aschoen@redhat.com>2018-01-16 16:20:33 +0100
commit11da2185635ce14103471d851f1e8c84199d3745 (patch)
tree0b24c336243ed60bada123f4bdacead9feea1815 /src/ceph-volume/ceph_volume/devices/lvm/prepare.py
parentceph-volume: adds a --crush-device-class flag to lvm create and prepare (diff)
downloadceph-11da2185635ce14103471d851f1e8c84199d3745.tar.xz
ceph-11da2185635ce14103471d851f1e8c84199d3745.zip
ceph-volume: add crush_device_class to lvm metadata
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
Diffstat (limited to 'src/ceph-volume/ceph_volume/devices/lvm/prepare.py')
-rw-r--r--src/ceph-volume/ceph_volume/devices/lvm/prepare.py27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/ceph-volume/ceph_volume/devices/lvm/prepare.py b/src/ceph-volume/ceph_volume/devices/lvm/prepare.py
index a41c41af7cb..18d504ca418 100644
--- a/src/ceph-volume/ceph_volume/devices/lvm/prepare.py
+++ b/src/ceph-volume/ceph_volume/devices/lvm/prepare.py
@@ -192,6 +192,13 @@ class Prepare(object):
osd_fsid = args.osd_fsid or system.generate_uuid()
# allow re-using an id, in case a prepare failed
self.osd_id = args.osd_id or prepare_utils.create_id(osd_fsid, json.dumps(secrets))
+ tags = {
+ 'ceph.osd_fsid': osd_fsid,
+ 'ceph.osd_id': self.osd_id,
+ 'ceph.cluster_fsid': cluster_fsid,
+ 'ceph.cluster_name': conf.cluster,
+ 'ceph.crush_device_class': args.crush_device_class,
+ }
if args.filestore:
if not args.journal:
raise RuntimeError('--journal is required when using --filestore')
@@ -200,14 +207,8 @@ class Prepare(object):
if not data_lv:
data_lv = self.prepare_device(args.data, 'data', cluster_fsid, osd_fsid)
- tags = {
- 'ceph.osd_fsid': osd_fsid,
- 'ceph.osd_id': self.osd_id,
- 'ceph.cluster_fsid': cluster_fsid,
- 'ceph.cluster_name': conf.cluster,
- 'ceph.data_device': data_lv.lv_path,
- 'ceph.data_uuid': data_lv.lv_uuid,
- }
+ tags['ceph.data_device'] = data_lv.lv_path
+ tags['ceph.data_uuid'] = data_lv.lv_uuid
journal_device, journal_uuid, tags = self.setup_device('journal', args.journal, tags)
@@ -226,14 +227,8 @@ class Prepare(object):
if not block_lv:
block_lv = self.prepare_device(args.data, 'block', cluster_fsid, osd_fsid)
- tags = {
- 'ceph.osd_fsid': osd_fsid,
- 'ceph.osd_id': self.osd_id,
- 'ceph.cluster_fsid': cluster_fsid,
- 'ceph.cluster_name': conf.cluster,
- 'ceph.block_device': block_lv.lv_path,
- 'ceph.block_uuid': block_lv.lv_uuid,
- }
+ tags['ceph.block_device'] = block_lv.lv_path
+ tags['ceph.block_uuid'] = block_lv.lv_uuid
wal_device, wal_uuid, tags = self.setup_device('wal', args.block_wal, tags)
db_device, db_uuid, tags = self.setup_device('db', args.block_db, tags)