-
Notifications
You must be signed in to change notification settings - Fork 75
Add support for ESXI auth, hostd and shell logs. #1385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #1385 will not alter performanceComparing Summary
|
| ) | ||
|
|
||
|
|
||
| class EsxiLogBasePlugin(Plugin, ABC): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind changing this around to a more functional approach, rather than ABC? So e.g. a function in the global scope find_logs(target: Target, name: str) or something like that. As well the parser code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. Let me know if it's OK for you
| """Esxi base log plugin.""" | ||
|
|
||
| __register__ = False | ||
| COMMON_LOG_LOCATION: ClassVar[list[str]] = ["/var/log", "/var/run/log", "/scratch/log", "/var/lib/vmware/osdata"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this mostly redundant? As far as I know, basically all of these symlink to the same location (the OSDATA volume). Taking just /var/log should be enough?
Also the reason why I mention that the osdata_fs internal is unnecessary, as it should already be properly symlinked by the OS plugin and available/resolvable through the symlinks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take a deeper look, but it's maybe challenging to have something working for old and new storage format : https://www.vmware.com/docs/esxi-system-storage-changes
Furthermore I also want the plugins to work with uac and tech support, in addition to disk (I'm not aware of another use case).
Basically after storage change the structure on a live system is the following for ESXi 7+ (tested on ESXi 8 and 9, I must find an ESXi 7 for test
/scratch -> symlink to the osdata volume (/vmfs/volume/OSDATA-XXX)
/var/run/log -> symlink to /scratch/log (so with transitivity to /vmfs/volume/OSDATA-XXX/log
/var/log -> some file (file by file, not the whole folder) are symlink to /var/run/log, but this folder does not contains compressed log file (e.g symlink for auth.log but not auth.0.gz)
- But when working with tech support, log are located only in /var/run/log
- And when working with UAC collection, log are in /scratch/log (with symlink from /var/log/auth.log)
I have checked on UAC from ESXi 6 and 7, log were also on /scratch/log
Maybe I should modify the loader to create osdata symlink to /scratch (and from /var/run/log to /scratch/log) when working with raw disk or equivalent but we would still have an issue with either UAC or tech support (or we should at least check both location?)
I will make more test next week
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made some modification to create a symlink from osdata to /scratch if it doesn't exist, I will test it with older version next week and let you know when it's OK.
|
I have modified symlink made by ESXi, especially related to OS data partition detection. Thus this plugin no longer need to identify OSdata volume. @Schamper let me know if it's OK for you; I can send the 3 disk if you want, with associated uac and techsupport TLDR :
DetailsWith a slightly modified version of target info that display volume offset + vmfs label + if volume is an lvm if available Freshly installed ESXI 8 Freshly installed ESXI 9 Freshly installed ESXI 6 On the same ESXi 6, result of an ls on '/' from the live system. |
|
The more I dig into the code, the more issues I find.
I think that these issue should be processed in dedicated issue, but maybe you prefer to fix these issue here. |
|
I Will try to fix the ESXi PLugins in a dedicated PR next week, especially regarding symlink of logs folder, for disk and live collection : uac/vmsupport/ acquire? (not sure I will have time to generate a live collection with this one). |
Add support for three ESXi logs with related test data from ESXi 6/7/8/9:
I may take a look on some others files later (vodb, vmk*, vpxa...) but it may be easier to validate the structure before adding more files. I'm not sure the plugin inheritance is the best solution, but if each log type is just an entry of the same plugins, is that we can't have a
check_compatiblefunction by log type.One of the main problems is that even if most files seems to have the same format, some small differences exists (e.g in shell.log). Regarding plugins name I'm not really sure how to work with name conflict (eg : auth).
Regarding log file location, as it may change regarding version and how log were collected (ESXi does some weird thing with symlinks) plugins look for usual location, as well as in the osdata partition.
Log location may also be found in the
/etc/vmsyslog.confbut I have not implemented, neither worked on how it works.Furthermore :
This issue partially resolve #1218