# Setting up your dCache pool

Once you've installed the _dcache-cta_ plugin, you must complete the following steps to activate it. \
Note that you have all of this information on the README.md file of the plugin too.

#### **Create an hsm instance**

To activate the plugin, we have to create an hsm instance that points at it. You can create an hsm instance either through the dCache admin shell or editing the pool setup file. Either way, this should be the syntax:

```bash
hsm create <hsmType> <hsmName> <plugin> -cta-user
     -cta-group -cta-instance-name
     -cta-frontend-addr
     [-cta-ca-chain] [-cta-use-tls] 
     [-io-endpoint] [-io-port]
```

This table contains the description of the parameters shown above:

<table><thead><tr><th width="210">Name</th><th width="309">Description</th><th width="100">required</th><th>default</th></tr></thead><tbody><tr><td>cta-instance-name</td><td>The dCache instance name configured in CTA</td><td>yes</td><td>-</td></tr><tr><td>cta-frontend-addr</td><td>The CTA <code>cta-dcache</code> endpoint</td><td>yes</td><td>-</td></tr><tr><td>cta-user</td><td>The dCache instance associated user in CTA</td><td>yes</td><td>-</td></tr><tr><td>cta-group</td><td>The dCache instance associated group in CTA</td><td>yes</td><td>-</td></tr><tr><td>cta-ca-chain</td><td>The path to CA root chain for use with TLS</td><td>no</td><td>-</td></tr><tr><td>cta-use-tls</td><td>A switch (true/false) to enable TLS for CTA control connection</td><td>no</td><td>false</td></tr><tr><td>io-endpoint</td><td>The hostname or IP offered by dCache for IO by CTA</td><td>no</td><td>hostname</td></tr><tr><td>io-port</td><td>The TCP port offered by dCache for IO by CTA</td><td>no</td><td>-</td></tr></tbody></table>

A basic example of an hsm string would be:

```bash
hsm create osm cta dcache-cta -cta-user=ctauser -cta-group=ctagroup -cta-instance-name=ctainstance -cta-frontend-addr=<IP>:<port> 
```

This will define the storage-uri format of the stored files as follows:&#x20;

```
<hsmType>://<hsmName>/<pnfsid>?arichiveid=<id>
```

Where `pnfsid` is the dCache id, and the `archiveId` is the CTA internal id. For example:

```
osm://cta/00001D43C0C086CA459298C634D67F68AB6B?archiveid=8402
```

If you need to modify your hsm instance, you can either :

* Modify the hsm string on the setup file of your pool (that is _`$poolHomeDir/$poolName/setup`_) and reload to save the changes:

```bash
vim /dcpool/vpool1/setup 
systemctl daemon-reload
```

* Use the dCache admin shell to list, remove, and change your hsm definitions with the following commands:

<pre class="language-bash"><code class="lang-bash"><strong>\s &#x3C;pool> hsm ls [&#x3C;instances>]...  # list nearline storages
</strong>\s &#x3C;pool> hsm remove &#x3C;instance>  # remove nearlinestorage definition
\s &#x3C;pool> hsm set [-&#x3C;key>[=&#x3C;value>]] ... &#x3C;instance>  # set nearline storage options
\s &#x3C;pool> hsm show providers # list available providers
\s &#x3C;pool> hsm unset -&#x3C;key> ... &#x3C;instance>  # unset nearline storage options
\s &#x3C;pool> save # save your changes
</code></pre>

#### **Set the queue class**

As CTA has its own scheduler and flush/restore queue the dCache pools should be configured to submit as much request as possible. Thus grouping and collecting request on the pool side should be disabled, putting all values to 0:

```bash
queue define class -expire=0 -pending=0 -total=0 -open <hsmType> *
```
