User activities involving spaces

In this section, we show how an end-user might interact with SRM space reservations; these operations include discovering what tokens are available, querying the status of a token, uploading data using a token and releasing a token.

[return to top]

Discovering all available space tokens

A user may wish to identify all space tokens (the unique IDs) that have been created and into which she can place data. The srm-get-space-tokens does this:

Create a proxy certificate with gks membership
[user@ui-node] $ voms-proxy-init -voms gks
Enter GRID pass phrase:
Your identity: Your DN is here
Creating temporary proxy ................................... Done
Contacting  dgrid-voms.fzk.de:15025 [/O=GermanGrid/OU=FZK/CN=host/dgrid-voms.fzk.de] "gks" Done
Creating proxy .............................................. Done
Your proxy is valid until Sun Sep  7 10:25:36 2008

List all tokens that this user has access to
[user@ui-node] $ srm-get-space-tokens srm://dcache-node.fzk.de:8443
WARNING: SRM_PATH is defined, which might cause a wrong version of srm client to be executed
WARNING: SRM_PATH=/opt/d-cache/srm
Space Reservation Tokens:
10000

Create a proxy certificate with dech membership
[user@ui-node] $ voms-proxy-init -voms dech
Enter GRID pass phrase:
Your identity: Your DN is here
Creating temporary proxy ................................... Done
Contacting  glite-io.scai.fraunhofer.de:15025 [/O=GermanGrid/OU=Fraunhofer SCAI/CN=host/glite-io.scai.fraunhofer.de] "dech" Done
Creating proxy .............................................. Done
Your proxy is valid until Sun Sep  7 10:35:36 2008

List all tokens that this user has access to
[user@ui-node] $ srm-get-space-tokens srm://dcache-node.fzk.de:8443
WARNING: SRM_PATH is defined, which might cause a wrong version of srm client to be executed
WARNING: SRM_PATH=/opt/d-cache/srm
Space Reservation Tokens:
10000
10001

By changing which VO membership is presented to the SRM interface, different set of SRM space tokens are returned.

[return to top]

Discovering all tokens that match a description

The definition of a space reservations includes an optional description field. This is specified by the -desc option when reserving space through the administrator interface.

When creating the two spaces, both were given the same description: DISK.

[user@ui-node] $ srm-get-space-tokens -space_desc=DISK srm://dcache-node.fzk.de:8443
WARNING: SRM_PATH is defined, which might cause a wrong version of srm client to be executed
WARNING: SRM_PATH=/opt/d-cache/srm
Space Reservation Tokens:
10001

[return to top]

Querying a space reservation

Having identified various space reservations, the user wishes to know more information about them. The srm-get-space-metadata command queries the SRM for current information about the reservation.

Query the first space token
[user@ui-node] $ srm-get-space-metadata srm://dcache-node.fzk.de:8443 10000
WARNING: SRM_PATH is defined, which might cause a wrong version of srm client to be executed
WARNING: SRM_PATH=/opt/d-cache/srm
Space Reservation with token=10001
                   owner:VoGroup=/gks VoRole=NULL
               totalSize:30000
          guaranteedSize:30000
              unusedSize:30000
        lifetimeAssigned:-1
            lifetimeLeft:-1
           accessLatency:ONLINE
         retentionPolicy:REPLICA
Then query the second space token
[user@ui-node] $ srm-get-space-metadata srm://dcache-node.fzk.de:8443 10001
WARNING: SRM_PATH is defined, which might cause a wrong version of srm client to be executed
WARNING: SRM_PATH=/opt/d-cache/srm
Space Reservation with token=10001
                   owner:VoGroup=/dech VoRole=NULL
               totalSize:30000
          guaranteedSize:30000
              unusedSize:30000
        lifetimeAssigned:-1
            lifetimeLeft:-1
           accessLatency:ONLINE
         retentionPolicy:REPLICA

Note that anyone is allowed to query a space token.

[return to top]

Writing into a space reservation

Writing space into a reservation will cause data to be copied into dCache, but also that the available space will decrease.

[user@ui-node] $ srmcp -2 -space_token=10001 -retention_policy=REPLICA -access_latency=ONLINE file:////etc/group srm://dcache-node.fzk.de:8443/pnfs/fzk.de/data/dech/test-group
WARNING: SRM_PATH is defined, which might cause a wrong version of srm client to be executed
WARNING: SRM_PATH=/opt/d-cache/srm

Copy a second file using the same token.
[user@ui-node] $ srmcp -2 -space_token=10001 -retention_policy=REPLICA -access_latency=ONLINE file:////bin/arch srm://dcache-node.fzk.de:8443/pnfs/fzk.de/data/dech/test-arch
WARNING: SRM_PATH is defined, which might cause a wrong version of srm client to be executed
WARNING: SRM_PATH=/opt/d-cache/srm

Use SRM to list the files.
[user@ui-node] $ srmls -2 srm://dcache-node.fzk.de:8443/pnfs/fzk.de/data/dech
WARNING: SRM_PATH is defined, which might cause a wrong version of srm client to be executed
WARNING: SRM_PATH=/opt/d-cache/srm
  0 /pnfs/fzk.de/data/dech//
      611 /pnfs/fzk.de/data/dech//test-group
      4576 /pnfs/fzk.de/data/dech//test-arch

[return to top]

Releasing space from a reservation

The end user may release the reservation when they are finished with it.

[user@ui-node] $ srm-release-space -space_token=10001 srm://dcache-node.fzk.de:8443
WARNING: SRM_PATH is defined, which might cause a wrong version of srm client to be executed
WARNING: SRM_PATH=/opt/d-cache/srm

And verify that the token is gone.
[user@ui-node] $ srm-get-space-tokens srm://dcache-node.fzk.de:8443
WARNING: SRM_PATH is defined, which might cause a wrong version of srm client to be executed
WARNING: SRM_PATH=/opt/d-cache/srm

... also through the admin interface

It is also possible to release the space reservation through the administrator interface using the release command.