Date - Nov 2008
Affected Product & Version - NetVault: Backup ALL
Affected Module & Version - CLI Utilities ALL Versions
OS Version - ALL
Application Information - N/A
Description:
This article shows how to efficiently remove old/offline VTL media from NetVault.
Symptoms:
In the event a Virtual Tape Library is destroyed or rebuilt, the index entries and information about its media will remain indefinitely in the NetVault Database.
The old virtual tapes will also show as 'offline' in Media Management, thus occupying valuable Virtual space against your current virtual license entitlement.
This situation could prevent you from adding new devices or generate license infringement errors during backups when one would think that the current virtual capacity is enough.
To get rid of these old tape entries and reclaim virtual space capacity, you could right click on each offline tape, and select 'Remove', in Media Management.
However, this method would be tedious and inefficient, but also result impossible if there are several hundreds/thousands of offline virtual tapes to delete.
Fortunately, the CLI utility 'nvremovemedia', found under the NVHOME/util/ directory, offers the opportunity to automate this removal process if included in a script.
A script can be created using the following 3 items:
- the '-medialabel' switch allows you to specify the label of the media to delete.
- the '-displaymedialist' switch provides the complete list of media as they would appear in Media Management
- the Barcode Prefix, at creation, each VTL assigns a unique 5-digit Barcode Prefix to all of its media
With the above information one could implement a script that will run the 'nvremovemedia'command on just the tapes bearing the unique Barcode Prefix of the deleted VTL.
A loop would have to be implemented to run the command on each tape.
The scrip
Create a script using the 'nvremovemedia' command.
The 'pseudo code' for the script could be as follows:
1) Get the current medialist: 'nvremovemedia -displaymedialist'
2) 'find' or 'grep' the lines bearing the old VTL Barcode Prefix > dump them to a hitlist file
3) run 'nvremovemedia -medialabel' on each line of the hitlist
4) feed the -medialabel switch only the begining of the line up to the Barcode Prefix, between quotes
Such scripts for both Windows and Unix platforms are attached to this article for your convenience.
You will have to put these script under the NVHOME/util/ directory and run them from there.
IMPORTANT NOTE:
- The NETVAULTCLIACCOUNT and NETVAULTCLIPASSWORD variables are set to 'default' with no password in the script, so if you are using a different NetVautl user, you might want to set these variables to the relevant account and password or comment these lines in the script.
- Note that these scripts are working samples provided only as guidelines and are not official workarounds.
BakBone Software declines any responsibility in any issue resulting from the use or modification of these scripts
.