Overriding auto-placement policy

Hi everyone! Need some help! Could anyone advise me on how to fix auto-placement? I have a HA controller set up using DRBD reactor. Following the instructions, I set up the resource-definition and then created the resource using the command:

linstor resource create linstor_db --auto-place 3

I placed this resource on the storage pool ‘vmdata’. Later, I created a resource-group on the same storage pool using the command:

linstor rg create cloudstack --place-count 2 --storage-pool vmdata

Now it seems that linstor is applying the rule --place-count 2 instead of 3 to this resource. I’ve tried running:

linstor resource-definition auto-place linstor_db --place-count 3

but this only helps temporarily. Linstor later removes the third replica again.
Seems I’m doing something wrong. Could someone advise me on what I need to do to get linstor_db to use the correct value of --place-count 3 again?

What do linstor rd list -r linstor_db, linstor rd lp linstor_db and linstor rg l show?

You didn’t show your resource-group or resource-definition steps. It’s recommended that you give linstor its own resource group:

linstor resource-group create \
--storage-pool my-thin-pool \
--place-count 3 \
--diskless-on-remaining true \
linstor-db-grp

linstor resource-group drbd-options \
--auto-promote=no \
--quorum=majority \
--on-suspended-primary-outdated=force-secondary \
--on-no-quorum=io-error \
--on-no-data-accessible=io-error \
linstor-db-grp

linstor volume-group create linstor-db-grp

linstor resource-group spawn-resources linstor-db-grp linstor_db 200M

The “place-count” is therefore picked up from the linstor_db resource group; this is the target number of replicas to maintain. Note that “spawn-resources” means you don’t need to do “linstor resource create” at all; if you choose not to do this, then you’ll need separately to create a resource-definition, a volume-definition, and then the resources.

In your case, I can’t see what resource-group you used to create the linstor_db resource-definition. By specifying --auto-place 3 at resource creation time you simply told it to create three new resources at that instant in time, but the target number of resources is still inherited from the resource group, and that’s what it will try to align with in the future.

Hi @candlerb ! Thanks for your reply. When I create linstor_ db, I didn’t create any rg. I done it? like this:
linstor resource-definition create linstor_db
linstor rd drbd-options --auto-promote=no linstor_db
linstor rd drbd-options --quorum=majority linstor_db
linstor rd drbd-options --on-suspended-primary-outdated=force-secondary linstor_db
linstor rd drbd-options --on-no-quorum=io-error linstor_db
linstor rd drbd-options --on-no-data-accessible=io-error linstor_db
linstor rd drbd-options --rr-conflict=retry-connect linstor_db
linstor volume-definition create linstor_db 200M
linstor resource create linstor_db --auto-place 3

And after I setting up drbd reactor? i have created rg for vm’s

linstor rg create cloudstack --place-count 2 --storage-pool vmdata

Sо, now I have:

So looks like linstor_bd in cloudstack rg now. Can you tell me? whats the best way to solve this now?

Then I believe this resource definition will be linked to DfltRscGrp, which has a PlaceCount of 2.

So looks like linstor_bd in cloudstack rg now

No. As I asked before, please show linstor rd list -r linstor_db - this will show you what resource-group this resource-definition belongs to. My guess is it’s using DfltRscGrp.

whats the best way to solve this now?

Easy:

  1. Create a new linstor-db-grp resource group as shown above (but with the right storage pool)
  2. Modify the resource-group on the linstor_db resource definition to point to this new resource group, using linstor resource-definition modify

I wrote a blog post about this years ago, but it’s still relevant: Linstor: concepts and configuration | by Brian Candler | Medium (See under heading “Moving a resource-definition to a new resource-group“)

Sorry, missed this…
And you right it’s using DfltRscGrp.

I saw output of this command so many times, but not noticed this.((

One more question). Can be new rg on the same storage pool - vmdata with cloudstack rg or its not possible?

Yes: each resource group can list one or more storage pools to allocate from, and there is no requirement for a storage pool to be used by only one resource group.

I think of a resource group as a “class of service” for resource definitions (which type of storage to use, and how many replicas)

@candlerb Thanks for you help!!! problem resolved.

1 Like