dcache

dcache is a versatile storage management system. With lots of extentions. You can store your files on disk and tape.

dcache book

command reference

Show what port which dcache service is using

dcache ports

start all dcache services

systemctl start dcache.target

show dcache services on host

systemctl list-units -q dcache@*.service

pool commands

create new pool. Poolname 'pool1' part of domain: 'dCacheDomain'. Mountpoint where files and metadata are stored: /srv/dcache/pool-1

dcache pool create /srv/dcache/pool-1 pool1 dCacheDomain

file interactions

upload file through webdav door and simple authentication

curl -u tester:secret -l -t da_file http://localhost:2880/home/tester/da_file

http://localhost:2882 can also be viewed in the browser to get a simple webinterface for browsing files

admin interface

Login to dcache admin interface

ssh -p 22224 admin@localhost

show help of admin shell metacommand

\? \c

list cells

\l

connect to specific cell

\c PnfsManager

show filename and path of a pnfsid

Connect to the PnfsManager via admin interface and issue the following command

[localhost] (PnfsManager@dCacheDomain) admin > pathfinder 0000417C62828C1A47E9A5C321991E8D260D
/home/tester/tape/PXL_20250810_084619675.MP.jpg

get the pnfsid of a file

Connect to the PnfsManager and issue the following command

[localhost] (PnfsManager@dCacheDomain) admin > pnfsidof /home/tester/tape/PXL_20250810_084619675.MP.jpg
0000417C62828C1A47E9A5C321991E8D260D

Requesting a accesstoken

Most dCache instances are part of something called the EU GRID. And most of these support token authentication.

git clone https://github.com/sara-nl/GridScripts.git
cd GridScripts
./get-macaroon  --url https://your-dcache-address.com:443/data/users/you_username --duration P7D  --chroot  --user you_username  --permissions DOWNLOAD,UPLOAD,DELETE,MANAGE,LIST,READ_METADATA,UPDATE_METADATA,STAGE --output rclone tokenfile

--duration P7D: duration that the token is valid. In this case 7 days.
--chroot: changeroot the user to the path defined in the url. In this case: /data/users/you_username
--user: the user for which the token should be created
--permissions: which persmissions should the user get in dCache.
--output: Which output type should be used and what should be the filename. In this case: output format rclone and name tokenfile.conf

Now cat your tokenfile to find your bearer_token

grep bearer_token tokenfile.conf

api interface

when accessing a api door. you can look at a swagger interface to see all api calls you can make. This swagger ui makes it easy to try out different calls and will show the curl command you can use to replicate it form the commandline. https://127.0.0.1:443/api/v1/

cancel bulk-request

You can cancel a bulk-request using the requestID you got back from creating the bulk-request. You can either send a DELETE request or PATCH request. Here's an example on how to use the PATCH request method to cancel a bulk-request.

curl -i -H "Authorization: bearer $BEARER_TOKEN" -X PATCH "https://127.0.0.1/api/v1/bulk-requests/98fb3f62-a36f-275f-9abe-e1b461f5df32" -H  "accept: application/json" -H  "Content-Type: application/json" -d '{"action":"cancel"}'

dcache configuration file

Enable logging for multiple components. When you want to enable lots of logs, add the following to you /etc/dcache/dcache.conf

dcache.log.level.file=debug
dcache.log.level.pinboard=warn
dcache.log.level.remote=warn
dcache.log.level.events=warn
dcache.log.level.access=warn
dcache.log.level.zookeeper=warn

create a python interface to getting all the current properties from dCache

dcache loader -q compile -python

Check with service runs in which Domain

[root@localhost dcache]# dcache services
DOMAIN       SERVICE      CELL               PROXIED REPLICABLE
dCacheDomain zookeeper    zookeeper          -       No
dCacheDomain admin        admin              -       No
dCacheDomain pnfsmanager  PnfsManager        -       Yes
dCacheDomain poolmanager  PoolManager        -       Yes
dCacheDomain pinmanager   PinManager         -       Yes
dCacheDomain billing      billing            -       Yes
dCacheDomain cleaner-disk cleaner-disk       -       Yes
dCacheDomain gplazma      gPlazma            -       Yes
dCacheDomain webdav       WebDAV-localhost   No      No
dCacheDomain frontend     Frontend-localhost No      No
dCacheDomain bulk         bulk               -       Yes
pool1Domain  pool         pool1              -       No
tapePool1    pool         tapepool1          -       No

Add a very simple test hsm script for staging and unstaging files

or use the builtin provider copy

hsm create -command=/bin/cp -store=/hsmstor -retrieve=/hsmstor osm copy

upload a file to dcache using the webdav door and curl

curl -k -v -u username:password -L -T PXL_20250810_084341496.MP.jpg https://192.168.122.16:2880/home/tester/tape/PXL_20250810_084341496.MP.jpg

bulk stage files

curl -u username:password -L -H 'accept: application/json' --fail --show-error --ipv4 -H 'content-type: application/json' -X POST http://192.168.122.16:20443/api/v1/bulk-requests -d '{"activity": "PIN", "arguments": {"lifetime": "7", "lifetimeUnit":"DAYS"}, "target": ["/home/tester"], "expand_directories": "TARGETS"}'

delete stage request

curl -k -u username:password  -X DELETE "https://192.168.122.16:3880/api/v1/bulk-requests/98242567-b3f9-40b4-a452-60f66f3224be?cancelIfRunning=true" -H  "accept: application/json"

some example settings without further explanation

chimera commands

chimera mkdir /home/tester/tape
chimera chown 1000:1000 /home/tester/tape
chimera writetag /home/tester/tape hsmType osm
chimera writetag /home/tester/tape OSMTemplate 'StoreName generic'
chimera writetag /home/tester/tape sGroup tape
chimera writetag /home/tester/tape AccessLatency NEARLINE
chimera writetag /home/tester/tape RetentionPolicy CUSTODIAL

Pool Selection Unit (PSU) settings

psu set regex off
psu set allpoolsactive on

psu create unit -store *@*
psu create unit -store generic:tape@osm
psu create unit -net 0.0.0.0/0.0.0.0
psu create unit -net ::/0
psu create unit -protocol */*

psu create ugroup any-protocol
psu addto ugroup any-protocol */*

psu create ugroup any-store
psu addto ugroup any-store *@*

psu create ugroup tape-ugroup
psu addto ugroup tape-ugroup generic:tape@osm

psu create ugroup world-net
psu addto ugroup world-net 0.0.0.0/0.0.0.0
psu addto ugroup world-net ::/0

psu create pool pool1
psu create pool tapepool1

psu create pgroup default
psu addto pgroup default pool1

psu create pgroup tape-pools
psu addto pgroup tape-pools tapepool1

psu create link default-link any-protocol any-store world-net
psu set link default-link -readpref=10 -writepref=10 -cachepref=10 -p2ppref=-1
psu addto link default-link default

psu create link tape-link any-protocol tape-ugroup world-net
psu set link tape-link -readpref=10 -writepref=10 -cachepref=10 -p2ppref=-1
psu addto link tape-link tape-pools