[libvirt] Logging VM startup and shutdown

Daniel P. Berrange berrange at redhat.com
Tue Feb 1 17:23:56 UTC 2011


On Tue, Feb 01, 2011 at 08:45:41AM -0800, Ed Swierk wrote:
> When troubleshooting a libvirt system the most obvious question I face
> is when a given VM started and stopped.
> 
> The only way I've been able to obtain this information is by setting
> log_level = 1 in libvirtd.conf, which turns on the firehose,
> generating an enormous amount of output. I then have to sift through
> the logs for magic strings like "virExecWithHook" to see when a VM
> started, and "Shutting down VM" to see when a VM stopped. Is there no
> concise message that indicates a VM starting up? "virExecWithHook"
> doesn't exactly jump out.
> 
> I'd consider starting up and shutting down a VM to be at least worth
> an info-level message in the log. I monkeyed with the log_filters
> setting but I couldn't figure out how to filter those two strings. Any
> hints?

In latest libvirt we write to the audit logs when a VM starts or
stop, and upon hotplug of nics & disks (see /var/log/audit/audit.log)

Daniel




More information about the libvir-list mailing list