Collect lsblk and /proc/mdstat with ramdisk logs
This should improve debugability of partitioning problems. Change-Id: I3c7ae3f2831c9900a3f0d24daec6dd6b8bea6a60
This commit is contained in:
parent
5e3153825a
commit
11976c9d2b
@ -288,6 +288,7 @@ def list_all_block_devices(block_type='disk',
|
||||
"version of block device name is unavailable "
|
||||
"Cause: %(error)s", {'path': disk_by_path_dir, 'error': e})
|
||||
|
||||
# NOTE(dtantsur): keep in sync with utils.LSBLK_COLUMNS
|
||||
columns = ['KNAME', 'MODEL', 'SIZE', 'ROTA', 'TYPE']
|
||||
report = utils.execute('lsblk', '-Pbia', '-o{}'.format(','.join(columns)),
|
||||
check_exit_code=[0])[0]
|
||||
|
@ -504,7 +504,8 @@ class TestUtils(testtools.TestCase):
|
||||
mock_gzip_b64.assert_called_once_with(
|
||||
file_list=[],
|
||||
io_dict={'journal': mock.ANY, 'ip_addr': mock.ANY, 'ps': mock.ANY,
|
||||
'df': mock.ANY, 'iptables': mock.ANY, 'lshw': mock.ANY})
|
||||
'df': mock.ANY, 'iptables': mock.ANY, 'lshw': mock.ANY,
|
||||
'lsblk': mock.ANY, 'mdstat': mock.ANY})
|
||||
|
||||
@mock.patch.object(utils, 'gzip_and_b64encode', autospec=True)
|
||||
@mock.patch.object(utils, 'is_journalctl_present', autospec=True)
|
||||
@ -525,7 +526,8 @@ class TestUtils(testtools.TestCase):
|
||||
mock_gzip_b64.assert_called_once_with(
|
||||
file_list=['/var/log'],
|
||||
io_dict={'iptables': mock.ANY, 'ip_addr': mock.ANY, 'ps': mock.ANY,
|
||||
'dmesg': mock.ANY, 'df': mock.ANY, 'lshw': mock.ANY})
|
||||
'dmesg': mock.ANY, 'df': mock.ANY, 'lshw': mock.ANY,
|
||||
'lsblk': mock.ANY, 'mdstat': mock.ANY})
|
||||
|
||||
def test_get_ssl_client_options(self):
|
||||
# defaults
|
||||
|
@ -52,12 +52,17 @@ LOG = logging.getLogger(__name__)
|
||||
AGENT_PARAMS_CACHED = dict()
|
||||
|
||||
|
||||
LSBLK_COLUMNS = ['KNAME', 'MODEL', 'SIZE', 'ROTA', 'TYPE', 'UUID', 'PARTUUID']
|
||||
|
||||
|
||||
COLLECT_LOGS_COMMANDS = {
|
||||
'ps': ['ps', 'au'],
|
||||
'df': ['df', '-a'],
|
||||
'iptables': ['iptables', '-L'],
|
||||
'ip_addr': ['ip', 'addr'],
|
||||
'lshw': ['lshw', '-quiet', '-json'],
|
||||
'lsblk': ['lsblk', '--all', '-o%s' % ','.join(LSBLK_COLUMNS)],
|
||||
'mdstat': ['cat', '/proc/mdstat'],
|
||||
}
|
||||
|
||||
|
||||
@ -404,6 +409,7 @@ def collect_system_logs(journald_max_lines=None):
|
||||
the journald. if None, return everything.
|
||||
:returns: A tar, gzip base64 encoded string with the logs.
|
||||
"""
|
||||
LOG.info('Collecting system logs and debugging information')
|
||||
|
||||
def try_get_command_output(io_dict, file_name, command):
|
||||
try:
|
||||
|
5
releasenotes/notes/collect-more-8bc9ad4c63e873e1.yaml
Normal file
5
releasenotes/notes/collect-more-8bc9ad4c63e873e1.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
other:
|
||||
- |
|
||||
The output of ``lsblk`` and the contents of ``/proc/mdstat`` are now
|
||||
collected with the ramdisk logs for debugging.
|
Loading…
Reference in New Issue
Block a user