-
Notifications
You must be signed in to change notification settings - Fork 4
Configure Phobos
To configure Phobos, you can use the configuration file provided, which is by default located at /etc/phobos.conf
.
This file is used both by the client when doing operations, and by the daemon to change its behavior.
We will in this page detail some values of that configuration and their purpose, but not every one of them, so we invite you to check the template file doc/cfg/template.conf
to know about all available parameters and what they correspond to.
The file uses the .ini format for managing information.
Each parameter is referenced under a specific section, and is of the form key = value
.
As the database is managed by PostgreSQL, Phobos needs to know what database to access and how.
This is specified by the connect_string
key in the dss
section.
The value associated should contain the following 4 parameters: dbname
(database name), host
(host of the database, useful to have the database on another node), user
and password
.
For instance, the string used for the non-regression testing is:
[dss]
connect_string = dbname=phobos host=localhost user=phobos password=phobos
Regarding the Phobos daemon, the parameters are referenced under the lrs
section.
The main ones to reference are the following:
- handled resource families, which are the type of resource that the Phobos can manage. Currently, Phobos can manage tapes, directories and RADOS pools. The key is
families
, and the value must be specified as a list of strings separated only by a comma, as such:
[lrs]
families = tape,dir,rados_pool
- the path of the tape library control device, with the key
lib_device
and the path as value:
[lrs]
lib_device = /dev/changer
- the socket for communications between clients and the daemon, with the key
server_socket
and the path as value:
[lrs]
server_socket = /run/phobosd/lrs
There is only one parameter for the section lib_scsi
, but it is a extremely important.
When using the library (such as when running phobos lib scan
), if Phobos returns an "invalid argument" error, and when you check the logs you see the following:
<WARNING> SCSI ERROR: scsi_masked_status=0x1, adapter_status=0, driver_status=0x8
<WARNING> req_sense_error=0x70, sense_key=0x5 (Illegal Request)
<WARNING> asc=0x24, ascq=0 (Additional sense: Invalid field in cbd)
<ERROR> Sense key 0x5 (converted to -22): Invalid argument
<ERROR> scsi_element_status failed for type 'drives': Invalid argument
It may be a tape library limitation. For some type of tape libraries, for instance IBM libraries, one can't query a drive's serial number and it's volume label in the same request. To prevent this, Phobos can separate the query in two by activating the parameter 'sep_sn_query' in the [lib_scsi]
section, with the value either 0
to not separate the requests or 1
to separate them.
[lib_scsi]
sep_sn_query = 0
To use LTFS, Phobos has 3 parameters in the ltfs
section that specify the mount, umount and format commands, respectively cmd_mount
, cmd_umount
and cmd_format
.
The values of these keys is a command that will be called by Phobos, so for instance another program.
This is the case for our configurations of Phobos, as we propose a wrapper for these commands, located here:
[ltfs]
cmd_mount = /usr/sbin/pho_ldm_helper mount_ltfs "%s" "%s"
cmd_umount = /usr/sbin/pho_ldm_helper umount_ltfs "%s" "%s"
cmd_format = /usr/sbin/pho_ldm_helper format_ltfs "%s" "%s"
In these commands, you can see the internal wraper (pho_ldm_helper
), the operation to execute (mount, unmount and format), and the arguments for the operation (the two "%s"
).
The store
section specifies parameters pertaining to object management.
For instance, you can specify the default family to use for put operations with the key default_family
and a value corresponding to the family as specified in the lrs
section above:
[store]
default_family = tape
Other parameters like the the default layout or alias can be specified, but they will be explained in Advanced usage.
Finally, the last sections specify information regarding the different drive models and tape models Phobos can manage, and the compatibility rules between them.
The drive models implementing each generation of drive are specified under the drive_type "<generation>_drive"
sections, and just have the key models
with value a list of drive models separated by commas.
For instance, for LTO6
drives, you will have the following configuration:
[drive_type "LTO5_drive"]
models = ULTRIUM-TD5,ULT3580-TD5,ULTRIUM-HH5,ULT3580-HH5,HH LTO Gen 5
In the same manner, you can specify the list of managed tapes in the section tape_model
, by using the supported_list
key, with the value a list of tape models separated by commas.
By default, Phobos support a list of tape model, which is: LTO5, LTO6, LTO7, LTO8, T10KB, T10KC, T10KD
.
For instance, you can define the list of tape managed by your Phobos system with:
[tape_model]
supported_list = LTO5,LTO6,LTO8,T10KB
Finally, you can define the compatibility rules between tapes and drives in the sections tape_type "<tape_model>"', with the key
drive_rwand the corresponding to the drive models specified as sections above. For instance, here are the compatibility rules for the
LTO6` tapes:
[tape_type "LTO6"]
drive_rw = LTO6_drive,LTO7_drive
While you can modify the configuration file and restart the daemon, you can also specified each of these parameters by using environment variables. The variables should be of the form PHOBOS_<section in capital>_<parameter key> = <parameter value>"
.
For instance, you can export the following variables:
export PHOBOS_LRS_families="dir"
export PHOBOS_STORE_default_family="dir"
export PHOBOS_LTFS_cmd_mount="sh -c 'exit 1'"
Finally, even if you do not specify every parameter defined in the configuration file, Phobos can still operate, as we have default values for these parameters.