cancel
Showing results for 
Search instead for 
Did you mean: 

VTL tape Quick Erase Question

BR549
Level 4

 

I am running a Windows 2008 R2 Enterprise OS with Veritas 6.5.6 x64 installed.  This Veritas Master server is configured with a Physical Tape Library access via Oracle’s LibAttach software and a VTL environment that is directly connected to the Veritas Master server.

 

Since VTL does not automatically release the ‘data’ on expired tapes I need to run a program that will automatically cause the VTL tapes to show no data usage for those tapes located in the Scratch pool.

 

I have created the following script.  However this script includes the physical scratch tapes as well as the VTL scratch tapes in its output.  I would like to limit the output in the scratchlist.txt file to just the VTL tapes in the Scratch pool.  The pertinent volume group for the VTL environment is 000_00001_TLD, robot type is TLD, robot number is 1 and media numbers all begin with the letter Z. 

 

vmquery -pn Scratch -l>c:\scratchlist.txt

for /f %a in (c:\scratchlist.txt) do bplabel -m %a -d hcart -o -p Scratch -host gsslz103 -erase

 

However whenever I try to modify the vmquery statement to include these elements, vmquery –v 000_00001_TLD –rt TLD –rn 1 -pn Scratch -l>c:\scratchlist.txt it results in an error and I get the Usage help page as shown below.

 

Usage: vmquery [-h <EMM_server> | <volume_database_host>,...,

           -h <EMM_server> | <volume_database_host>]

           [-b | -w | -W | -l]

           {

           -a |

           -m <media_id> |

           -v <volume_group> |

           -rn <robot_number> |

           -rt <robot_type> |

           -mt <media_type> |

           -p <pool_number> |

           -pn <pool_name> |

           -vltcid <vault_container_id> |

           -res <robot_type> <robot_number> <robot_control_host>

                <robot_coord1> <robot_coord2> |

           -assignbyid <media_id> <media_type> <pool_number> <status>

                       <assigntime> |

           -deassignbyid <media_id> <pool_number> <status>

 

Any assistance you can provide to help me modify the above statement correctly to just include the VTL tapes.

 

Cordially,

 

Jerry Ellis

1 ACCEPTED SOLUTION

Accepted Solutions

BR549
Level 4

Working with a co-worker we finally developed a solution that works.  While not as simple as I would like it does work.  Essentially we run a VBS script to create reports for the Scratch and the NetBackup pools.  We remove the Non VTL tapes by keying in on the Tapes starting value, in our case it is V for Veritas and Z for VTL. 

We run the list of the NetBackup Pool of tapes for a list of the Z Tapes in that pool from the previous day and compare that against the current list of Z Tapes in the scratch pool.  If the same tape number appears in both lists we output that information to a 3rd list and use that list to generate the bplable -erase commands.

I have attached a zipped copy of our files to this response.

View solution in original post

15 REPLIES 15

RLeon
Moderator
Moderator
   VIP   

Perhaps someone else will be able to help you with the script.

Seeing that you are using "NetBackup - 7.1.x and Earlier", and are attempting the exact same thing that caused me to lose data on VTL tapes, please go through this thread in case you haven't already.

I hope the same thing doesn't happen to you. (Unlikely, if you are only targeting the scratch pool.)

 

mph999
Level 6
Employee Accredited

vmquery –v 000_00001_TLD –rt TLD –rn 1 -pn Scratch -l>c:\scratchlist.txt

You don't need the -rt or -rn options, these don;t seem to work with the -v option, which actually kinda makes sense.

The vol group actually contains the 'rt' and the 'rn'

000_00001_TLD

The 00001 part is the library number, the TLD bit is of course the library type.

I had problems with the -l when I tested this, can you try the -w, no idea why that didn;t work (at least for me).

Martin

BR549
Level 4

Tried the following  as suggested by mph999 with no luck.

C:\>vmquery -v 000_00001_TLD -pn Scratch -l>c:\scratchlist.txt
Usage: vmquery [-h <EMM_server> | <volume_database_host>,...,
           -h <EMM_server> | <volume_database_host>]
           [-b | -w | -W | -l]
           {
           -a |
           -m <media_id> |
           -v <volume_group> |
           -rn <robot_number> |
           -rt <robot_type> |
           -mt <media_type> |
           -p <pool_number> |
           -pn <pool_name> |
           -vltcid <vault_container_id> |
           -res <robot_type> <robot_number> <robot_control_host>
                <robot_coord1> <robot_coord2> |
           -assignbyid <media_id> <media_type> <pool_number> <status>
                       <assigntime> |
           -deassignbyid <media_id> <pool_number> <status>
           }
CAUTION: The act of unassigning volumes may lead to inconsistencies between the application media database and volume database, leading to the possibility for data loss. You must expire the media from an application interface.

mph999
Level 6
Employee Accredited

Remove the -l as well :

 

vmquery -v 000_00001_TLD -pn Scratch

Does that work ?

Martin

BR549
Level 4

I tried the query with and without adding the host information and both times if brought up the following.

C:\>vmquery -v 000_00001_TLD -pn Scratch
Usage: vmquery [-h <EMM_server> | <volume_database_host>,...,
           -h <EMM_server> | <volume_database_host>]
           [-b | -w | -W | -l]
           {
           -a |
           -m <media_id> |
           -v <volume_group> |
           -rn <robot_number> |
           -rt <robot_type> |
           -mt <media_type> |
           -p <pool_number> |
           -pn <pool_name> |
           -vltcid <vault_container_id> |
           -res <robot_type> <robot_number> <robot_control_host>
                <robot_coord1> <robot_coord2> |
           -assignbyid <media_id> <media_type> <pool_number> <status>
                       <assigntime> |
           -deassignbyid <media_id> <pool_number> <status>
           }
CAUTION: The act of unassigning volumes may lead to inconsistencies
         between the application media database and volume database,
         leading to the possibility for data loss. You must expire the
         media from an application interface.

C:\>
C:\>vmquery -v 000_00001_TLD -pn Scratch -h hostname

Usage: vmquery [-h <EMM_server> | <volume_database_host>,...,
           -h <EMM_server> | <volume_database_host>]
           [-b | -w | -W | -l]
           {
           -a |
           -m <media_id> |
           -v <volume_group> |
           -rn <robot_number> |
           -rt <robot_type> |
           -mt <media_type> |
           -p <pool_number> |
           -pn <pool_name> |
           -vltcid <vault_container_id> |
           -res <robot_type> <robot_number> <robot_control_host>
                <robot_coord1> <robot_coord2> |
           -assignbyid <media_id> <media_type> <pool_number> <status>
                       <assigntime> |
           -deassignbyid <media_id> <pool_number> <status>
           }
CAUTION: The act of unassigning volumes may lead to inconsistencies
         between the application media database and volume database,
         leading to the possibility for data loss. You must expire the
         media from an application interface.

mrbill14
Level 3

I have a similar environment...  Windows 2008 R2 running 6.5.6 writing to a VTL for immediate backups, but we also have an HP ESL library for physically duplicating tapes for offsite.

I found a script (http://www.backupcentral.com/phpBB2/two-way-mirrors-of-external-mailing-lists-3/symantec-netbackup-1...) and modified it to our environment to label/erase any tapes that became expired.

 

First, you need to find the "media_deassign_notify.cmd" (found in the Netbackup\bin\goodies directory) and move it into the Netbackup\bin directory.  This script will write out to a text file (MEDIA_DEASSIGNED.txt) whenever a tape expires.

Also, I have this script ONLY write out the tapes that begin with a barcode of "VT" (which stands for Virtual Tape).

I then have a daily scheduled job (Label_MEDIA_DEASSIGNED.bat) that parses the text file.  This script checks the status of the tape (to make sure it didn't get used within the time that it expired and the time that the script ran) and then runs the BPLABEL command to erase the data.

I then rename the text file and append it with the date.  This way, if there are any problems and/or questions, I can refer back to the older text files.

(I have renamed the media_deassign_notify.cmd and the scheduled batch file to .txt.  You will need to rename it - as well as modify it to your environment - before use.)

Hopefully, this will get you going on the right track.  It has served us well...  (Been using it for over 2 years now.)

Mark_Solutions
Level 6
Partner Accredited Certified

Your issue is the scratch pool - you cannot bplabel a tape in scratch

So you need to move it somewhere else first (vmchange) and then bplabel it - it should work then

Hope this helps

mrbill14
Level 3

Just checking back on this thread...

Did this help?  Any questions?

BR549
Level 4

My VTL tapes begin with a Z and my VTL Robot is TLD(1).  I think I modified the scripts you provided correctly and have attached the same to this reply. I am using LTO4 tapes for the VTL emulation.

Do you run these scripts as a scheduled task or by putting them in the <install path>\netbackup bin directory sufficient to have the process run automatically. 

I created the c:\reports directory on the server and I attempted to manually run the media_deassign_notify batch file but the report I got was blank.

If you can verify I have set my parameters correctly in the modified media_deassign_notify file and the Label_Media_DEASSIGN files that I have attached I would appreciate it.  Naturally, the "myhost" entry would actually be my Media server host name on the physical system.

Thanks for the assistance.

Mark_Solutions
Level 6
Partner Accredited Certified

My feeling is still that bplabel does not work on tapes in a scrathc pool, as per my earlier post, so i don't think any of this will work - but i stand to be corrected

mrbill14
Level 3

The Media_deassign_notify.cmd is a Netbackup script.  This goes in the <install path>\Veritas\Netbackup\bin directory.  This gets tiggered every day (every 24 hours) and logs (writes)  to the OUTF (output file) specified - C:\Reports\MEDIA_DEASSIGNED.txt.

You have the Z in there (for the tape id), so that's good.  Notice that I'm stripping the barcode down to 6 characters (that's what we use here, your setup may be different).  You may have to tweak this a bit to get the correct barcode echo'ed (written) to the text file.  (I have attached a sample MEDIA_DEASSIGNED.txt file)

LABEL_MEDIA_DEASSIGNED.bat is a Windows scheduled job (runs the batch file daily at 3:30 pm).  Again, the batch file first queries the media to make sure it's in the scratch pool and if it is, it labels it - which zeros out the virtual tape, giving you back the physical space on the VTL. 

OH...  check your version of Veritas...  mine is 6.5.6.  Sometimes you get different results if you're on a different version level.  For example, when you do a VMQUERY, the listing that you get back may have more/less information, that would throw off the "tokens=12", so instead of getting "Scratch" (for the scratch pool), you could be getting back the expiration date or some other parameter.

Might check the <install path> for Veritas.  Mine is C:\Veritas.

Bplabel DOES work on the scratch tapes.  Remember, just because the tape is in the scratch pool does not mean it's blank!  It has basically been expired so Veritas "forgets" about whats on that particular tape.  Until you label/erase the tape, there is still data on it (and therefore taking space on the VTL).

mrbill14
Level 3

You can't manually run the Media_Deassign_notify.cmd file (well you can, but it won't work).

NOTE:  Make sure to move this up a level into the Netbackup\bin directory!  (Not in the goodies directory.)

You can manually create entries in the C:\Reports\MEDIA_DEASSIGNED.txt (see my example that I've attached in the previous post).  Then run the Label_MEDIA_DEASSIGNED.bat file...

mrbill14
Level 3

Just checking back in on this thread...  any luck?  Doing good???

BR549
Level 4

Haven't had much time to pursue this issue of late, been working a higher priority project that has taken up all of my availability.  Project has extremely tight deadlines, so I haven't been able to concentrate on this issue as much as I would have liked.

I have placed my modified version of the file from the goodies directory in the /bin directory but that's about as far as I have gotten to date.  It's till on my plate to get automated...

BR549
Level 4

Working with a co-worker we finally developed a solution that works.  While not as simple as I would like it does work.  Essentially we run a VBS script to create reports for the Scratch and the NetBackup pools.  We remove the Non VTL tapes by keying in on the Tapes starting value, in our case it is V for Veritas and Z for VTL. 

We run the list of the NetBackup Pool of tapes for a list of the Z Tapes in that pool from the previous day and compare that against the current list of Z Tapes in the scratch pool.  If the same tape number appears in both lists we output that information to a 3rd list and use that list to generate the bplable -erase commands.

I have attached a zipped copy of our files to this response.