Monday, May 28, 2012

How to track allocated resource in NIM, reset and deallocate resouces

If a resource is allocated to any client in NIM and you want to delete or change resource you get this type of message:

lparx:/ # nim -o remove -arm_image=yes master_mksysb
0042-001 nim: processing error encountered on "master":
   0042-061 m_rmbosi: the "master_mksysb" resource is currently
        allocated for client use

To check whether resource is allocated:
lsnim -l -t mksysb | egrep ":|alloc_count"|grep -v date
lsnim -l -t lpp_source| egrep ":|alloc_count"|grep -v date
lsnim -l -t spot| egrep ":|alloc_count"|grep -v date

To reset and deallocate resources from all machines run this script:
for i in `lsnim -c machines | awk '{print $1}'`
do
    nim -o reset -a force=yes $i
    RC=$?
    if [ $RC -eq 0 ] ; then
        nim -Fo deallocate -a subclass=all $i
    fi
done

1 comment: