Exemple #1
0
    def get_osd_lvm_info(self):
        if not self.ceph_volume_lvm_list:
            return

        ceph_osds = self.services.get("ceph-osd")
        if not ceph_osds:
            return 0

        f_ceph_volume_lvm_list = mktemp_dump('\n'.join(
            self.ceph_volume_lvm_list))
        s = FileSearcher()
        sd = SequenceSearchDef(start=SearchDef(r"^=+\s+osd\.(\d+)\s+=+.*"),
                               body=SearchDef([
                                   r"\s+osd\s+(fsid)\s+(\S+)\s*",
                                   r"\s+(devices)\s+([\S]+)\s*"
                               ]),
                               tag="ceph-lvm")
        s.add_search_term(sd, path=f_ceph_volume_lvm_list)
        info = {}
        for results in s.search().find_sequence_sections(sd).values():
            _osd_id = None
            _info = {}
            for result in results:
                if result.tag == sd.start_tag:
                    _osd_id = int(result.get(1))
                elif result.tag == sd.body_tag:
                    if result.get(1) == "fsid":
                        _info["fsid"] = result.get(2)
                    elif result.get(1) == "devices":
                        _info["dev"] = result.get(2)

            info[_osd_id] = _info

        os.unlink(f_ceph_volume_lvm_list)
        return info
Exemple #2
0
 def __init__(self):
     super().__init__()
     out = cli_helpers.get_ovs_appctl_dpctl_show("system@ovs-system")
     self.f_dpctl = mktemp_dump(''.join(out))
     bridges = cli_helpers.get_ovs_vsctl_list_br()
     self.ovs_bridges = [br.strip() for br in bridges]
     self.sequence_defs = []
Exemple #3
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     out = cli_helpers.get_rabbitmqctl_report()
     # save to file so we can search it later
     self.f_report = mktemp_dump(''.join(out))
     self.searcher = FileSearcher()
     self.resources = {}
Exemple #4
0
    def _get_journalctl_l3_agent(self):
        if not constants.USE_ALL_LOGS:
            date = cli_helpers.get_date(format="--iso-8601").rstrip()
        else:
            date = None

        out = cli_helpers.get_journalctl(unit="neutron-l3-agent", date=date)
        self.f_journalctl = mktemp_dump(''.join(out))
Exemple #5
0
    def get_osd_rss(self, osd_id):
        """Return memory RSS for a given OSD.

        NOTE: this assumes we have ps auxwwwm format.
        """
        ceph_osds = self.services.get("ceph-osd")
        if not ceph_osds:
            return 0

        f_osd_ps_cmds = mktemp_dump('\n'.join(ceph_osds['ps_cmds']))

        s = FileSearcher()
        # columns: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
        sd = SearchDef(r"\S+\s+\d+\s+\S+\s+\S+\s+\d+\s+(\d+)\s+.+/ceph-osd\s+"
                       r".+--id\s+{}\s+.+".format(osd_id))
        s.add_search_term(sd, path=f_osd_ps_cmds)
        rss = 0
        # we only expect one result
        for result in s.search().find_by_path(f_osd_ps_cmds):
            rss = int(int(result.get(1)) / 1024)
            break

        os.unlink(f_osd_ps_cmds)
        return rss
Exemple #6
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.neutron_phy_ports = []
     out = cli_helpers.get_ip_link_show()
     self.f_ip_link_show = mktemp_dump(''.join(out))