Translate

Tuesday, 19 November 2013

Releasing SAN data locks

Normally when a server opens a LUN it sets a lock-reserve, and it is released again when the servers is shutdown, or failed-over in a cluster. If your server crashes, or there is a problem with your SAN link this flag may have to be cleared manually.

Checking the status of your SAN flags:

# devrsrv -c query -l hdisk14

Device Name                     :  hdisk14
Device Open On Current Host?    :  NO
ODM Reservation Policy          :  NO RESERVE
Device Reservation State        :  NO RESERVE
Device Reservation State Information


To check all your LUNs:

# lspv | awk '{print $1}' | while read D
> do
> devrsrv -c query -l $D
> done


The above example shows a healthy LUN that is not in use. If it is active you will see:

Device Open On Current Host?    :  YES

If a host has crashed, or there is a faulty lock you may see:

Device Name                     :  hdisk10
Device Open On Current Host?    :  NO
ODM Reservation Policy          :  NO RESERVE
Device Reservation State        :  NO RESERVE
Already reserved through SINGLE PATH by other host
Device Reservation State Information

In this case you need to forceably break the lock as follows:

#  devrsrv -c release -l hdisk10
or
# devrsrv -f -l hdisk10

Once the lock has been released you should be able to access the LUN.

If this is a VIOS server ensure that the attribute is permanently set as follows:

$ chdev -dev hdisk11 -attr reserve_policy=no_reserve -perm

The shutdown and power-off your clients, and then do the same with the VIOS, and restart the clients. Powering-off ensures your partition profiles are correct, and also forces a log-out/in of the SAN/Switch.


No comments:

Post a Comment