Occasionally VM instance reboot in an unplanned way and triggers alert, usually this is due to hardware or software issue on physical machine hosting the VM that causes the VM to crash.
From last reboot
will see reboot records, or who -b
displaying last time reboot info.
For CentOS/RHEL systems, you’ll find the logs at /var/log/messages
while for Ubuntu/Debian systems, its logged at /var/log/syslog
.
1 | # exclude irrelevant info |
From the command output above, skim /var/log/messages
file around the timestamp, output example:
1 | May 3 23:31:52 xxxxx systemd: Started Update UTMP about System Boot/Shutdown. |
I see the reboot was caused by Shutdown Scripts
, further check the VM instance log or StackDriver log (if on public cloud platform, check platform log system is more convenient than ssh to checking VM log), get error:
1 | compute.instances.hostError |
Then it was clear, What happened with host error?