Skip to content

Instantly share code, notes, and snippets.

@femiadeyemi
Last active October 8, 2019 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save femiadeyemi/4db7fc202ac589842c6d3865cfce4512 to your computer and use it in GitHub Desktop.
Save femiadeyemi/4db7fc202ac589842c6d3865cfce4512 to your computer and use it in GitHub Desktop.
dCache Storage Resource Reporting

dCache Instance and Its Information

GLUE Infomation Provider is a component in dCache that provides a detailed description of a dCache instance. This component needs to be enabled and it is configurable. Detail information on how to enable and configure this service can be find inside dCache book.

Storage Resource Reporting

The WLCG Storage Space accounting project has a goal of enabling the high level overview of the total and available space provided by the WLCG infrastructure. dCache support WLCG Storage Resource Reporting, which is for service discovery and reporting capacity usage.

How to Configure Storage Resource Reporting in dCache

  1. Enable and configure GLUE Infomation Provider, see here for detail instruction.

  2. dCache comes with a batch script called dcache-storage-descriptor. When run, the script will takes information from the XML data provided by the info service. This XML data is now used to generates JSON-formatted data conforming to the WLCG Storage Descriptor specification.

<full-path-to-the-script> <url-endpoint-of-info-provider>

E.g, let say your info provider endpoint is at http://localhost:2288/info and if you are running RPM or DEP package, from the terminal, you will need to run:

/usr/sbin/dcache-storage-descriptor http://localhost:2288/info 
  1. After running the script, the path to the result will be shown. You should see something like:
JSON available at /var/spool/dcache/storage-descriptor.json

To make this json file available to dCache user, you can now upload the file into dCache via any of supported protocols in dCache, like:

  • NFS mount: Say you want to make sure the file is made available in dCache root directory, in the terminal run the following:
    mount -o vers=4.1 localhost:/ /var/spool/dcache/
    
  • WebDAV: you can use curl or wget command. Here is an example using curl with username+password for authentication:
    curl -u fakeUser:fakePassword \
    -T /var/spool/dcache/storage-descriptor.json \
    http://dcache-webdav-door.example.org:2880/specific-path/
    
    Different authentication schemes (like X.509, username+password, Kerberos, Macaroon, trusted-host, OIDC, ...) are supported in dCache, please see webdav user guide for more information.

It worth mentioning that this script might be run from a cron job and everything might be automated so that the result or the output is uploaded into dCache. As noted earlier, the upload can be done via any of supported protocols in dCache, like:

  • NFS mount
  • WebDAV
  • gridftp
  • xRootD, etc.

Please note that the path to the script and the output of the result depend on the package you are running and your configuration.

Configurable properties of dCache Storage Descriptor

Below is table that comprises list of configurable storage's properties and their definitions. Note that any value that with ${...} indicate that the value depends on either dcache properties or the package.

Properties Definition Default value Possible values
storage-descriptor.name The human-readable name that describes this dCache instance.
storage-descriptor.unique-id A unique identifier for your dCache instance. dcache.example.org
storage-descriptor.quality-level The "quality" of the dCache instance. production development or testing or pre-production or production
storage-descriptor.http.host Configuration options on where to fetch dynamic information. The name of the machine that is running the dCache web server. This is used to build the URI for fetching dCache's current state. localhost
storage-descriptor.http.port The TCP port the dCache web server is running on. This is used to build the URI for fetching dCache's current state. 2288
storage-descriptor.paths.tape-info Nearline accounting. The location of the nearline storage XML file. Sites with nearline storage should modify this value to point to a file that they maintain. Sites without nearline storage should leave this value alone. ${dcache.paths.share}/xml/tape-info-empty.xml
storage-descriptor.door.tag Login-provider tag. The tag that doors identify themselves with before they are published. storage-descriptor
storage-descriptor.output.path Output path. The location where the JSON output is written. /var/spool/dcache/storage-descriptor.json or ${dcache.home}/var/spool/dcache/storage-descriptor.json
storage-descriptor.xslt.path XSLT path. The location of the XSLT stylesheet that transforms the info service's XML into the Storage Descriptor JSON format. ${dcache.paths.share}/xml/xslt/storage-descriptor.xsl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment