[Linux-HA] Cleaning up orphan resources

Michael Schwartzkopff misch at multinet.de
Sat Dec 1 08:16:38 MST 2007


Hi,

playing with Linux-HAv2 I experienced a lot of orphan resources in the
CIB after a while. So beeing lazy looking for these resources and
deleting them manually I wrote a little script that does the job.
Perhaps other people might find it useful also.

--- cut here

#!/bin/bash
/usr/sbin/crmadmin --nodes | awk '/normal node:/ {print $3}' | while
read node ; do
        /usr/sbin/crm_verify -LV 2>&1 | awk '/orphan_resource/ {print
$9}' | while read res ; do
                echo "Cleaning up resource $res on node $node"
                /usr/sbin/crm_resource -C -r $res -H $node
        done
done

Michael.


More information about the Linux-HA mailing list