07-28-2012 08:46 AM
Im trying to figure out the way to eject tape from CLI (then put it this into a cron job) However, I have a little detail, after that tapes were ejected, they are re-injected after a few minutes and I don't find the solution, The tapes need to stay in the cap until they be taken out from cap. This is what i used for it:
1.-> vmchange -res -multi_eject -verbose -rn 0 -rt TLD -rh hostname -ml VC0239:VC0236 -single_cycle
2.-> vmchange -res -multi_eject -verbose -rn 0 -rt TLD -rh hostname -ml VC0239:VC0236 -verify_eject
I'll aprreciate any little clue/help/comment. Thx
PD: NBU version is 6.5 running on RHEL
Solved! Go to Solution.
08-14-2012 12:41 AM
Are there actually two issues here?
You're trying to sort out an 'unassisted tape ejection' and having issues - fine (well, it's not, but...)
But, is the reason you're actually having issues with this because you do have duplicate media_ids (or at least NetBackup thinks you have)?
Can you check in the GUI to see if VC0239 (barcode VC0239L4) is already loaded in another slot?
(You could also use vmcheckxxx -rt robot_type -rn robot_number to show what's in the library from the command line)
***EDIT***
Forget that (maybe)!
Looking at your post(s) again & having a little play with the command here - I've got an issue with the output from your vmupdate command:
Proposed Change(s) to Update the Volume Configuration
=====================================================
Logically add new media VC0239 (barcode VC0239L4) to robot slot 2.
Updating volume configuration ...
- apart from the fact that it's apparently trying to put the media back into slot 2, why does it think that VC0239 is NEW media? Has your library started to present a different barcode (length) to NetBackup?
Barcode rules are used for new media (therefore that option not really necessary in your command) so NetBackup should be only using them when new media is inventoried in. Try without, but I still see there being an issue here for some reason.
***EDIT #2***
These are the results I got & what you should expect to see:
# vmchange -res -m 300677 -mt HCART3 -rt TLD -rn 1 -rh master -rc1 108 -e -sec 1 remove 300677 from media access port of robot number 1 now media access port will be closed/retracted in 1 seconds... # vmupdate -rt TLD -rn 1 -rh master Generating list of recommended changes ... Proposed Change(s) to Update the Volume Configuration ===================================================== Logically move media ID 300677 (barcode 300677) from slot 108 to standalone residence. Updating volume configuration ... ...etc...etc Volume configuration successfully updated.
Then re-inserted the media & tried a couple more tests:
First an immediate vmupdate with empty map resulted in "no configuration change"
# vmchange -res -m 300677 -mt HCART3 -rt TLD -rn 1 -rh master -rc1 108 -e -sec 1 remove 300677 from media access port of robot number 1 now media access port will be closed/retracted in 1 seconds... # vmupdate -rt TLD -rn 1 -rh master -empty_map Generating list of recommended changes ... Proposed Change(s) to Update the Volume Configuration ===================================================== Volume configuration is up-to-date with robot contents.
Then created a barcode rule for new media beginning with 3006 just to see if it interfered with anything. But it essentially performed as per the original test i.e. barcode rules were ignored as this was not deemed to be new media as far as NetBackup was concerned - unfortunately the only way I could test that theory in full would be to change my library to present an 8-character barcode but that's too much of a risk for me in a production environment!!
Upshot is - as I see it something appears to be amiss with at least one of your media, if not all, and your library config as far as barcodes are concerned.
07-28-2012 10:52 AM
What is the make and model of the library ?
I'm going to take a guess, is it an IBM 3584 ?
Martin
07-28-2012 11:36 AM
Try MAP_CONTINUE_TIMEOUT in vm.conf
Extract from Admin Guide II :
07-30-2012 03:49 AM
In my eject cron job I still just pass 1 tape at a time in. (Since back in 4.5 days I think) using this command under 7.1.0.4 (maybe not efficient as the multi, but works and leaves the tapes in the MAP for the operators whenever they decide to remove)
07-30-2012 05:19 AM
The problem is that you want it to accept the job has completed and just leave the tape in the port
If you have been playing with this the commands can bet stuck in the back ground and the robotic host can need a reboot to clear the "lost" processes.
For NetBackup V6 and above you can use the following:
vmchange -res -m ABC123 -mt HCART -rh hostname -rt tld -rn 0 -rc1 slotnumber -e -sec 1
On windows servers (handy of you have a Windows Media Server or Admin Console) you can use a batch file that just readsa text file with a list of tape media ID's and their slot number.
If you can use that then do the following ...
1. Create a new directory and in it a new file named eject.bat. Open it in notepad and put the following two lines in it - note that it is 2 lines and the forum wraps the first one (edited accoring to your robotic host name, number and volume host name, tld number and tape density):
for /f "tokens=1,2" %%a in (eject_tapes.txt) do vmchange -res -m %%a -mt HCART -rh hostname -rt tld -rn 0 -rc1 %%b -e -sec 1
vmupdate -rt TLD -rn 0 -rh robothost -h volumehost -use_barcode_rules
2. Create also a new text file named eject_tapes.txt. Go to the robot section in the Admin Console, sort the columns so that Media ID is first and slot number is second. Highlight the tapes you want, CTL-C, and then paste into the text file and save it.
When you run the bat file it reads the media id and slot number and uses these as the %%a and %%b in the script - it ejects those tapes to the slot and rather than the usual wait for you to unload and say OK it accepts that you have unloaded them and coninues.
Once it has unloaded them all if also then updates the inventory in netbackup for you.
Obviously you can only have as many tapes listed in the text file as you have MAPs (I/E ports)
Hope this helps
07-30-2012 06:13 AM
Will provide the main guts of my UNIX script, in addition to Mark's Windows script.
Have removed some parts and assume PATHS to commands
Replace all the $VARIABLES with your own except $VOL
bpimagelist -media -hoursago $HOURS -idonly > /tmp/dailytapelist
while read VOL
do
07-30-2012 11:33 AM
I'm gonna probe every one of your suggestion, sorry for the silly question but I'm starting in the backups themes. I'll keep u posted.
08-08-2012 09:16 AM
Hi all..
Sorry for the delay.. But I stil have issues at trying to update inventory, it seems tape is ejected with no error, but at make update invetory I got an error, I've paste a simple example:
[root@server~]# vmchange -res -m VC0239 -mt HCART -rt TLD -rn 0 -rh server -rc1 2 -e -sec 2
remove VC0239 from media access port of robot number 0 now
media access port will be closed/retracted in 2 seconds...
[root@server ~]# vmupdate -rn 0 -rt tld -rh server -use_barcode_rules -empty_map
Generating list of recommended changes ...
Proposed Change(s) to Update the Volume Configuration
=====================================================
Logically add new media VC0239 (barcode VC0239L4) to robot slot 2.
Updating volume configuration ...
Processing new media added to the robotic library by logically
adding media with new media IDs as follows...
Media ID Slot
======== ====
Update failed: could not add new media ID 'VC0239' into slot 2
Insert media failed:
media ID not unique in database (34)
08-08-2012 09:22 AM
Also, im not sureif with this command:
vmchange -res -m VC0239 -mt HCART -rt TLD -rn 0 -rh server -rc1 2 -e -sec 2
Tapes will stay in the cap until DC operators take them out???
PD: i've read all post in the forums regarding unassited eject. Any help???
08-09-2012 02:08 AM
I'm confused, you are ejecting tapes then using the -empty_map option you're in effect putting the tapes back into the library!
-empty_map
Specifies that volumes in the media access port (map) are moved into the robot before the robot inventory is started. This option is only valid for TL8,TLD, or TLM robot types.
08-13-2012 04:04 PM
Hi Stuart,
I've removed option -empty_map and still have the same error at updating investory
vmupdate -rt TLD -rn 0 -rh server -use_barcode_rules
Generating list of recommended changes ...
Proposed Change(s) to Update the Volume Configuration
=====================================================
Logically add new media VC0239 (barcode VC0239L4) to robot slot 2.
Updating volume configuration ...
Processing new media added to the robotic library by logically
adding media with new media IDs as follows...
Media ID Slot
======== ====
Update failed: could not add new media ID 'VC0239' into slot 2
Insert media failed:
media ID not unique in database (34)
Any idea??? =D
08-14-2012 12:41 AM
Are there actually two issues here?
You're trying to sort out an 'unassisted tape ejection' and having issues - fine (well, it's not, but...)
But, is the reason you're actually having issues with this because you do have duplicate media_ids (or at least NetBackup thinks you have)?
Can you check in the GUI to see if VC0239 (barcode VC0239L4) is already loaded in another slot?
(You could also use vmcheckxxx -rt robot_type -rn robot_number to show what's in the library from the command line)
***EDIT***
Forget that (maybe)!
Looking at your post(s) again & having a little play with the command here - I've got an issue with the output from your vmupdate command:
Proposed Change(s) to Update the Volume Configuration
=====================================================
Logically add new media VC0239 (barcode VC0239L4) to robot slot 2.
Updating volume configuration ...
- apart from the fact that it's apparently trying to put the media back into slot 2, why does it think that VC0239 is NEW media? Has your library started to present a different barcode (length) to NetBackup?
Barcode rules are used for new media (therefore that option not really necessary in your command) so NetBackup should be only using them when new media is inventoried in. Try without, but I still see there being an issue here for some reason.
***EDIT #2***
These are the results I got & what you should expect to see:
# vmchange -res -m 300677 -mt HCART3 -rt TLD -rn 1 -rh master -rc1 108 -e -sec 1 remove 300677 from media access port of robot number 1 now media access port will be closed/retracted in 1 seconds... # vmupdate -rt TLD -rn 1 -rh master Generating list of recommended changes ... Proposed Change(s) to Update the Volume Configuration ===================================================== Logically move media ID 300677 (barcode 300677) from slot 108 to standalone residence. Updating volume configuration ... ...etc...etc Volume configuration successfully updated.
Then re-inserted the media & tried a couple more tests:
First an immediate vmupdate with empty map resulted in "no configuration change"
# vmchange -res -m 300677 -mt HCART3 -rt TLD -rn 1 -rh master -rc1 108 -e -sec 1 remove 300677 from media access port of robot number 1 now media access port will be closed/retracted in 1 seconds... # vmupdate -rt TLD -rn 1 -rh master -empty_map Generating list of recommended changes ... Proposed Change(s) to Update the Volume Configuration ===================================================== Volume configuration is up-to-date with robot contents.
Then created a barcode rule for new media beginning with 3006 just to see if it interfered with anything. But it essentially performed as per the original test i.e. barcode rules were ignored as this was not deemed to be new media as far as NetBackup was concerned - unfortunately the only way I could test that theory in full would be to change my library to present an 8-character barcode but that's too much of a risk for me in a production environment!!
Upshot is - as I see it something appears to be amiss with at least one of your media, if not all, and your library config as far as barcodes are concerned.
08-16-2012 04:21 PM
Hi all.. the problem with duplicated Id was solved, the solution was very easy, just need to move media to standalone, here's the instruction in case someone could have my same issue.
vmchange -res -m VC0239 -mt hcart -rt none -rn 0 -rh <robot control host>
08-21-2012 08:28 AM
The scripts i gave you should move them to standalone when it did the ejects without any further comands
I have used this script on many sites and it has worked a treat on all of them
Once it has done the ejects it then updates the inventory which moves the missing tapes (those in the ports to standalone)
You may find that you incorrect scritp the first time just ejected it and then re-imported it, possibly to a different slot, so NetBackup thought it was in the library twice
Hope this helps
09-04-2012 06:32 PM
Hi All...
I appreciate your help, finally, my little script for unassisted eject it works. Thx
I give a point to all the replies that really helped me
09-06-2012 02:03 AM
Glad this is sorted - if one particular answer sorted it for you please use the "Mark as solution" to close the thread and help others looking for a similar issue in the future - thanks