Determining when a guest booted / how long it's been running

wferi at niif.hu wferi at niif.hu
Thu Oct 1 17:16:49 UTC 2020


Digimer <lists at alteeve.ca> writes:

> I did find a way to do it working around virsh, but of course I'd
> prefer to directly query the source instead of infering it if possible.

Speaking about other possible workarounds, what about watching the
/var/log/libvirt/qemu/*.log files (assuming you use the QEMU driver)?
Those contain timestamps of QEMU startups (and other info).  Or if
you've got systemd around, "machinectl status" prints the start time of
a given VM.  If you don't want to mistake live migrations for fresh
startups, more careful log analysis will be needed, though.  And your
current solution may still be the best for your exact purpose, of
course.
-- 
Regards,
Feri




More information about the libvirt-users mailing list