Bug 1334674
| Summary: | Issue warnings, errors and status per object from lvm2 command line tools via report | ||
|---|---|---|---|
| Product: | [Community] LVM and device-mapper | Reporter: | Peter Rajnoha <prajnoha> |
| Component: | lvm2 | Assignee: | Peter Rajnoha <prajnoha> |
| lvm2 sub component: | Displaying and Reporting | QA Contact: | cluster-qe <cluster-qe> |
| Status: | CLOSED UPSTREAM | Docs Contact: | |
| Severity: | low | ||
| Priority: | medium | CC: | agk, heinzm, jbrassow, msnitzer, prajnoha, zkabelac |
| Version: | unspecified | Flags: | prajnoha:
lvm-technical-solution+
rule-engine: lvm-test-coverage? |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-08-24 08:40:05 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 1334655 | ||
| Bug Blocks: | 1334678, 1334682, 1346079 | ||
|
Description
Peter Rajnoha
2016-05-10 10:04:59 UTC
LVM2 supports so called "log report" since lvm2 2.02.158. There are several new configuration settings and command line options to support this feature:
- log/report_command_log lvm.conf setting to enable/disable log report
- log/command_log_{cols,sort} to set fields reported in log report
- log/command_log_selection" lvm.conf setting to define automatic selection used for log report
For more information, see "man 7 lvmreport".
Example:
[0] rhel7-a/~ # lvmconfig --type diff
report {
compact_output=1
}
log {
report_command_log=1
command_log_selection="all"
}
(reporting command - the command log is appended to lvs main report)
[0] rhel7-a/~ # lvs
Logical Volume
==============
LV VG Attr LSize
root rhel -wi-ao---- 9.02g
swap rhel -wi-ao---- 500.00m
Command Log
===========
Seq LogType Context ObjType ObjName ObjID ObjGrp ObjGrpID Msg Errno RetCode
1 status processing lv root yWDUvw-9zpE-n2EI-TeoN-POzW-3wHt-B4uDpX rhel LDTYQz-81Zb-qwBC-Arek-EZ3t-Qnjd-Yu4yWT success 0 1
2 status processing lv swap JcSyXd-KByX-2sKE-QDuQ-T10R-Q5kI-mn8OcA rhel LDTYQz-81Zb-qwBC-Arek-EZ3t-Qnjd-Yu4yWT success 0 1
3 status processing vg rhel LDTYQz-81Zb-qwBC-Arek-EZ3t-Qnjd-Yu4yWT success 0 1
(non-reporting command - there's only log report)
[0] rhel7-a/~ # vgcreate vg /dev/sda
Command Log
===========
Seq LogType Context ObjType ObjName ObjID ObjGrp ObjGrpID Msg Errno RetCode
1 status processing pv /dev/vda2 2cBtQX-IKw0-vsJi-ZLB3-pUfS-w48b-2kA4H9 rhel LDTYQz-81Zb-qwBC-Arek-EZ3t-Qnjd-Yu4yWT success 0 1
2 status processing vg rhel LDTYQz-81Zb-qwBC-Arek-EZ3t-Qnjd-Yu4yWT success 0 1
3 status processing orphan lvm1 success 0 1
4 status processing orphan pool success 0 1
5 status processing pv /dev/sda XEP0SI-mFGo-C1UT-WvaF-UYIw-5ZfL-DLGWB1 success 0 1
6 status processing orphan lvm2 success 0 1
7 print processing Volume group "vg" successfully created 0 0
(changing log/command_log_selection back to default command_log_selection = "!(log_type=status && message=success)" - so we don't display "success", just error states)
[0] rhel7-a/~ # lvmconfig --type diff
report {
compact_output=1
}
log {
report_command_log=1
}
[0] rhel7-a/~ # lvs
Logical Volume
==============
LV VG Attr LSize
root rhel -wi-ao---- 9.02g
swap rhel -wi-ao---- 500.00m
Command Log
===========
Seq LogType Context ObjType ObjName ObjID ObjGrp ObjGrpID Msg Errno RetCode
[0] rhel7-a/~ # lvs vg/i_dont_exist
Command Log
===========
Seq LogType Context ObjType ObjName ObjID ObjGrp ObjGrpID Msg Errno RetCode
1 error processing lv i_dont_exist vg Hafilo-sFEy-vLz0-bLk7-vvPs-UmsF-hcF13b Failed to find logical volume "vg/i_dont_exist" -1 0
2 status processing lv i_dont_exist vg Hafilo-sFEy-vLz0-bLk7-vvPs-UmsF-hcF13b failure -1 5
3 status processing vg vg Hafilo-sFEy-vLz0-bLk7-vvPs-UmsF-hcF13b failure -1 5
[0] rhel7-a/~ # lvmconfig --type diff
report {
compact_output=1
}
log {
report_command_log=1
command_log_cols="log_type,log_context,log_object_type,log_object_name,log_message"
}
[0] rhel7-a/~ # lvs vg/i_dont_exist
Command Log
===========
LogType Context ObjType ObjName Msg
error processing lv i_dont_exist Failed to find logical volume "vg/i_dont_exist"
status processing lv i_dont_exist failure
status processing vg vg failure
|