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.

Creating

To create a template:

# 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

Listing

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 status

To get the status of a template 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 |       |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Changing parameters

To change template’s parameters directly:

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

Parameters that can be set:

bw

Set maximum bandwidth limit (in MB/s).

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 all objects in placementGroup; default: default.

placeHead

Place the third replica in a different placementGroup; default: same as the value of placeAll value.

placeTail

Name of placementGroup for reader; 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.

replication

Change the number of copies for volumes or snapshots created with this 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 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 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.

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.

Renaming

To rename a template:

# storpool template magnetic rename backup
OK

Deleting

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.