Change Storage Class
Introduction¶
This tool will soon be changed to avoid the use of gRPC.
The cta-change-storage-class
tool changes the storage class for a file in both the EOS namespace and in the CTA Catalogue. The script is written in python and uses cta-change-storage-class-in-catalogue the change the storage class on the CTA side, while using the acl tool to change the storage class on the EOS side Two examples of usage are:
- Changing the storage class for specified files.
- Going from single to dual copy.
Procedure¶
The workflow when using the tool is as follows:
- Create a storage class or make sure that the new storage class exists.
- If new files that are going to tape should inherit the new storage class from the parent directory, the extended attribute
sys.archive.storage_class
of the directory must be set manually. - Use
cta-change-storage-class
to change the storage class in the EOS namespace and in the CTA catalogue. - Perform a repack
To use the tool call:
cta-change-storage-class --id/-I <archiveFileID> | --json/-j <path> --storageclassname/-n <storageClassName> [--frequency/-t <eosRequestFrequency>]
where the JSON file is a text file with one JSON object for each line. The tool will check if the archive ID exists in the CTA catalogue. Example of JSON file:
{"archiveId": '${EOS_ARCHIVE_ID_1}', "fid": '${EOS_FILE_ID_1}', "instance": "'${EOSINSTANCE}'"}
{"archiveId": '${EOS_ARCHIVE_ID_2}', "fid": '${EOS_FILE_ID_2}', "instance": "'${EOSINSTANCE}'"}
{"archiveId": '${EOS_ARCHIVE_ID_3}', "fid": '${EOS_FILE_ID_3}', "instance": "'${EOSINSTANCE}'"}
...
The tool should be run from the frontend as it needs access to both EOS and the catalogue. This means that cta-cli.conf
must be copied to the frontend. cta-cli
should be placed in /etc/cta
..
To set up kerberos for the frontend:
- Check that a keytab file for the CTA admin user is present, in this example
/root/
- Run kinit: ```KRB5CCNAME=/tmp/${CTAADMIN_USER}/krb5cc_0 kinit -kt /root/${CTAADMIN_USER}.keytab ${CTAADMIN_USER}@TEST.CTA````
For details please refer to the tool`s specific command line arguments and/or configuration files.