Search This Blog

Thursday, April 7, 2011

How to find crashed,blue dumped machines in Oracle VM.

With VM environment consisting of more than 500 virtual machines,You may find this helpful .

It might not be possible to observe each and every virtual machines to find instances of crashed machines (Such as Hanged,Blue dumped Machines).

Well with little bit of observation you can find such machines .
Below script helped me find out more than 10-15 crashed machines.
The trick is simple : You need to get the number of running machines and then compare their harddisk's modified date (System.img file specified in vm.cfg file) against Current date.
If you found any machines having Harddisk not modified on current date and still its running You are pretty sure it has some problem.

Executed below script on each VM machine and observed the output.

First of List all the running machines and store it in file called machine


xm list | awk '{print $1}' > machine

while read line
#ls -ltr `find /var/ovs/mount/ -name $line` >> log
#find /var/ovs/mount/ -type f -name $line | sed "s#^.#$(pwd)#" > log
find `find /var/ovs/mount/ -name $line -type d` -name *.img -type f >> log
done < machine

while read line
ls -ltr $line
done < log

No comments:

Post a Comment