Unsolved
1 Rookie
•
22 Posts
0
1363
Scripts to recycle/relabel expired tapes manually (and potentially assign them to a 'scratch' pool)
Hello,
Is there anyone who is running scripts to recycle/relabel expired tapes manually (and potentially assign them to a 'scratch' pool) ? I am looking for a sample one and would someone please share any sample script so that I can try to use it and try ?
bingo.1
2.4K Posts
0
November 17th, 2021 08:00
Please understand that you will never get a more precise answer if you do not even name the OS (family) you are working with. I will also not present a full solution here but I can give you some guidelines how you should start.
Do not forget to read the Command Line Reference for the full set of options - I will only state the most important ones.
1. Prepare the SCRATCH pool
- Create a new pool with the appropriate name (& label template, if you do not use barcode labels)
- Set the option "Recycle to other pools"
2. Prepare your destination (clone) pool
- Set the option "Recycle from other pools"
3. Use 'mminfo' to get a list of recyclable tapes
mminfo -q volrecycle -r volume > recyclable_volumes.txt
4. Next use a script or an Excel table to prepare the relabel commands for each of the volumes, assuming that you have a jukebox
nsrjb -R -b SCRATCH volume
5. Finally, set the status of the SCRATCH tapes to 'recyclable
mminfo -q "pool=SCRATCH" -r volume > SCRATCH_volumes.txt
Next use a script or an Excel table to change each volume status as follows:
nsrmm -o recyclable volume_name
This should do the job.
barry_beckers
393 Posts
0
November 17th, 2021 12:00
In the past scripting like that might have been required, for example we had a VTL solution using physical tape on its backend, but also with DD VTL, if you'd recycle/relable expired tapes, then physical tape or storage capacity got actually released.
However nowadays for those situations that wouldn't be required to script as one can use the "Automatically relabeling volumes in a media pool".
Or is your actual use case differently and this build-in solution not appropriate enough?
"Automatically relabeling a recyclable volume provides the following benefits:
● You can relabel volumes outside of the backup window without the need for a scripted solution.
● NetWorker has access to appendable volumes at the time of a backup or clone, which results in faster backup and clone
completion times.
Eligible volumes will not be relabeled if the volume is loaded in a device that is:
● Disabled
● In use by an nsrmmd process (for example, during a restore operation)
● In read-only mode
● Busy
When NetWorker automatically relabels a volume, message to the following appears in the daemon.raw file on the NetWorker
server:
"num_of_volumes volumes will be recycled for pool pool_name in jukebox jukebox_name.""
"Max volumes to recycle
Defines the maximum number of recyclable volumes that NetWorker can relabel during each automatic relabel process. The default value is 200."
bingo.1
2.4K Posts
0
November 17th, 2021 15:00
I personally do not like a VTL solution. Why? - because it just adds an additional layer which is in fact unnecessary and another potentially point-of-failure. IMHO it just creates a well-known environment so that an admin who comes from a physical tape environment will immediately feel comfortable.
@barry_beckers
With NW, one never stops learning . Up to now, I was not aware of the option Automatically relabeling volumes in a media pool. Why? - because I simply cannot find it.
It is obviously an option you set for a pool. However, neither for a NW 9.2.x environment, nor for a NW 19.3.x version I could figure out where this option will be set. No matter whether it is in the NW Admin GUI (of course I used Diagnostic Mode) or within nsradmin (Option Hidden set). The only reference I could find so far is in the Admin Guide just after Auto media verification. And as usual, there is no picture which will clarify the mystery.
So please, if you know the way how to configure it, please add a screenshot for the sake of all of us.
barry_beckers
393 Posts
1
November 18th, 2021 05:00
we used DD VTL in environments where there was not enough network ports available while we had enough SAN ports. So only based on costs. For DD's I'd always prefer ddboost instead of having to deal with fibre connections on various OS platforms also requiring drivers and so on, binding devices in place and what not.
Too many things that went wrong with that, even though no longer actual tape or drives breaking occurred it was far from painless. So I don't miss (physical/virtual) tape one bit.
I only stumbled upon the feature after we pretty much got rid of all jukeboxes, and thought this would have been helpful in the past (also it using a default of max. 200 tapes, which we also used for relabeling via a script in the past as possibly doing too many might take so long that NW itself might already have had the time to pick up a volume).
When I look in nw19.4, I see that it is beneath the pool. Below the NW help info as stated in NMC for the pool resource.
pool options
"
"
barry_beckers
393 Posts
0
November 18th, 2021 05:00
before we introduced DD's, we used VTL with a physical tape backend and a rather small amount of disk storage only able to contain the backups for the last 2 days or so, so any backups older than 2 days would be coming from physical tape, and due to having not enough physical drives and only midrange storage array being used, it could become very slow depending on how busy the environment was and how data was to be recalled from physical tape.
I don't miss it a bit in hindsight. DD is a whole different beast altogether and VTL is only stuck on it after customer demand (to indeed, as bingo.1 states, be able to transfer from the old fashioned physical tape to VTL, it was a nifty way and we used it that heavily as well, until actually moving towards usage of ddboost, especially after introducing a dedicated layer3 backup network), not because DD themselves saw it as a way forward. At the moment we do not use VTL features at all anymore on a DD.
bingo.1
2.4K Posts
0
November 18th, 2021 09:00
Hi Barry, and thank your for your efforts. I finally found the secret. The reason for the misunderstanding is due to the naming convention, a coarse description and my wrong expectation.
So - for the option Recycle start one must set the start time of a daily (by default 24:00 hours) 'recycle process' to activate this option. I got the impression that there was a yes/no option which would just generally enable this option which then would just run for example on an hourly basis.
If the option would have assigned a more descriptive name like Auto recycle start time, it would indicate its purpose much better.
bingo.1
2.4K Posts
0
November 21st, 2021 04:00
I digged a bit deeper inside the 'automatic recycling' feature. Here is what I found:
- It has been introduced a while ago with NW 8.0
- A recyclable volume candidate must have the volume status 'recyclable'. This is a tiny detail but it is fact that a tape, where all save sets have the status 'recyclable' will not immediately become 'recyclable' - index management (nsrim) must run first to achieve that.
- It works for jukebox tapes only. This makes somehow sense as the system must of course be capable to automatically insert tapes in a drive to get them relabeled. However, IMHO is is then not 100% correct to add this feature as an attribute for a pool because other recyclable media from the same pool in standalone tape drives and disk drives will not be affected.
- The Admin Guide says that there will be this entry in the daemon.raw file: "num_of_volumes volumes will be recycled for pool pool_name in jukebox jukebox_name."
At least for the latest NW version 19.5.0.2 I could not see this message at all.