mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
ceph-volume lvm.strategies use new template location in bluestore
Signed-off-by: Alfredo Deza <adeza@redhat.com>
This commit is contained in:
parent
783e58472c
commit
8f7bca7ba1
@ -5,31 +5,7 @@ from ceph_volume.util import disk
|
||||
from ceph_volume.api import lvm
|
||||
from . import validators
|
||||
from ceph_volume.devices.lvm.create import Create
|
||||
|
||||
# TODO: get these templates out so filestore can re-use them
|
||||
|
||||
osd_header_template = """
|
||||
{:-^80}""".format('')
|
||||
|
||||
|
||||
osd_component_titles = """
|
||||
Type Path LV Size % of device"""
|
||||
|
||||
|
||||
osd_component_template = """
|
||||
{_type: <15} {path: <25} {size: <15} {percent}%"""
|
||||
|
||||
|
||||
header_template = """
|
||||
Total OSDs: {total_osds}
|
||||
"""
|
||||
|
||||
vg_template = """
|
||||
Solid State VG:
|
||||
Targets: {target: <25} Total size: {total_lv_size: <25}
|
||||
Total LVs: {total_lvs: <25} Size per LV: {lv_size: <25}
|
||||
Devices: {block_db_devices}
|
||||
"""
|
||||
from ceph_volume.util import templates
|
||||
|
||||
|
||||
class SingleType(object):
|
||||
@ -51,14 +27,14 @@ class SingleType(object):
|
||||
|
||||
def report_pretty(self):
|
||||
string = ""
|
||||
string += header_template.format(
|
||||
string += templates.osd_header.format(
|
||||
total_osds=len(self.hdds) or len(self.ssds) * 2
|
||||
)
|
||||
string += osd_component_titles
|
||||
string += templates.osd_component_titles
|
||||
|
||||
for osd in self.computed['osds']:
|
||||
string += osd_header_template
|
||||
string += osd_component_template.format(
|
||||
string += templates.osd_header
|
||||
string += templates.osd_component.format(
|
||||
_type='[data]',
|
||||
path=osd['data']['path'],
|
||||
size=osd['data']['human_readable_size'],
|
||||
@ -159,7 +135,7 @@ class MixedType(object):
|
||||
db_size = str(disk.Size(b=(vg_extents['sizes'])))
|
||||
|
||||
string = ""
|
||||
string += header_template.format(
|
||||
string += templates.osd_header.format(
|
||||
targets='block.db',
|
||||
total_lv_size=str(self.total_ssd_size),
|
||||
total_lvs=vg_extents['parts'],
|
||||
@ -168,7 +144,7 @@ class MixedType(object):
|
||||
lv_size=str(disk.Size(b=(vg_extents['sizes']))),
|
||||
total_osds=len(self.hdds)
|
||||
)
|
||||
string += vg_template.format(
|
||||
string += templates.ssd_volume_group.format(
|
||||
target='block.db',
|
||||
total_lv_size=str(self.total_ssd_size),
|
||||
total_lvs=vg_extents['parts'],
|
||||
@ -178,16 +154,16 @@ class MixedType(object):
|
||||
total_osds=len(self.hdds)
|
||||
)
|
||||
|
||||
string += osd_component_titles
|
||||
string += templates.osd_component_titles
|
||||
for osd in self.computed['osds']:
|
||||
string += osd_header_template
|
||||
string += osd_component_template.format(
|
||||
string += templates.osd_header
|
||||
string += templates.osd_component.format(
|
||||
_type='[data]',
|
||||
path=osd['data']['path'],
|
||||
size=osd['data']['human_readable_size'],
|
||||
percent=osd['data']['percentage'])
|
||||
|
||||
string += osd_component_template.format(
|
||||
string += templates.osd_component.format(
|
||||
_type='[block.db]',
|
||||
path='(volume-group/lv)',
|
||||
size=osd['block.db']['human_readable_size'],
|
||||
|
Loading…
Reference in New Issue
Block a user