4.5. Creating and deploying resources/volumes

In the following scenario we assume that the goal is to create a resource backups with a size of 500 GB that is replicated among 3 cluster nodes. First we show how to achieve the goal in individual steps, and then show a short-cut how to achieve it in a single step:

First, we create a new resource:

# drbdmanage add-resource backups

Second, we create a new volume within that resource:

# drbdmanage add-volume backups 500GB

In case we would not have used add-resource in the first step, drbdmanage would have known that the resource did not exist and it would have created it.

The third step is to deploy the resource to 3 cluster nodes:

# drbdmanage deploy-resource backups 3

In this case drbdmanage chooses 3 nodes that fit all requirements best, which is by default the set of nodes with the most free space in the drbdpool volume group. We will see how to manually assign resources to specific nodes in a moment.

As deploying a new resource/volume to a set of nodes is a very common task, drbdmanage provides the following short-cut:

# drbdmanage add-volume backups 500GB --deploy 3

Manual deployment can be achieved by assigning a resource to specific nodes. For example if you decide to assign the backups resource to bravo and charlie, you should execute the following steps:

# drbdmanage add-volume backups 500GB
# drbdmanage assign-resource backups bravo
# drbdmanage assign-resource backups charlie