Ejemplo n.º 1
0
    def report_pretty(self):
        string = ""
        if self.args.filtered_devices:
            string += templates.filtered_devices(self.args.filtered_devices)
        string += templates.total_osds.format(total_osds=self.total_osds)

        string += templates.ssd_volume_group.format(
            target='journal',
            total_lv_size=str(self.total_available_journal_space),
            total_lvs=self.journals_needed,
            block_db_devices=', '.join([d.path for d in self.ssds]),
            lv_size=str(self.journal_size),
            total_osds=self.journals_needed)

        string += templates.osd_component_titles

        for osd in self.computed['osds']:
            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 += templates.osd_component.format(
                _type='[journal]',
                path=osd['journal']['path'],
                size=osd['journal']['human_readable_size'],
                percent=osd['journal']['percentage'],
            )

        print(string)
Ejemplo n.º 2
0
    def report_pretty(self, filtered_devices):
        string = ""
        if filtered_devices:
            string += templates.filtered_devices(filtered_devices)
        string += templates.total_osds.format(total_osds=self.total_osds)
        string += templates.osd_component_titles

        for osd in self.computed['osds']:
            string += templates.osd_header
            if 'osd_id' in osd:
                string += templates.osd_reused_id.format(id_=osd['osd_id'])
            string += templates.osd_component.format(
                _type='[data]',
                path=osd['data']['path'],
                size=osd['data']['human_readable_size'],
                percent=osd['data']['percentage'],
            )
            string += templates.osd_component.format(
                _type='[journal]',
                path=osd['journal']['path'],
                size=osd['journal']['human_readable_size'],
                percent=osd['journal']['percentage'],
            )

        print(string)
Ejemplo n.º 3
0
    def report_pretty(self, filtered_devices):
        string = ""
        if filtered_devices:
            string += templates.filtered_devices(filtered_devices)
        string += templates.total_osds.format(
            total_osds=self.total_osds
        )
        string += templates.osd_component_titles

        for osd in self.computed['osds']:
            string += templates.osd_header
            if 'osd_id' in osd:
                string += templates.osd_reused_id.format(
                    id_=osd['osd_id'])
            string += templates.osd_component.format(
                _type='[data]',
                path=osd['data']['path'],
                size=osd['data']['human_readable_size'],
                percent=osd['data']['percentage'],
            )
            string += templates.osd_component.format(
                _type='[journal]',
                path=osd['journal']['path'],
                size=osd['journal']['human_readable_size'],
                percent=osd['journal']['percentage'],
            )

        print(string)
Ejemplo n.º 4
0
    def report_pretty(self):
        string = ""
        if self.args.filtered_devices:
            string += templates.filtered_devices(self.args.filtered_devices)
        string += templates.total_osds.format(
            total_osds=self.total_osds
        )

        string += templates.ssd_volume_group.format(
            target='journal',
            total_lv_size=str(self.total_available_journal_space),
            total_lvs=self.journals_needed,
            block_db_devices=', '.join([d.path for d in self.ssds]),
            lv_size=str(self.journal_size),
            total_osds=self.journals_needed
        )

        string += templates.osd_component_titles

        for osd in self.computed['osds']:
            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 += templates.osd_component.format(
                _type='[journal]',
                path=osd['journal']['path'],
                size=osd['journal']['human_readable_size'],
                percent=osd['journal']['percentage'],
            )

        print(string)
Ejemplo n.º 5
0
    def report_pretty(self):
        string = ""
        if self.args.filtered_devices:
            string += templates.filtered_devices(self.args.filtered_devices)
        string += templates.total_osds.format(total_osds=self.total_osds, )
        string += templates.osd_component_titles

        for osd in self.computed['osds']:
            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'],
            )

        print(string)
Ejemplo n.º 6
0
    def report_pretty(self):
        string = ""
        if self.args.filtered_devices:
            string += templates.filtered_devices(self.args.filtered_devices)
        string += templates.total_osds.format(
            total_osds=self.total_osds,
        )
        string += templates.osd_component_titles

        for osd in self.computed['osds']:
            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'],
            )

        print(string)
Ejemplo n.º 7
0
    def report_pretty(self):
        vg_extents = lvm.sizing(self.total_available_db_space.b, parts=self.dbs_needed)
        db_size = str(disk.Size(b=(vg_extents['sizes'])))

        string = ""
        if self.args.filtered_devices:
            string += templates.filtered_devices(self.args.filtered_devices)
        string += templates.total_osds.format(
            total_osds=len(self.hdds) * self.osds_per_device
        )

        string += templates.ssd_volume_group.format(
            target='block.db',
            total_lv_size=str(self.total_available_db_space),
            total_lvs=vg_extents['parts'] * self.osds_per_device,
            block_lv_size=db_size,
            block_db_devices=', '.join([ssd.abspath for ssd in self.ssds]),
            lv_size=self.block_db_size or str(disk.Size(b=(vg_extents['sizes']))),
            total_osds=len(self.hdds)
        )

        string += templates.osd_component_titles
        for osd in self.computed['osds']:
            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 += templates.osd_component.format(
                _type='[block.db]',
                path=osd['block.db']['path'],
                size=osd['block.db']['human_readable_size'],
                percent=osd['block.db']['percentage'])

        print(string)
Ejemplo n.º 8
0
    def report_pretty(self):
        vg_extents = lvm.sizing(self.total_available_db_space.b, parts=self.dbs_needed)
        db_size = str(disk.Size(b=(vg_extents['sizes'])))

        string = ""
        if self.args.filtered_devices:
            string += templates.filtered_devices(self.args.filtered_devices)
        string += templates.total_osds.format(
            total_osds=len(self.hdds) * self.osds_per_device
        )

        string += templates.ssd_volume_group.format(
            target='block.db',
            total_lv_size=str(self.total_available_db_space),
            total_lvs=vg_extents['parts'] * self.osds_per_device,
            block_lv_size=db_size,
            block_db_devices=', '.join([ssd.abspath for ssd in self.ssds]),
            lv_size=self.block_db_size or str(disk.Size(b=(vg_extents['sizes']))),
            total_osds=len(self.hdds)
        )

        string += templates.osd_component_titles
        for osd in self.computed['osds']:
            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 += templates.osd_component.format(
                _type='[block.db]',
                path=osd['block.db']['path'],
                size=osd['block.db']['human_readable_size'],
                percent=osd['block.db']['percentage'])

        print(string)
Ejemplo n.º 9
0
    def report_pretty(self, filtered_devices):
        string = ""
        if filtered_devices:
            string += templates.filtered_devices(filtered_devices)
        string += templates.total_osds.format(total_osds=len(self.data_devs) *
                                              self.osds_per_device)

        if self.db_or_journal_devs:
            vg_extents = lvm.sizing(self.total_available_db_space.b,
                                    parts=self.dbs_needed)
            db_size = str(disk.Size(b=(vg_extents['sizes'])))

            string += templates.ssd_volume_group.format(
                target='block.db',
                total_lv_size=str(self.total_available_db_space),
                total_lvs=vg_extents['parts'] * self.osds_per_device,
                block_lv_size=db_size,
                block_db_devices=', '.join(
                    [ssd.abspath for ssd in self.db_or_journal_devs]),
                lv_size=self.block_db_size
                or str(disk.Size(b=(vg_extents['sizes']))),
                total_osds=len(self.data_devs))

        if self.wal_devs:
            wal_vg_extents = lvm.sizing(self.total_available_wal_space.b,
                                        parts=self.wals_needed)
            wal_size = str(disk.Size(b=(wal_vg_extents['sizes'])))
            string += templates.ssd_volume_group.format(
                target='block.wal',
                total_lv_size=str(self.total_available_wal_space),
                total_lvs=wal_vg_extents['parts'] * self.osds_per_device,
                block_lv_size=wal_size,
                block_db_devices=', '.join(
                    [dev.abspath for dev in self.wal_devs]),
                lv_size=self.block_wal_size
                or str(disk.Size(b=(wal_vg_extents['sizes']))),
                total_osds=len(self.data_devs))

        string += templates.osd_component_titles
        for osd in self.computed['osds']:
            string += templates.osd_header
            if 'osd_id' in osd:
                string += templates.osd_reused_id.format(id_=osd['osd_id'])
            string += templates.osd_component.format(
                _type='[data]',
                path=osd['data']['path'],
                size=osd['data']['human_readable_size'],
                percent=osd['data']['percentage'])

            if 'block.db' in osd:
                string += templates.osd_component.format(
                    _type='[block.db]',
                    path=osd['block.db']['path'],
                    size=osd['block.db']['human_readable_size'],
                    percent=osd['block.db']['percentage'])

            if 'block.wal' in osd:
                string += templates.osd_component.format(
                    _type='[block.wal]',
                    path=osd['block.wal']['path'],
                    size=osd['block.wal']['human_readable_size'],
                    percent=osd['block.wal']['percentage'])

        print(string)
Ejemplo n.º 10
0
    def report_pretty(self, filtered_devices):
        string = ""
        if filtered_devices:
            string += templates.filtered_devices(filtered_devices)
        string += templates.total_osds.format(
            total_osds=len(self.data_devs) * self.osds_per_device
        )

        if self.db_or_journal_devs:
            vg_extents = lvm.sizing(self.total_available_db_space.b, parts=self.dbs_needed)
            db_size = str(disk.Size(b=(vg_extents['sizes'])))

            string += templates.ssd_volume_group.format(
                target='block.db',
                total_lv_size=str(self.total_available_db_space),
                total_lvs=vg_extents['parts'] * self.osds_per_device,
                block_lv_size=db_size,
                block_db_devices=', '.join([ssd.abspath for ssd in
                                            self.db_or_journal_devs]),
                lv_size=self.block_db_size or str(disk.Size(b=(vg_extents['sizes']))),
                total_osds=len(self.data_devs)
            )

        if self.wal_devs:
            wal_vg_extents = lvm.sizing(self.total_available_wal_space.b,
                                        parts=self.wals_needed)
            wal_size = str(disk.Size(b=(wal_vg_extents['sizes'])))
            string += templates.ssd_volume_group.format(
                target='block.wal',
                total_lv_size=str(self.total_available_wal_space),
                total_lvs=wal_vg_extents['parts'] * self.osds_per_device,
                block_lv_size=wal_size,
                block_db_devices=', '.join([dev.abspath for dev in
                                            self.wal_devs]),
                lv_size=self.block_wal_size or str(disk.Size(b=(wal_vg_extents['sizes']))),
                total_osds=len(self.data_devs)
            )

        string += templates.osd_component_titles
        for osd in self.computed['osds']:
            string += templates.osd_header
            if 'osd_id' in osd:
                string += templates.osd_reused_id.format(
                    id_=osd['osd_id'])
            string += templates.osd_component.format(
                _type='[data]',
                path=osd['data']['path'],
                size=osd['data']['human_readable_size'],
                percent=osd['data']['percentage'])

            if 'block.db' in osd:
                string += templates.osd_component.format(
                    _type='[block.db]',
                    path=osd['block.db']['path'],
                    size=osd['block.db']['human_readable_size'],
                    percent=osd['block.db']['percentage'])

            if 'block.wal' in osd:
                string += templates.osd_component.format(
                    _type='[block.wal]',
                    path=osd['block.wal']['path'],
                    size=osd['block.wal']['human_readable_size'],
                    percent=osd['block.wal']['percentage'])

        print(string)