Understanding Barcodes and MediaIDs

Article: 100048567
Last Published: 2020-10-09
Ratings: 3 0
Product(s): Appliances, NetBackup & Alta Data Protection

NetBackup references tapes via a mediaid, this is derived from the physical barcode of the tape.

Barcodes should be 8 characters, with the last two denoting the media generation, eg L2 = LTO2  (ANSI MH10.8M-1983)

NOTE: Some libraries actually use the last two characters to identify media generation/ type, eg. LTO2 or LTO3 and will refuse to move a tape if it finds a ‘incompatible’ barcode for the drive type (eg. LTO vs STK T10000)

The library however, controls how many characters of the barcode is presented to NetBackup – this would be seen during an Inventory, or in the output of robtest -  for example the s s command.

Consider a LTO barcode that has 8 characters:

AB1234L7 - this is made up of a six character barcode (AB1234) followed by a two character media type ID (L7)

Most libraries have the ability to mask characters in the barcode, for example on Quantum libraries:

This controls how the barcode is displayed in NetBackup, for example :

All characters - AB1234L7
First 6 characters - AB1234
Last 6 characters – 1234L7

The mediaID used by NetBackup to reference tape media, is derived from the barcode presented by the robot.  This is controlled by the mediaID ID Generation rule which is defined in ...volmgr/vm.conf and has the format

MEDIA_ID_BARCODE_CHARS = <robot number>  <number characters in barcode>  <position of characters to define mediaid>

MEDIA_ID_BARCODE_CHARS = 0 8 1:2:3:4:5:6

Barcode         Rule                     Resulting mediaID

AB1234L7     0 8 1:2:3:4:5:6      AB1234
AB1234L7     0 8 3:4:5:6:7:8      1234L7
AB1234         0 8 1:2:3:4:5:6      AB1234
1234L7          0 8 1:2:3:4:5:6     1234L7

The mediaID is created when a inventory of the robot/ library is run.  When the tape is labelled, the mediaID is written to the 'NetBackup Tape Header' which is 1k in size, at the very beginning of the tape.  Whenever the tape is mounted by NetBackup, the tape header is read and a check is made that the mediaID written on the tape matches the mediaID of the tape requested.

Problems arise when a mis-match is detected during the mounting of media, for example.

Media mounted has media id of AB1234, but 1234L7 was requested

Here, the mediaID written to the tape is AB1234, but NetBackup was expecting a tape with mediaID 1234L7.  There are a couple of likely possibilities as to how this happened.

1.  The tape was moved from a different environment where the presented barcode and media ID generation rule resulted in the mediaID AB1234.  For example the barcode could be AB1234L7 and the mediaID generation rule 1:2:3:4:5:6

The new environment has a combination of the presented barcode and mediaID generation rule that results in a different mediaID, for example, the barcode might be presented as the last six characters, so even if the mediaID generation rule was the same, the resulting mediaID could only be 1234L7.

To investigate this issue, the settings on the robots between the two environments that define the presented barcode, and the mediaID generation rules need to be investigated.

If the barcode presented by the library changes, NetBackup considers this a new tape, which leads to another possibility.

2.  The library settings were changed to present the barcode differently, or a robot firmware upgrade/ hardware replacement has reset back to defaults.

For example:

Barcode      MediaID Rule       Resulting mediaID

1234L7       1:2:3:4:5:6             1234L7

After an 'event', the presented barcode changes to all 8 characters

AA1234L7   1:2:3:4:5:6            AA1234

When the library is next inventoried, NetBackup will see a new barcode and consider this a new tape.  This new tape will be added to the NetBackup configuration with mediaID AA1234.  However, it is the same tape as that with mediaID 1234L7.  Hence, when mediaID AA1234 is requested, a mismatch will be detected as it already contains a tape header with the different mediaID 1234L7.

There are numerous possibilities of this type of error, but as previously mentioned, investigation of the 'presented' barcode by the library, mediaID generation rule and history of the issue should determine the cause.

Consideration should also be given to system// environment design.

If for example you had two NetBackup environments with identical presented barcodes/ mediaID generation rules as follows, but the leading two characters of the barcode were different, but the numerical characters the same.

Presented Barcode of all 8 characters, mediaID rule of 3:4:5:6:7:8

Environment 1

Barcode         mediaID
AA0001L7        0001L7
AA0002L7        0002L7
AA0003L7        0003L7


Environment 2

BB0001L7        0001L7
BB0002L7        0002L7
BB0003L7        0003L7

Here, although we clearly have six different tapes, it would be impossible to move these between environments as the mediaIDs are the same.  This issue could be avoided by ensuring that either the leading two characters were part of the mediaID, or using different numerical ranges between the two environments.

Another issue seen is when you have an error similar to this:

Media mounted has media id of AB1234, but AB8687 was requested

Here, the tapes are clearly different, and there is no combination of presented barcode or mediaID generation rule settings that could cause such a change.  In this case, either the robot has loaded the wrong tape, or the physical barcode on the tape has been changed since the media was last used/ labelled.

 

Example case:
 
A tape has a barcode of BB0034L5, it was originally used on a previous environment, and has a mediaID of 0034L5 (first 6 characters)
 
It is required to import the tape on a new environment, but here the configuration uses the first 6 characters of the barcode as the mediaID.
 
When added into the library and inventoried, the new system will add the tape as the barcode is unknown, but with the mediaID BB0034
 
The import of the tape will fail as the mediaID written to the tape header (0034L5) is different to what NetBackup is now expecting (BB0034).
 
There are a couple of ways you could workaround this - if the robot displays all 8 characters of the barcode, you could change the mediaID generation rule to 3:4:5:6:7:8, add the tape via robot inventory, and then change the rule back to 1:2:3:4:5:6, so that future tapes added comply with the 'usual' settings for the environment.
 
A neater solution, might be simply to add the tape manually to NetBackup:
 
vmadd -m 0034L5 -mt hcart3 -b BB0034L5 -p 13

The volume pool number can be determined from vmpool -list_all, in this example pool 13 = 'Imported'

The tape can now be added to the robot, and an inventory can be run.  As the tape has already defined in NetBackup, the mediaID will not be changed by the existing mediaID generation rule.

Was this content helpful?