UPDATE : I updated this post with a new information about devscan tool, which *should* work on AIX 5.3 and later AIX releases, and I added AIX 6.1TL7 support for devrsrv tool

When you change the reserve_policy on a hdisk with a PR_exclusive policy, like this :

 # lsattr -El hdisk0 -a reserve_policy

reserve_policy PR_exclusive Reserve Policy True

# chdev -l hdisk0 -a reserve_policy=no_reserve -P 

You have to reboot to enable the new attribute. But as it is already changed in the ODM, if you don’t reboot right away and wait for some reasons, you may forget your action.

When you come back a month later on your server and check the attributes of hdisk0, you can see that it’s already  set to no_reserve… but you don’t know if the change is effective or not.

If you need to migrate your LPAR via LPM, the validation process won’t detect the lock on the disk… And your migration will start but will crash with a nice « 2005 » led code on both pseries , which means that a drmgr operation is pending (and in our case, will never end).

So, as nothing (until recently with the devrsrv command) is designed to verify the lock in an easy way, there’s some workarounds you need to know :

With devrsrv (AIX 6.1 TL7 and later):

# devrsrv -c query -l hdisk0
Device Reservation State Information
==================================================
Device Name : hdisk0
Device Open On Current Host? : NO
ODM Reservation Policy : SINGLE PATH RESERVE
Device Reservation State : NO RESERVE

With KDB, starting with AIX 6.1:

First you need to isolate the disk type’s id (the first two digits) :

 # echo lke | kdb | grep pcm
59 F1000000A063A000 05A80000 00030000 02080242 /usr/lib/drivers/aixdiskpcmke

Run lke -s on the slot number (in the above ouput 59) and take the le_data value and feed it into the adevq command :

 # echo "lke -s 59" | kdb | grep le_data
  le_data........ 0000000005AA0000   le_datasize.... 0000000000002808
 # echo "adevq 0000000005AA0000" | kdb|grep reserve_flags
    int reserve_flags = 0x0

With AIX 5.3 :

I didn’t find any easy way to check that, if somebody has an answer… I will gladly add it to this post …

There is the devscan tool , really handy tool , but use it with caution :

 # devscan -t f -c9 | egrep "hdisk|Reserv"
You have specified a flag which can potentially cause a state change
to a device on the SAN. You should consider this equivalent to running
cfgmgr, except that devscan cannot cause any changes to the ODM. Are
you sure you wish to continue?
y/[n] : y

Copyright (C) 2010-2012 IBM Corp., All Rights Reserved
 PR IN Read Reservation failed with errno EIO
 PR IN Read Reservation got SCSI status:
 Name: hdisk16 Path: 0
 No Reservation held
 Name: hdisk2 Path: 0
 No Reservation held
 Name: hdisk3 Path: 0
 No Reservation held
 No Reservation held
 Name: hdisk7 Path: 3
 No Reservation held
 Name: hdisk8 Path: 3
 No Reservation held
 Name: hdisk9 Path: 3
 No Reservation held
 Name: hdisk10 Path: 3
 No Reservation held
 No Reservation held
 Name: hdisk7 Path: 4
 No Reservation held
 Name: hdisk8 Path: 4
 No Reservation held
 Name: hdisk9 Path: 4
 No Reservation held
 Name: hdisk10 Path: 4
 No Reservation held
 No Reservation held
 Name: hdisk1 Path: 0
 No Reservation held
 Name: hdisk1 Path: 1
 Reservation Conflict (sense key: (0x00) NO_SENSE; ASCQ: (0x0000)
 Reservation Conflict (sense key: (0x00) NO_SENSE; ASCQ: (0x0000)
 PR IN Read Reservation failed with errno EIO
 PR IN Read Reservation got SCSI status:
 Reservation Conflict (sense key: (0x00) NO_SENSE; ASCQ: (0x0000)
 Reservation Conflict (sense key: (0x00) NO_SENSE; ASCQ: (0x0000)
 Reservation Conflict (sense key: (0x00) NO_SENSE; ASCQ: (0x0000)
 Reservation Conflict (sense key: (0x00) NO_SENSE; ASCQ: (0x0000)

Links

devscan tool

Share Button
Checking SCSI reservation on your disks
Taggé sur :    

2 thoughts on “Checking SCSI reservation on your disks

Laisser un commentaire