cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid drive index when delete the tape drive

Home_224
Level 6

i find the problem when drive to remove the drive , it shows that the invalid drive index when delete the drive. 

root@devuarbak01 # tpconfig -l
Device Robot Drive Robot Drive Device Second
Type Num Index Type DrNum Status Comment Name Path Device Path

But I can see the tape information when run the  scan.  

root@devuarbak01 # scan-tape
scan-tape: not found
root@devuarbak01 # scan
************************************************************
*********************** SDT_TAPE ************************
*********************** SDT_CHANGER ************************
*********************** SDT_OPTICAL ************************
************************************************************
------------------------------------------------------------
Device Name : "/dev/rmt/0cbn"
Passthru Name: "/dev/sg/c0tw2002000e111639dbl0"
Volume Header: ""
Port: -1; Bus: -1; Target: -1; LUN: -1
Inquiry : "IBM ULT3580-HH6 H991"
Vendor ID : "IBM "
Product ID : "ULT3580-HH6 "
Product Rev: "H991"
Serial Number: "10WT130808"
WWN : ""
WWN Id Type : 0
Device Identifier: "IBM ULT3580-HH6 10WT130808"
Device Type : SDT_TAPE
NetBackup Drive Type: Not Found(5)
Removable : Yes
Device Supports: SCSI-6
Flags : 0x0
Reason: 0x0
------------------------------------------------------------
Device Name : "/dev/sg/c0tw2002000e111639dbl1"
Passthru Name: "/dev/sg/c0tw2002000e111639dbl1"
Volume Header: ""
Port: -1; Bus: -1; Target: -1; LUN: -1
Inquiry : "IBM 3573-TL E.60"
Vendor ID : "IBM "
Product ID : "3573-TL "
Product Rev: "E.60"
Serial Number: "00L2U78CF388_LL0"
WWN : ""
WWN Id Type : 0
Device Identifier: "IBM 3573-TL 00L2U78CF388_LL0"
Device Type : SDT_CHANGER
NetBackup Robot Type: 8
Removable : Yes
Device Supports: SCSI-5
Number of Drives : 2
Number of Slots : 24
Number of Media Access Ports: 0
Drive 1 Serial Number : "10WT130808"
Drive 2 Serial Number : "10WT127994"
Flags : 0x0
Reason: 0x0
------------------------------------------------------------
Device Name : "/dev/rmt/1cbn"
Passthru Name: "/dev/sg/c0tw2005000e111639dbl0"
Volume Header: ""
Port: -1; Bus: -1; Target: -1; LUN: -1
Inquiry : "IBM ULT3580-HH6 H991"
Vendor ID : "IBM "
Product ID : "ULT3580-HH6 "
Product Rev: "H991"
Serial Number: "10WT127994"
WWN : ""
WWN Id Type : 0
Device Identifier: "IBM ULT3580-HH6 10WT127994"
Device Type : SDT_TAPE
NetBackup Drive Type: Not Found(5)
Removable : Yes
Device Supports: SCSI-6
Flags : 0x0
Reason: 0x0

I try to run robot inventory, it cannot connect to robotic software daemon

41 REPLIES 41

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

@Home_224 

It seems to me that you have 2 choices: 

1. Try to locate MP7 for version 6.0 (it includes the additional -deletealldevices switch).

2. Use vmglob or  tpconfig command as per the TN and post that I have shared to delete the devices listed as 'MISSING_DRIVE' . 

mph999
Level 6
Employee Accredited

 

Run nbdb_unload /some/empty/directory

The command will create the dir and dump a copy of the NBDB tables

Open reload.sql with vi

Search forward fot INPUT INTO ( /INPUT INTO )
Search forward again for EMM_Device (/EMM_Device )


You should have text that looks like this, but the xxx.dat file number will be different

INPUT INTO "EMM_MAIN"."EMM_Device"
FROM '/netbackup/db/747.dat'
FORMAT TEXT
ESCAPE CHARACTER '\\'
BY ORDER("DeviceKey","DeviceID","DeviceType","DeviceSubType","DeviceStatus","DeviceFlags","DeviceTypeFlags","DeviceTypeName" <SNIP>

Make a note of the xxx.date file number, this is the EMM_Device table

Look in xxx.dat, you will see one line (quite log ) for each device, eg ... (I've truncated the lines below as they are long, but you get the idea)

'2000074',0xF19CDF0A78A611E98000F0E2C83C0987,'1','8','0','1073741824','0','TLD - Tape Library DLT','TLD - Tape Library DLT','520888320','15104' <SNIP>
'2000075',0xF19F28FA78A611E98000F0E2C83C0987,'2','16','0','0','1','NetBackup HCART3','NetBackup HCART','523118080','16176','6','0','IBM.ULTRIUM-HH6.000 <SNIP>
'2000076',0xF19FC53A78A611E98000F0E2C83C0987,'2','16','0','0','1','NetBackup HCART3','NetBackup HCART','523118080','16176','6','0','IBM.ULTRIUM-HH6.001 <SNIP>

Do you see devices that you believe have been deleted ?

 


There is another table called :

EMM_MachineDeviceConnection

You can find the .dat file number in the same way

cat 773.dat

'2000074','1000002','0',0x00000000,'1','-1','-1','-1','-1','1','1073741824','0','/dev/sg7'
'2000075','1000002','0',0x00000000,'2','-1','-1','-1','-1','2','1073741824','0','/dev/tape/by-path/pci-0000:04:00.1-fc-0x500308c38f11e001-lun-0-nst'
'2000076','1000002','0',0x00000000,'2','-1','-1','-1','-1','2','1073741824','0','/dev/tape/by-path/pci-0000:04:00.1-fc-0x500308c38f11e005-lun-0-nst'

This associates machines with the devices

The first field of the EMM_Device table is the 'DeviceKey' this is a unique number for a device, for example the tape library on my server has the device key '2000074'

The first field of the EMMM_MachineDeviceConnection is also the 'DeviceKey', and the 2nd field is the 'MachineKey' (which is unique and relates to one of the servers)

So, here - the library is device 2000074 and this relates (in the EMM_MachineDeviceConnection table to MachineKey '1000002'.


You can look up the machines in the EMM_Machine table (found the same way as the others by looking in the reload.sql file).

Eg
'1000001',0xEEDE786C850611E88000D779D70C2B1C,'gpk630r2f-18.uklab.veritas.com','gpk630r2f-18','0','0', <SNIP>
'1000002',0xF1BEB4FC850611E88000D779D70C2B1C,'gpk630r2f-18.uklab.veritas.com','gpk630r2f-18', <SNIP>

The first files is the MachineKey, the 3rd field is the Fully Qualified Machine Name - so you can see that '1000002' is the server called gpk630r2f-18

(It appears twice in the file as one entry will be for teh 'master type', the other 'server type' as seen in nbemmcmd -listhosts )

You should now be able to work out what devices (robots / tape drives ) are associated with which server - and therefore deduce if devices do or do not apeear where you expect.

I use the below command to try delete drive or robot , it is failed in the apatment 

 

root@devuarbak01 # tpconfig -delete -robot 1
Cannot delete robot number 1: Robot number does not exist
root@devuarbak01 # tpconfig -delete -robot 0
Cannot delete robot number 0: Robot number does not exist
root@devuarbak01 # tpconfig -delete -robot -1

 

root@devuarbak01 # vmglob -delete -robot -serial 00L2U78CF388_LL0 -robnum 0
invalid host name (136)

I check the EMM table is quite different, and find index is -1.  May I know if there is configuration issue?

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

@Home_224 

You really need to figure this out for yourself.

Keep the 'tpconfig -emm_dev_list' output open, and try to use more options from that output to delete devices.
For tpconfig, there was an example in a TN that I shared that looked like this:

tpconfig -delete -drpath -asciiname <drive_name>-port  -1 -bus -1 -target -1 -lun -1
Commands manual lists these options for a drive:
UNIX systems: tpconfig -delete -drpath -path drivepath -asciiname asciidrivename

For the vmglob command, you can see that you need device host as well. 

There was a good example in one of the posts that I shared. 

 

mph999
Level 6
Employee Accredited

I don't see index = -1 in the device table.  The lines are long, so if tey 'wrap around' it can look like you have more lines than you actually have.

I usually suggest something line 'vi' in Unix, or Textpad which can open files without messing up the formatting, and without automatically 'wrapping the lines around'.

 

I do notice that this :  (from device table)

'2000241',0xF3FFA920470C13F88004D69DAD098569,'1','4','0','0','0','','','520888320','15104','6','0','ROBOT1','','0','1','0'
,'','-1','','','','','','','','','','5','','1000002','devuarbak01','0','0','1970/01/01 00:00:00.000000','1970/01/01 00:00:
00.000000','1970/01/01 00:00:00.000000','0','0','0','0',0x00000000,0x00000000,'-1','-1','1970/01/01 00:00:00.000000','0','
0','-1','-1','-1','-1','','','','0','0','2','16417','2017/10/12 06:55:52.354075','2019/03/01 09:48:06.441658'

Is not associated with any servers

Is this the device you are trying to delete.

 

I try to delete all of them and reconfigure the tape library, i think I should clear all the entry if I delete all tape drive to reconfigure 

mph999
Level 6
Employee Accredited

That would probably be the easiest way.

nbemmcmd -deletealldevices -allrecords

... will remove all tape drives and libraries.  It's a bit drastic, but should completey the db tables where the config is stored to start afresh.

Yes, but the command not work with the current version of 6.0 MP  

mph999
Level 6
Employee Accredited

Yes, thank you - I had forgotten it was this issue that had the older version of NBU.

So, you are back to seeing if you can find the MP7 service pack anywhere.

mph999
Level 6
Employee Accredited

Which robot were you trying to delete, the one I mentioned above ?

I want to delete all the device and restart the NBU service, and use the device wizard to rescan the FC device again. 

mph999
Level 6
Employee Accredited

Can you attch the two tables:

EMM_MAIN.EMM_Device
EMM_MachineDeviceConnection

from nbdb_unload to this thread

 

 

I get this error 

root@devuarbak01 # ./nbdb_unload -t EMM_MAIN.EMM_Device /tmp/EMM
***** SQL error: Database server not found
root@devuarbak01 # ./nbdb_unload
Usage: nbdb_unload [-dbn database_name] [-t table_list] [-s] destination_directory
root@devuarbak01 # ./nbdb_unload -t EMM_MachineDeviceConnection /tmp/EMM_Machine
***** SQL error: Database server not found
root@devuarbak01 #

I am not sure if there is any DB corruption

mph999
Level 6
Employee Accredited

Try unloading the complte DB

nbdb_unload /some/empty/directory

@mph999 

I find the EMM_Device output

'2000241',0xF3FFA920470C13F88004D69DAD098569,'1','4','0','0','0','','','520888320','15104','6','0','ROBOT1','','0','1','0','','-1','','','','','','','','','',
'5','','1000002','devuarbak01','0','0','1970/01/01 00:00:00.000000','1970/01/01 00:00:00.000000','1970/01/01 00:00:00.000000','0','0','0','0',0x00000000,0x000
00000,'-1','-1','1970/01/01 00:00:00.000000','0','0','-1','-1','-1','-1','','','','0','0','2','16417','2017/10/12 06:55:52.354075','2019/03/01 09:48:06.441658
'
'2000366',0xC2C9FFB070F4140280038734C17284CD,'2','16','0','0','1','NetBackup HCART3','NetBackup HCART','523118080','16176','6','0','IBM.ULT3580-HH6.000','','2
000365','-1','0','','-1','IBM','ULT3580-HH6','H991','','','','10WT127936','IBM ULT3580-HH6 10WT127936','','IBM ULT3580-HH6 H991','','0','','0'
,'0','1970/01/01 00:00:00.000000','1970/01/01 00:00:00.000000','2018/10/29 10:21:28.000000','0','607672','0','0',0x00000000,0x00000000000000000000000000000000
,'-1','-1','1970/01/01 00:00:00.000000','0','0','-1','-1','-1','-1','','','','0','0','0','65','2018/08/28 10:18:07.420245','2019/09/16 07:50:40.582842'
'2000367',0xB7F8BDF016C2140380038734C17284CD,'2','16','0','0','1','NetBackup HCART3','NetBackup HCART','523118080','16176','6','0','IBM.ULT3580-HH6.001','','2
000365','-1','0','','-1','IBM','ULT3580-HH6','H991','','','','10WT127938','IBM ULT3580-HH6 10WT127938','','IBM ULT3580-HH6 H991','','0','','0'
,'0','1970/01/01 00:00:00.000000','1970/01/01 00:00:00.000000','2018/10/29 10:21:30.000000','0','416021','0','0',0x00000000,0x00000000000000000000000000000000
,'-1','-1','1970/01/01 00:00:00.000000','0','0','-1','-1','-1','-1','','','','0','0','0','65','2018/08/28 10:18:07.455601','2019/09/16 07:50:40.583951'
'2000374',0x8D2F119C69E114038001E4ADD45DCD02,'1','8','0','1073741824','0','TLD - Tape Library DLT','TLD - Tape Library DLT','520888320','15104','6','0','ROBOT
0','','0','0','0','','-1','IBM','3573-TL','E.60','','','','00L2U78CF388_LL0','','','IBM 3573-TL E.60','','1000002','devuarbak01','0','0','1970/01/
01 00:00:00.000000','1970/01/01 00:00:00.000000','1970/01/01 00:00:00.000000','0','0','0','0',0x00000000,0x00000000,'-1','-1','1970/01/01 00:00:00.000000','0'
,'0','-1','-1','-1','-1','','','','0','0','2','8388608','2019/03/04 04:57:56.579822','2019/03/04 04:57:56.638721'
'2000375',0xEDD9834C4F5514048001E4ADD45DCD02,'2','5','0','0','0','','','520888320','15104','6','0','IBM.ULT3580-HH6.002','','2000374','0','8','','1','IBM','UL
T3580-HH6','H991','','','','10WT130808','IBM ULT3580-HH6 10WT130808','','IBM ULT3580-HH6 H991','','0','','0','0','1970/01/01 00:00:00.000000',
'1970/01/01 00:00:00.000000','1970/01/01 00:00:00.000000','0','0','0','0',0x00000000,0x00000000000000000000000000000000,'-1','-1','1970/01/01 00:00:00.000000'
,'0','0','-1','-1','-1','-1','','','','0','0','0','65','2019/03/04 04:57:56.654803','2019/09/16 07:50:40.584056'
'2000376',0x5FC770FC728614038002E4ADD45DCD02,'2','5','0','0','0','','','520888320','15104','6','0','IBM.ULT3580-HH6.003','','2000374','0','8','','2','IBM','UL
T3580-HH6','H991','','','','10WT127994','IBM ULT3580-HH6 10WT127994','','IBM ULT3580-HH6 H991','','0','','0','0','1970/01/01 00:00:00.000000',
'1970/01/01 00:00:00.000000','1970/01/01 00:00:00.000000','0','0','0','0',0x00000000,0x00000000000000000000000000000000,'-1','-1','1970/01/01 00:00:00.000000'
,'0','0','-1','-1','-1','-1','','','','0','0','0','65','2019/03/04 04:57:56.666058','2019/09/16 07:50:40.584130'

------------------------------------------------------------------------------------------------------------------------------------------------------

EMM_MachineDeviceConnection

'2000366','1000002','0',0x00000000,'2','-1','-1','-1','-1','4','1073741824','0','MISSING_DRIVE:10WT130808','','0','0','0','2018/08/28 10:18:07.488849','2019/0
9/16 07:50:40.610802'
'2000367','1000002','0',0x00000000,'2','-1','-1','-1','-1','4','1073741824','0','MISSING_DRIVE:10WT127994','','0','0','0','2018/08/28 10:18:07.547294','2019/0
9/16 07:50:40.611042'
'2000374','1000002','0',0x00000000,'1','-1','-1','-1','-1','0','1073741824','0','/dev/sg/c0tw2002000e111639dbl1','','0','0','0','2019/03/04 04:57:56.637038','
2019/09/16 07:50:40.629931'
'2000375','1000002','0',0x00000000,'2','-1','-1','-1','-1','4','1073741824','0','/dev/rmt/0cbn','','0','0','0','2019/03/04 04:57:56.707122','2019/09/16 07:50:
40.611101'
'2000376','1000002','0',0x00000000,'2','-1','-1','-1','-1','4','1073741824','0','/dev/rmt/1cbn','','0','0','0','2019/03/04 04:57:56.756828','2019/09/16 07:50:
40.611149'

I try to delete the drive but failed 

root@devuarbak01 # tpconfig -delete -drpath -path /dev/rmt/0cbn -asciiname IBM.ULT3580-HH6.002
Failed to delete drive path with error 78.

 

May I know if I use the 

 

mph999
Level 6
Employee Accredited

Are those the complete tables ?

Yes it is related the two table information 

mph999
Level 6
Employee Accredited

OK - I will look when I have some time.

Problem here is that you are looking at manual SQL commands, and this is not really something for a forum, + these usually go via Engineering as it they can be destructve.

The problem still happen, may i know if there is any advice on this