Additional Pools

~ 0 min
2021-03-27 21:52

In a ZFS cluster, each HA service is created to take control of a ZFS pool. The service adopts the name of the pool and when it moves between cluster nodes, it takes the pool and any associated VIPs with it.

If multiple ZFS pools exist on the system and there is a need to cluster them, then multiple services can be created. Using multiple services allows the pools to move between cluster nodes independently of each other. However, it is also possible to add additional pools to an existing HA service.

Why Add Additional Pools?

In general a service will control a single pool and when there is a need for a second pool, a new service will be created. This allows the pools to failover independently, but where a VIP is required to allow clients access to the storage, each service will require at least one VIP.

If there is a need to access storage from more than one pool using a single VIP, then those pools should all be added to the same HA service.

Adding Additional Pools from the Browser

 

Adding Additiional Pools using the Command Line

ZFS pools can be added to an existing HA service using hacli.

The steps that follw make the following assumptions:

  • A cluster has already been created on a set of nodes. For more information about creating a cluster using the command line, see Cluster Creation
  • An HA service has already been created in the cluster. For more information about creating a ZFS HA service using the command line, see Service Creation
  • There is a suitable clusterable pool available and imported on one of the cluster nodes. For more information about clusterable pools, see Clusterable Pools

Before attempting to create a new service, log into the administration API using hacli:

[root@CentOS8-1 ~]# hacli login
Enter URL [https://localhost:4330 if empty]: 
Enter Username: 
Enter Password:
[root@CentOS8-1 ~]#

Addition of a pool to a service will require at least the clusterable pool's name and GUID. This information can be gathered using the following hacli command:

[root@CentOS8-1 ~]# hacli zpool clusterable
{
  "timeout": 120,
  "errorMsg": "",
  "execTime": 0.153,
  "error": false,
  "output": [
    {
      "Pool": "tank",
      "guid": "16605435915946911042",
      "importedNode": "CentOS8-1"
    }
  ]
}
[root@CentOS8-1 ~]#

From the above output, it can be seen that there is a clusterable pool named "tank" with GUID "16605435915946911042".

The pool can then be added to an existing service using the "hacli service pools add" subcommand:

[root@CentOS8-1 ~]# hacli service pools add
NAME:
   hacli service pools add - Add a new ZFS pool to this service. This new pool will failover with the service.

USAGE:
   hacli service pools add [command options] [arguments...]

OPTIONS:
   --name value  Name of the service. Required argument.
   --pool value  Name of the ZFS pool to be added. Required argument.
   --guid value  GUID of the ZFS pool to be added. Required argument.
   
2021/03/27 19:03:50 name, pool and guid are required.
[root@CentOS8-1 ~]#

The following example adds the additional pool "tank" to the existing HA service lio-pool:

[root@CentOS8-1 ~]# hacli service pools add --name lio-pool --pool tank --guid 16605435915946911042
{
  "timeout": 60,
  "errorMsg": "",
  "execTime": 4.897,
  "error": false,
  "output": "Additional pool tank successfully added to lio-pool"
}
[root@CentOS8-1 ~]#

The list of additional pools that currently exist in a cluster can be obtained with the "hacli service pools info" subcommand:

[root@CentOS8-1 ~]# hacli service pools info --name lio-pool
{
  "timeout": 4,
  "errorMsg": "",
  "execTime": 0.001,
  "error": false,
  "output": [
    {
      "poolGUID": "16605435915946911042",
      "poolName": "tank"
    }
  ]
}
[root@CentOS8-1 ~]#

What Happens when an Additional Pool is Added?

When a ZFS pool is added to an existing HA service as an additional pool, the following steps are taken by the cluster:

  1. The pool is evaluated to ensure it is clusterable
    For more information about clusterable pools, see Clusterable Pools
  2. If necessary, the pool is moved to the node that is currently running the HA service. If the HA service is currently stopped on all nodes, the pool is exported.
  3. The additional pool is added to the cluster configuration

The following example demonstrates adding an additional pool to a service which is running on a different node to the pool.

First, the service is running on CentOS8-1 and the pool "tank" is imported on CentOS8-2:

[root@CentOS8-1 ~]# rsfcli -v list
CentOS8-1:
 lio-pool    running          automatic         unblocked       NONE    NONE    20  8
CentOS8-2:
 lio-pool    stopped          automatic         unblocked       NONE    NONE    20  8
[root@CentOS8-1 ~]# ssh CentOS8-2 zpool list tank
root@centos8-2's password: 
NAME   SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
tank   352M   110K   352M        -         -     0%     0%  1.00x    ONLINE  -
[root@CentOS8-1 ~]# 

Next, the pool is added to the lio-service:

[root@CentOS8-1 ~]# hacli service pools add --name lio-pool --pool tank --guid 16605435915946911042
{
  "timeout": 60,
  "errorMsg": "",
  "execTime": 5.668,
  "error": false,
  "output": "Additional pool tank successfully added to lio-pool"
}
[root@CentOS8-1 ~]#

Once the pools is added, the pool "tank" is moved to CentOS8-1 so that it is imported on the same node that is running the lio-service:

[root@CentOS8-1 ~]# zpool list
NAME       SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
lio-pool   352M   255K   352M        -         -     4%     0%  1.00x    ONLINE  -
tank       352M   132K   352M        -         -     1%     0%  1.00x    ONLINE  -
[root@CentOS8-1 ~]# ssh CentOS8-2 zpool list tank
root@centos8-2's password: 
cannot open 'tank': no such pool
[root@CentOS8-1 ~]#
Average rating 0 (0 Votes)

You cannot comment on this entry

Tags