Cta-smc output oddity

I’ve noticed that with cta-smc the output is different from smc on Castor when querying the drives. cta-smc says the drive is unloaded when it is loaded -

smc -q D -D 4
4 260 loaded CT1318

cta-smc -q D -D 4
Drive Ordinal Element Addr. Status Vid
4 260 unloaded CT1318

Any reason for this or just a feature?

Tim

Hi Tim,

Doesn’t look like much of a feature to me - we’ll take a look.

Thanks,

Oliver.

Hi Tim,

Please could you send us the names and versions of the RPMs you used to install smc and cta-smc. I understand that you may not have used an RPM to install cta-smc so you can leave this out if this is the case. However I definitely want to know the RPM of smc.

Please could you also state which type of tape library you are using, IBM, Spectra or something else.

Regards,

Steve

Hi Tim,

So guessing what the problem is and going into more detail. My guess is that this is the support for Specta libraries. Here is smc the code for printing the status of a drive:

[itctabuild02] ~ > vi CTA/mediachanger/castorrmc/rmc/smc.c
...
 65 void smc_qdrive_humanPrint(const struct robot_info *const robot_info,
 66   const struct smc_element_info *const element_info, const int numberOfElements,
 67   const int useSpectraLib) {
 68   char *pstatus;
 69   int i;
 70   printf (TEXT_RED "Drive Ordinal\tElement Addr.\t  Status     Vid\n" TEXT_NORMAL);
 71   for (i = 0; i < numberOfElements; i++) {
 72     if (((element_info+i)->state & 0x1) == 0)
 73             pstatus = "free";
 74     else if ((element_info+i)->state & 0x4)
 75             pstatus = "error";
 76     else if ((element_info+i)->state & 0x8 && !useSpectraLib)
 77             pstatus = "unloaded";
 78     else
 79             pstatus = "loaded";
 80     printf ("%13d\t%13d\t%8s  %s\n",
 81             (element_info+i)->element_address-robot_info->device_start,
 82             (element_info+i)->element_address, pstatus,
 83             (element_info+i)->name);
 84   }
 85 }

The output changes based on whether or not the useSpectraLib variable is set to 0 or 1. The value of useSpectraLib is based on the contents of the /etc/castor/castor.conf file for smc and the contents of /etc/cta/cta-smc.conf for cta-smc.

The syntax of /etc/castor/castor.conf for setting useSpectraLib is:

[root@tpsrv338 ~]# grep SMC /etc/castor/castor.conf
SMC LIBRARY_TYPE SPECTRA
[root@tpsrv338 ~]# 

The syntax of /etc/cta/cta-smc.conf is the same:

[root@tpsrv336 ~]# grep SMC /etc/cta/cta-smc.conf 
SMC LIBRARY_TYPE SPECTRA
[root@tpsrv336 ~]# 

Hi Steve, you got it in one. The “SMC LIBRARY_TYPE SPECTRA” has not been configured. It works as expected when I add the line to the config. I’ll get the changes made on the servers.

Thanks again

Tim