On Wed, 26 Jul 2006, Birger Blixt wrote:

>> Here are the tricky parts (Only 45 slots reported today - one magazine is 
>> out)
>>
>>    Storage Changer /dev/sg16:2 Drives, 45 Slots ( 2 Import/Export )
>> Data Transfer Element 0:Full (Storage Element 1 Loaded):VolumeTag = ALOW0026
>> Data Transfer Element 1:Full (Storage Element 9 Loaded):VolumeTag = ALOW0039
>> ...
>>        Storage Element 41:Full :VolumeTag=AMED0042
>>        Storage Element 42:Full :VolumeTag=AMED0041
>>        Storage Element 43:Empty
>>        Storage Element 44 IMPORT/EXPORT:Empty
>>        Storage Element 45 IMPORT/EXPORT:Empty
>>
>> The mailslots are designated IMPORT/EXPORT and it seems to be a simple
>> parsing issue.
>>
>> I'm not sure if the report of which barcode is in which drive is being
>> used. Kern?

> I wrote a script that check for tapes in the IMPORT/EXPORT slot, and take care
> of that by just talking to mysql, and bacula will then know that the tape is
> InChanger and which slot.

There is a problem:

When a tape is loaded directly into a drive from a mailslot, some changers 
classify it as "unknown"

EG:

   Storage Changer /dev/sg16:2 Drives, 45 Slots ( 2 Import/Export )
Data Transfer Element 0:Empty
Data Transfer Element 1:Full (Storage Element 26 Loaded):VolumeTag = ALOW0056
       Storage Element 1:Full :VolumeTag=ALOW0026
       Storage Element 2:Full :VolumeTag=ALOW0027
...
       Storage Element 43:Full :VolumeTag=ALOW0058
       Storage Element 44 IMPORT/EXPORT:Full :VolumeTag=ALOW0040
       Storage Element 45 IMPORT/EXPORT:Full :VolumeTag=ALOW0041

$  mtx -f /dev/sg16 load 44 0

$  mtx -f /dev/sg16 status

   Storage Changer /dev/sg16:2 Drives, 45 Slots ( 2 Import/Export )
Data Transfer Element 0:Full (Unknown Storage Element Loaded):VolumeTag = 
ALOW0041
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Data Transfer Element 1:Full (Storage Element 26 Loaded):VolumeTag = ALOW0056
       Storage Element 1:Full :VolumeTag=ALOW0026
       Storage Element 2:Full :VolumeTag=ALOW0027
.
       Storage Element 44 IMPORT/EXPORT:Full :VolumeTag=ALOW0040
       Storage Element 45 IMPORT/EXPORT:Empty

This completly breaks "update slots", because "mtx-changer loaded" will 
tell Bacula there is no tape at all in drive 0. Needless to say the 
cascade effects (subsequent MTX calls dying when bacula attempts to load 
tapes) and job failures are not nice.

> On my changer, an incoming tape is marked IMPORT/EXPORT:Full , but an outgoing
> tape has also the volumetag.

That is because you don't have a barcode reader.

This is also why you need the inventory command instead of just using "status"

> I make it simple and never remove any magazines, and have only one mailslot, 
> so
> I can do:

That is only an option for small backup sets - it doesn't scale up to 
multiple mailslots or magazine changes - which even small site admins tend 
to do as feeding 15 tapes into a library one at a time is extremely 
tedious.

> I have a pool for Offline tapes (PoolId=8), where the script check for tapes 
> in
> that pool, and if InChanger=1 .

Not really needed anymore, as the pool checks properly handle inchanger or 
not (for the most part)

> What I need is some daemon that can catch a status from the changer when the
> mailslot is opened/closed, now I must run my script in a loop and then go to 
> the
> changer and remove/insert tapes.

Polling would do it.

Be aware that MTX may be activated by 3rd party programs, so that needs to 
be taken into account too.

Additionally, some changers require _2_ status calls to return the 
IMPORT/OUTPUT slots in normal operations after an open-door action - the 
first pass simply ends at the last slot line.

I have seen simlar behaviour with 500 slot CD changers too - in that case 
MTX only returned the first 64 slots after the cabinet door was closed, 
requiring a second call to see the full 500.

> I still need to run mtx inventory to update the slots/volume list, but I never
> run any scan from bacula since the mysql-database knows whats in the changer.

Inventory is not needed if barcodes are used, so the scripts need to 
handle that.

In all likelihood, a non-recognised tape in a barcode-using library has a 
bad label and should be isolated, instead of inventoried (odds are high 
that if not labelled, it's probably blank and the inventory action itself 
may well cause a running bacula job to abort if it pulls a tape out of a 
drive currentrly in use)

AB

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to