Extract pool name while automatic detection
Goal
During pool detection by Pool Manager (pkg/services/provision/pool/pool_manager.go), its name must match the directory in which it is mounted. In some installations this is impossible or inconvenient.
For example,
pgclusters 15.4G 9.55T 46K /var/lib/pgsql
pgclusters/dblab 24K 9.55T 24K /var/lib/pgsql/dblab
pgclusters/pgcluster1 28K 9.55T 28K /var/lib/pgsql/pgcluster1
pgclusters/pgcluster2 28K 9.55T 28K /var/lib/pgsql/pgcluster2
...
TODO / How to implement
Most likely, there is no command that can be used to get the pool name from the mounted directory.
It's necessary to get and parse the complete list of system pools so that we have a map pool name
- mount directory
:
pgclusters/dblab - /var/lib/pgsql/dblab
pgclusters/pgcluster1 - /var/lib/pgsql/pgcluster1
...
Then, compare it with the mounted path of the discovered directory.
Note: Don't forget about LVM extraction and the docs