Configure Mayastor

Create Mayastor Pool(s)

What is a Mayastor Pool (MSP)?

When a Mayastor Node (MSN) allocates storage capacity for a Persistent Volume (PV) it does so from a construct named a Mayastor Pool (MSP). Each MSN may create and manage zero, one, or more such pools. The ownership of a pool by a MSN is exclusive. In the current version of Mayastor, a pool may have only a single block device member, which constitutes the entire data persistence layer for that pool and thus determines its maximum capacity.
A pool is defined declaratively, through the creation of a corresponding MayastorPoolcustom resource (CR) on the cluster. User configurable parameters of this CR type include a unique name for the pool, the host name of the MSN on which it is hosted and a reference to a disk device which is accessible from that node (for inclusion within the pool). The pool definition allows the reference to its member block device to adhere to one of a number of possible schemes, each associated with a specific access mechanism/transport/device type and differentiated by corresponding performance and/or attachment locality.

Permissible Schemes for the MSP CRD field disks

Type
Format
Example
Attached Disk Device (AIO)
Device File
/dev/sdx
Async. Disk I/O (AIO)
Device File
aio:///dev/sdx
io_uring
Device File
uring:///dev/sdx
RAM drive
Custom
malloc:///malloc0?size_mb=1024
Once a Mayastor node has created a pool it is assumed that it henceforth has exclusive use of the associated block device; it should not be partitioned, formatted, or shared with another application or process. Any existing data on the device will be destroyed.
RAM drive isn't suitable for production as it uses volatile memory for backing the data. The memory for the disk is allocated from hugepages. Make sure to allocate sufficient amount of extra hugepages on storage node if you want to experiment with it.

Configure Pool(s) for Use with this Quickstart

To continue with this quick start exercise, a minimum of one pool is necessary, created and hosted by one of the MSNs in the cluster. However the number of pools available limits the extent to which the synchronous n-way mirroring feature ("replication") of Persistent Volumes can configured for testing and evaluation; the number of pools configured should be no lower than the desired maximum replication factor of the PVs to be created. Note also that when placing data replicas, to provide appropriate redundancy, Mayastor's control plane will avoid locating more than one replica of a PV on the same MSN. Therefore, for example, the minimum viable configuration for a Mayastor deployment which is intended to test 3-way mirrored PVs must have three Mayastor Nodes, each having one Mayastor Pool, with each of those pools having one unique block device allocated to it.
Using one or more the following examples as templates, create the required type and number of pools.
Example MSP CRD (device file)
YAML
1
cat <<EOF | kubectl create -f -
2
apiVersion: "openebs.io/v1alpha1"
3
kind: MayastorPool
4
metadata:
5
name: pool-on-node-1
6
namespace: mayastor
7
spec:
8
node: workernode-1-hostname
9
disks: ["/dev/sdx"]
10
EOF
Copied!
1
apiVersion: "openebs.io/v1alpha1"
2
kind: MayastorPool
3
metadata:
4
name: INSERT_POOL_NAME_HERE
5
namespace: mayastor
6
spec:
7
node: INSERT_WORKERNODE_HOSTNAME_HERE
8
disks: ["INSERT_DEVICE_URI_HERE"]
Copied!
When following the examples in order to create your own Mayastor Pool(s), remember to replace the values for the fields "name", "node" and "disks" as appropriate to your cluster's intended configuration. Note that whilst the "disks" parameter accepts an array of scheme values, the current version of Mayastor supports only one disk device per pool.

Verify Pool Creation and Status

The status of Mayastor Pools may be determined by reference to their cluster CRs. Available, healthy pools should report their State as online. Verify that the expected number of pools have been created and that they are online.
Command
Example Output
1
kubectl -n mayastor get msp
Copied!
1
NAME NODE STATE AGE
2
pool-on-node-0 aks-agentpool-12194210-0 online 127m
3
pool-on-node-1 aks-agentpool-12194210-1 online 27s
4
pool-on-node-2 aks-agentpool-12194210-2 online 4s
Copied!

Create Mayastor StorageClass(s)

Mayastor dynamically provisions Persistent Volumes (PV) based on custom StorageClass definitions defined by the user. Parameters of the StorageClass resource definition are used to set the characteristics and behaviour of its associated PVs. For detailed description of the parameters see "local" storage class parameter description. Most importantly StorageClass definition is used to control the level of data protection afforded to it (that is, the number of synchronous data replicas which are maintained, for purposes of redundancy). It is possible to create any number of custom StorageClass definitions to span range of storage class parameters permutations.
We illustrate this quickstart guide with two examples of possible use cases; one which offers no data protection (i.e. a single data replica), and another having three data replicas. You may modify these as required to match your own desired test cases, within the limitations of the cluster under test.
Command (1 replica example)
Command (3 replicas example)
1
cat <<EOF | kubectl create -f -
2
kind: StorageClass
3
apiVersion: storage.k8s.io/v1
4
metadata:
5
name: mayastor-1
6
parameters:
7
repl: '1'
8
protocol: 'nvmf'
9
ioTimeout: '60'
10
local: 'true'
11
provisioner: io.openebs.csi-mayastor
12
volumeBindingMode: WaitForFirstConsumer
13
EOF
Copied!
1
cat <<EOF | kubectl create -f -
2
kind: StorageClass
3
apiVersion: storage.k8s.io/v1
4
metadata:
5
name: mayastor-3
6
parameters:
7
repl: '3'
8
protocol: 'nvmf'
9
ioTimeout: '60'
10
local: 'true'
11
provisioner: io.openebs.csi-mayastor
12
volumeBindingMode: WaitForFirstConsumer
13
EOF
Copied!
Action: Create the StorageClass(es) appropriate to your intended testing scenario(s).
Last modified 1mo ago