Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Anchor
_Toc530411766
_Toc530411766
Data transfers with SRM

All the SRM specifications are available here [13].

In this case, a voms-proxy is needed (see above in the previous sections for details on proxy generation).

In case of local to remote transfer, you have to request the storage space in the destination filesystem and this is done with the command clientSRM PTP, where PTP stands for Prepare To Put. In case of remote to local transfer the command is clientSRM PTG, where PTG stands for Prepare To Get.

clientSRM PTP –v NIG -e httpg://storm-fe-archive.cr.cnaf.infn.it:8444 -s srm://storm-fe-archive.cr.cnaf.infn.it:8444/srm/managerv2?SFN=/virgo4/test.mt.002 
clientSRM PTG –v NIG -e httpg://storm-fe-archive.cr.cnaf.infn.it:8444 -s srm://storm-fe-archive.cr.cnaf.infn.it:8444/srm/managerv2?SFN=/virgo4/test.mt.002
where:
  • -v is the verbose level,
  • -e is used to specify the endpoint,
  • -s is used to specify the destination surl, which is composed by a space token (virgo4 in the example) and the file path. The space token will be communicated by the Experiment Support group.

and the complete list of options is listed by the command clientSRM PTP -help or in [17]. The output should be something like this:

...

-bash-4.2$ voms-proxy-init --voms virgo:/virgo/virgo
Enter GRID pass phrase for this identity:
Contacting voms-01.pd.infn.it:15009 [/DC=org/DC=terena/DC=tcs/C=IT/L=Frascati/O=Istituto Nazionale di Fisica Nucleare/CN=voms-01.pd.infn.it] "virgo"...
Remote VOMS server contacted succesfully.


Created proxy in /tmp/x509up_u10162.

Your proxy is valid until Tue Aug 18 22:45:07 CEST 2020
-bash-4.2$ voms-proxy-info --all
subject : /DC=org/DC=terena/DC=tcs/C=IT/O=Istituto Nazionale di Fisica Nucleare/CN=Andrea Rendina arendina@infn.it/CN=1185352064
issuer : /DC=org/DC=terena/DC=tcs/C=IT/O=Istituto Nazionale di Fisica Nucleare/CN=Andrea Rendina arendina@infn.it
identity : /DC=org/DC=terena/DC=tcs/C=IT/O=Istituto Nazionale di Fisica Nucleare/CN=Andrea Rendina arendina@infn.it
type : RFC3820 compliant impersonation proxy
strength : 1024
path : /tmp/x509up_u10162
timeleft : 11:57:53
key usage : Digital Signature, Key Encipherment
=== VO virgo extension information ===
VO : virgo
subject : /DC=org/DC=terena/DC=tcs/C=IT/O=Istituto Nazionale di Fisica Nucleare/CN=Andrea Rendina arendina@infn.it
issuer : /DC=org/DC=terena/DC=tcs/C=IT/L=Frascati/O=Istituto Nazionale di Fisica Nucleare/CN=voms-01.pd.infn.it
attribute : /virgo/virgo/Role=NULL/Capability=NULL
attribute : /virgo/Role=NULL/Capability=NULL
timeleft : 11:57:53
uri : voms-01.pd.infn.it:15009


In contrast to the gridFTP protocol, we have to contact a StoRM frontend on the door 8444. Then the frontend communicates the request to a backend [14].

The Virual Organizations use dedicated endpoint storm for data managemant and data transfer:

...

NO-LHC DISK and TAPE

storm-archive.cr.cnaf.infn.it

For example, AMS use storm-fe-ams for the disco area (/storage/gpfs_ams), but storm-archive to write on the buffer tape (/storage/gpfs_archive/ams).

Also, the path to read or write is not the real path on the filesystem, but all the experiments use a singular access path to the storage area.

Now we consider two tools for the SRM protocol: Gfal utils e ClientSRM.

2.3.1 Gfal utils


$ gfal-ls srm://storm-fe-archive.cr.cnaf.infn.it:8444/virgo4

L’access path “virgo4” punta (nella configurazione dell’endpoint storm) a /storage/gpfs_virgo/virgo4.

$ gfal-copy srm://storm-fe-archive.cr.cnaf.infn.it:8444/virgo4/prova_lucia_2905 .

Copying srm://storm-fe-archive.cr.cnaf.infn.it:8444/virgo4/

...

prova_lucia_2905   [DONE]  after 4s

$ gfal-rm srm://storm-fe-archive.cr.cnaf.infn.it:8444/virgo4/prova_lucia_2905

srm://storm-fe-archive.cr.cnaf.infn.it:8444/virgo4/prova_lucia_2905 DELETED

$ gfal-copy /etc/services srm://storm-fe-archive.cr.cnaf.infn.it:8444/virgo4/prova_lucia

Copying file:///etc/services   [DONE]  after 4s

$ gfal-sum srm://storm-fe-archive.cr.cnaf.infn.it:8444/virgo4/prova_lucia ADLER32

srm://storm-fe-archive.cr.cnaf.infn.it:8444/virgo4/prova_lucia 6408a0a8

(Di default, StoRM salva per i file che processa il checksum di tipo ADLER32 in un attributo dedicato:

# getfattr -d /storage/gpfs_virgo4/virgo4/prova_lucia

getfattr: Removing leading '/' from absolute path names

# file: storage/gpfs_virgo4/virgo4/prova_lucia

user.storm.checksum.adler32="6408a0a8"

)

Tutti i comandi gfal: https://dmc-docs.web.cern.ch/dmc-docs/gfal2-util.html


2.3.2 clientSRM utils:


Con questi tool:

  • leggere un file equivale a fare una clientSRM PrepareToGet, una o più clientSRM StatusPrepareToGet, globus-url-copy.
  • scrivere un file equivale a fare una clientSRM PrepareToPut, una o più clientSRM StatusPrepareToPut, globus-url-copy e una clientSRM PutDone.


Tutti questi passaggi di cui gfal è un wrapper semplificato possono essere utili per debuggare e capire dove sta un problema (se lato backend o lato gridftp).

Esempio di scrittura:

(obbligatorio specificare l’endpoint con la porta e il SURL su cui si vuole andare a scrivere)

$ clientSRM PtP -

It is important to pay attention to the request token, which will be used later. Then it is necessary to check the status of the request with clientSRM SPTP (Status of Prepare To Put) or clientSRM SPTG (Status of Prepare To Get).

clientSRM SPTP -v -e httpg://storm-fe-archive.cr.cnaf.infn.it:8444 -t fd5256b6-5cb3-4fe2-a82d-3ba316f1f1f8
clientSRM SPTG -v -e httpg://storm-fe-archive.cr.cnaf.infn.it:8444 -t fd5256b6-5cb3-4fe2-a82d-3ba316f1f1f8where with –t you provide the token shown in the output of the clientSRM PTP command. The output will show you whether the request is successful in the status field.s srm://storm-fe-archive.cr.cnaf.infn.it:8444/virgo4/prova_lucia

============================================================

Sending StatusPtP PtP request to: httpg://storm-fe-archive.cr.cnaf.infn.it:8444

Before execute:

Afer execute:

Request Status Code 017

Poll Flag 0

============================================================

Request status:statusCode

  statusCode="SRM_SUCCESSREQUEST_QUEUED"(0)
explanation="All chunks successfully handled!"17)

============================================================

SRM Response:  arrayOfFileStatuses (size=1)
      \[0\

  requestToken="f0d142d9-06d0-46a0-a822-d9903ab051f9"

  arrayOfFileStatuses (size=1)

   [0] SURL="srm://storm-fe-archive.cr.cnaf.infn.it:8444/virgo4/test.mt.002prova_lucia"      \

   [0\] status: statusCode="{*}SRM_SPACE_AVAILABLE{*}REQUEST_QUEUED"(2417)            

               explanation=""

===============srmPrepareToPut successfully handled!"
      \[0\] *TURL="gsiftp://gridftp-storm-archive.cr.cnaf.infn.it:2811//storage/gpfs_virgo4/virgo4/test.mt.002"*
============================================================

It is important to remember the TURL which will be used in transfer command with globus-url-copy command. After that we can perform the file transfer. In case of local to remote:

...

Verificare lo status passando il token (step che può essere evitato con l’opzione -p a clientSRM PtP):

$ clientSRM SPtP -e httpg://storm-fe-archive.cr.cnaf.infn.it:

...

8444 -t "f0d142d9-06d0-46a0-a822-d9903ab051f9"

============================================================

Sending StatusPtP request to: httpg://storm-fe-archive.cr.cnaf.infn.it:8444

Before execute:

Afer execute:

Request Status Code 0

Poll Flag 0

============================================================

Request status:

  statusCode="SRM_SUCCESS"(0)

  explanation="All chunks successfully handled!"

============================================================

SRM Response:

  arrayOfFileStatuses (size=1)

   [0] SURL="srm://storm-fe-archive.cr.cnaf.infn.it:8444/virgo4/prova_lucia"

   [0] status: statusCode="SRM_SPACE_AVAILABLE"(24)

               explanation="srmPrepareToPut successfully handled!"

   [0] TURL="gsiftp://ds-915.cr.cnaf.infn.it:2811//storage/gpfs_virgo4/virgo4/prova_lucia"

============================================================

Il TURL così ottenuto (notare che contiene un gridftp di storm-archive, ds-915) può essere usato per fare la copia su file locale “copia”:

$ globus-url-copy gsiftp://ds-915.cr.cnaf.infn.it:2811//storage/gpfs_virgo4/virgo4/prova_lucia copia

Occorre terminare con una PutDone, perché la richiesta non resti aperta nel database di StoRM:

$ clientSRM Pd -e httpg://storm-fe-archive.cr.cnaf.infn.it:8444 -t "9bcfa6fa-8626-4f8e-a1a3-0947fc449736" -s srm://storm-fe-archive.cr.cnaf.infn.it:8444/virgo4/prova_lucia

============================================================

Sending PutDone request to: httpg://storm-fe-archive.cr.cnaf.infn.it:8444

Before execute:

Afer execute:

Request Status Code 0

Poll Flag 0

============================================================

Request status:

  statusCode="SRM_SUCCESS"(0)

  explanation="All file requests are successfully completed"

============================================================

SRM Response:

  arrayOfFileStatuses (size=1)

   [0] SURL="srm://storm-fe-archive.cr.cnaf.infn.it:8444/virgo4/prova_lucia"

   [0] status: statusCode="SRM_SUCCESS"(0)

               explanation="Success"

============================================================




Tutti i comandi clientSRM: https://italiangrid.github.io/storm/documentation/clientsrm-guide/

In case of local to remote transfer, you have to request the storage space in the destination filesystem and this is done with the command clientSRM PTP, where PTP stands for Prepare To Put. In case of remote to local transfer the command is clientSRM PTG, where PTG stands for Prepare To Get.

clientSRM PTP –v NIG -e httpg://storm-fe-archive.cr.cnaf.infn.it:8444 -s srm://storm-fe-archive.cr.cnaf.infn.it:8444/srm/managerv2?SFN=/virgo4/test.mt.002 
clientSRM PTG –v NIG -e httpg://storm-fe-archive.cr.cnaf.infn.it:8444 -s srm://storm-fe-archive.cr.cnaf.infn.it:8444/srm/managerv2?SFN=/virgo4/test.mt.002
where:
  • -v is the verbose level,
  • -e is used to specify the endpoint,
  • -s is used to specify the destination surl, which is composed by a space token (virgo4 in the example) and the file path. The space token will be communicated by the Experiment Support group.

and the complete list of options is listed by the command clientSRM PTP -help or in [17]. The output should be something like this:

============================================================
Behavior:
poll: 0
verbose level: NIG
============================================================
Input data:
authorizationID=NULL
storageSystemInfo=NULL
arrayOfFileRequests (size=1)
\[0\] targetSURL="srm://storm-fe-archive.cr.cnaf.infn.it:8444/srm/managerv2?SFN=/virgo4/test.mt.002"
\[0\] expectedFileSize=NULL
userRequestDescription=NULL
overwriteOption=NULL
desiredTotalRequestTime=NULL
desiredPinLifeTime=NULL
desiredFileLifeTime=NULL
desiredFileStorageType=NULL
targetSpaceToken=NULL
targetFileRetentionPolicyInfo=NULL
transferParameters=NULL
============================================================
Sending PtP request to: httpg://storm-fe-archive.cr.cnaf.infn.it:8444
Before execute:
Afer execute:
Request Status Code 17
Poll Flag 0
============================================================
Request status:
statusCode="SRM_REQUEST_QUEUED"(17)
explanation=NULL
============================================================
SRM Response:
requestToken="{*}fd5256b6-5cb3-4fe2-a82d-3ba316f1f1f8{*}"
remainingTotalRequestTime=NULL
arrayOfFileStatuses (size=1)
\[0\] SURL="srm://storm-fe-archive.cr.cnaf.infn.it:8444/virgo4/test.mt.002"
\[0\] status: statusCode="SRM_REQUEST_QUEUED"(17)
explanation=""
\[0\] fileSize=NULL
\[0\] estimatedWaitTime=NULL
\[0\] remainingPinLifetime=NULL
\[0\] remainingFileLifetime=NULL
\[0\] TURL=NULL
\[0\] transferProtocolInfo=NULL
============================================================

It is important to pay attention to the request token, which will be used later. Then it is necessary to check the status of the request with clientSRM SPTP (Status of Prepare To Put) or clientSRM SPTG (Status of Prepare To Get).

clientSRM SPTP -v -e httpg://storm-fe-archive.cr.cnaf.infn.it:8444 -t fd5256b6-5cb3-4fe2-a82d-3ba316f1f1f8
clientSRM SPTG -v -e httpg://storm-fe-archive.cr.cnaf.infn.it:8444 -t fd5256b6-5cb3-4fe2-a82d-3ba316f1f1f8

where with –t you provide the token shown in the output of the clientSRM PTP command. The output will show you whether the request is successful in the status field.

============================================================
Sending StatusPtP request to: httpg://storm-fe-archive.cr.cnaf.infn.it:8444
Before execute:
Afer execute:
Request Status Code 0
Poll Flag 0
============================================================
Request status:
statusCode="SRM_SUCCESS"(0)
explanation="All chunks successfully handled!"
============================================================
SRM Response:
  arrayOfFileStatuses (size=1)
      \[0\] SURL="srm

or in case of remote to local:

globus-url-copy gsiftp://gridftp-storm-archive.cr.cnaf.infn.it:2811//storage/gpfs_virgo4/virgo4/test.mt.002* *file:///<local_path>/file

The full list of the available options is available using:

man globus-url-copy

Some useful options:

  • -f FILENAME : Read a list of URL pairs from filename. Each line should contain sourceURL destURL. Enclose URLs with spaces in double qoutes ("). Blank lines and lines beginning with # will be ignored.
  • -df FILENAME, -dumpfile FILENAME : Path to a file where untransferred URLs will be saved for later restarting. Resulting file is the same format as the -f input file. If file exists, it will be read and all other URL input will be ignored.
  • -cd, -create-dest : Create destination directory if needed.
  • -r : Copy files in subdirectories
  • -v, -verbose : Display URLs being transferred
  • -p PARALLELISM, -parallel PARALLELISM : pecify the number of parallel data connections should be used.
  • -list URL : List the files located at URL.
  • -sync : Only transfer files where the destination does not exist or differs from the source. -sync-level controls how to determine if files differ.
  • -sync-level number : Criteria for determining if files differ when performing a sync transfer. The default sync level is 2.
    The available levels are:
    • Level 0: will only transfer if the destination does not exist.
    • Level 1: will transfer if the size of the destination does not match the size of the source.
    • Level 2: will transfer if the time stamp of the destination is older than the time stamp of the source.
    • Level 3: will perform a checksum of the source and destination and transfer if the checksums do not match.

To list the file in a directory, you can use the command clientSRM LS.

...

://storm-fe-archive.cr.cnaf.infn.it:8444

...

/virgo4/test.mt.002"
      \[0\] status: statusCode="{*}SRM_SPACE_AVAILABLE{*}"(24)
             explanation="srmPrepareToPut successfully handled!"
      \[0\] *TURL="gsiftp://gridftp-storm-archive.cr.cnaf.infn.it:

...

2811//

...

More information on using SRM clients can be found here [18].

...

storage/gpfs_virgo4/virgo4/test.mt.002"*
============================================================

It is important to remember the TURL which will be used in transfer command with globus-url-copy command. After that we can perform the file transfer. In case of local to remote:

globus-url-copy file:///<local_path>/file gsiftp://gridftp-storm-archive.cr.cnaf.infn.it:2811//storage/gpfs_virgo4/virgo4/test.mt.002

or in case of remote to local:

globus-url-copy gsiftp://gridftp-storm

...

-archive.cr.cnaf.infn.it:

...

2811//

...

storage/gpfs_virgo4/virgo4/test.mt.

...

  • -b option. If this flag is present, it means that you don't want to make BDII calls to get SE type. So, you must provide the type of the SE for srm: arguments, and full endpoint in SURLs.
  • -v option. Verbose mode. You can specify it twice for extra verbose mode.
  • -D option specifies the default SE type you want to use. Possible values are none, se, srmv1, srmv2, for respectively no default type, classic SE, SRMv1, and SRMv2. But if according to the BDII the default type is not available for this SE, it will use another type.
  • --vo option for virtual organization.

More options can be find with the command man lcg-cp.
Most used commands are:

...

002* *file:///<local_path>/file

The full list of the available options is available using:

man globus-url-copy

Some useful options:

  • -f FILENAME : Read a list of URL pairs from filename. Each line should contain sourceURL destURL. Enclose URLs with spaces in double qoutes ("). Blank lines and lines beginning with # will be ignored.
  • -df FILENAME, -dumpfile FILENAME : Path to a file where untransferred URLs will be saved for later restarting. Resulting file is the same format as the -f input file. If file exists, it will be read and all other URL input will be ignored.
  • -cd, -create-dest : Create destination directory if needed.
  • -r : Copy files in subdirectories
  • -v, -verbose : Display URLs being transferred
  • -p PARALLELISM, -parallel PARALLELISM : pecify the number of parallel data connections should be used.
  • -list URL : List the files located at URL.
  • -sync : Only transfer files where the destination does not exist or differs from the source. -sync-level controls how to determine if files differ.
  • -sync-level number : Criteria for determining if files differ when performing a sync transfer. The default sync level is 2.
    The available levels are:
    • Level 0: will only transfer if the destination does not exist.
    • Level 1: will transfer if the size of the destination does not match the size of the source.
    • Level 2: will transfer if the time stamp of the destination is older than the time stamp of the source.
    • Level 3: will perform a checksum of the source and destination and transfer if the checksums do not match.

To list the file in a directory, you can use the command clientSRM LS.

clientSRM Ls -e httpg://storm-fe-archive.cr.cnaf.infn.it:8444 -s srm://storm-fe-archive.cr.cnaf.infn.it:8444/srm/managerv2?SFN=/virgo4/

More information on using SRM clients can be found here [18]

...

.

Anchor
_Toc530411768
_Toc530411768
Gfal

...