Templates

Templates are enabling easy and consistent setup and usage tracking for a collection of large number of volumes and their snapshots with common attributes, for example replication, placement groups, and/or common parent snapshot. For details on managing the corresponding entities with the CLI, see Volumes, Snapshots, and Placement groups.

Command parameters

You can perform template operations on the command line using the storpool template command:

  • When there is no template name specified you can use the list and status parameters.

  • When there is a template name specified you can use the parameters listed in Template parameters.

Creating templates

To create a template you should set its name and the replication, and optionally other parameters:

# storpool template nvme replication 3 placeAll nvme
OK
# storpool template magnetic replication 3 placeAll hdd
OK
# storpool template hybrid replication 3 placeAll hdd placeTail ssd
OK
# storpool template ssd-hybrid replication 3 placeAll ssd placeHead hdd
OK

For details about the parameters used when creating a template, see Template parameters.

Listing templates

To list all created templates:

# storpool template list
-------------------------------------------------------------------------------------------------------------------------------------
| template             |   size  | rdnd. | placeHead   | placeAll   | placeTail  |   iops  |    bw   | parent               | flags |
-------------------------------------------------------------------------------------------------------------------------------------
| magnetic             |       - |     3 | nvme        | nvme       | nvme       |       - |       - |                      |       |
| magnetic             |       - |     3 | hdd         | hdd        | hdd        |       - |       - |                      |       |
| hybrid               |       - |     3 | hdd         | hdd        | ssd        |       - |       - |                      |       |
| ssd-hybrid           |       - |     3 | hdd         | ssd        | ssd        |       - |       - |                      |       |
-------------------------------------------------------------------------------------------------------------------------------------

Please refer to Redundancy for more info on replication and erasure coding schemes (shown in rdnd. above).

Getting the status of templates

To get the status of all templates with detailed info on the usage and the available space left with this placement:

# storpool template status
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| template             | place head |  place all | place tail | rdnd. | volumes | snapshots/removing |     size |  capacity |   avail. |  avail. all |  avail. tail |  avail. head | flags |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| magnetic             | hdd        | hdd        | hdd        |     3 |     115 |       631/0        |   28 TiB |    80 TiB |   52 TiB |     240 TiB |      240 TiB |      240 TiB |       |
| hybrid               | hdd        | ssd        | hdd        |     3 |     208 |       347/9        |   17 TiB |    72 TiB |   55 TiB |     240 TiB |       72 TiB |      240 TiB |       |
| ssd-hybrid           | ssd        | ssd        | hdd        |     3 |      40 |         7/0        |    4 TiB |    36 TiB |   36 TiB |     240 TiB |       72 TiB |      240 TiB |       |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Template parameters

When there is a template name specified to the storpool volume command you can use the following parameters:

bw

Set maximum bandwidth limit (in MB/s).

delete

Delete the template.

iops

Set the maximum IOPS limit for this snapshot (in IOPS).

limitType

Specify whether iops and bw limits ought to be for the total size of the block device or per each GiB (one of “total” or “perGiB”).

parent

Set parent snapshot for all volumes created in this template.

placeAll

Place objects in the specified “All” placement group. Default: default.

placeHead

Use the specified “Head” placement group. Default: same as the value of placeAll value.

placeTail

Use the specified “Tail” placement group. Default: same as the value of placeAll.

propagate

Required when changing parameters on an already created template. Used for specifying if the changes would have to be modified on all existing volumes and/or snapshots created with this template. This parameter is required regardless whether any volumes or snapshots have been created with the template. The values you can use are yes and no.

rename

Rename the template.

replication

Change the number of copies for volumes or snapshots created with this template.

Attention

Dropping the replication (for example, from triple to dual) of a large number of volumes is an almost instant operation. However, returning them back to triple is similar to creating the third copy for the first time. This is why changing replication to less than the present (for example, from 3 to 2) will require using replicationReduce as a safety measure.

replicationReduce

Reduce the replication of an existing template.

reuseServer

Place multiple copies on the same server.

size

Default size if not specified for each volume created with this template.

Here is an example. To change template’s parameters directly you should specify its name (like hdd-only or hybrid), and then add the required parameters:

# storpool template hdd-only size 120G propagate no
OK
# storpool template hybrid size 40G iops 4000 propagate no
OK

Modifying existing templates

The example below shows how to change the bandwidth limit for all volumes and snapshots created with the already existing template magnetic:

# storpool template magnetic bw 100MB propagate yes
OK

When using the storpool template $TEMPLATE propagate yes command (as in the example above), all the parameters of $TEMPLATE will be re-applied to all volumes and snapshots created with it.

Note

Changing template parameters with propagate option will not automatically re-allocate content of the existing volumes on disks. If replication or placement groups are changed, run balancer (see Rebalancing the cluster) to apply new settings on the existing volumes. However if the changes are made directly to the volume instead to the template, running a balancer will not be required.

Renaming templates

To rename a template:

# storpool template magnetic rename backup
OK

Deleting templates

To delete a template:

# storpool template hdd-only delete hdd-only
OK

Note

The delete operation might fail if there are volumes/snapshots that are created with this template.

More information

You can also view and manage templates using the Graphical user interface and the REST API.