From 29 of those LPAR’s all you will get is that the device is varied off and any attempts to vary on will fail. From one LPAR you will be able to see the device is varied on and possibly in use. I gather your question is about how to determine which one without checking each LPAR in succession.
As mentioned by pdraebel, DSPTAPCTG on each LPAR and combining the output will tell you, but here is an idea that will require a bit of development:
You create two commands, ALCDEV & DLCDEV. ALCDEV will attempt to vary on the tape device and allocate the *DEVD, and it should have an optional parameter for wait time, and continually retry the vary on until it succeeds or times out. If successful you then record the system name in a central point somewhere (host LPAR?) via a DDM file or some other mechanism. DLCDEV will reverse all that, release the lock & vary the device off again then blank the system name record.
You then need to get to each process on all 30 LPARs that use the tape library and add the ALCDEV & DLCDEV commands before & after.
(a) The 30 LPARs should then be a bit more friendly about sharing the device, and (b) if any conflicts you only need to look in one place to know which is the offending LPAR.
We have something similar for sharing the tape between two LPARs, but didn’t need the central repository because it always had to be the other LPAR. I can get you source for the commands if needed, but you are on your own with your backup procedures.