[DRBD-user] drbdmange: howto configure default plugin in v0.49

Roland Kammerer roland.kammerer at linbit.com
Sat Sep 12 13:43:30 CEST 2015

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


On Sat, Sep 12, 2015 at 12:31:54PM +0200, Dietmar Maurer wrote:
> Hi all,
> 
> I am a bit confused about this change:
> 
> http://git.linbit.com/gitweb.cgi?p=drbdmanage.git;a=commitdiff;h=49f4bb7285c5b02166a607d43fec0ba6b377360b
> 
> We previously used the following patch:
> 
> Index: new/conf/drbdmanaged.conf
> ===================================================================
> --- new.orig/conf/drbdmanaged.conf
> +++ new/conf/drbdmanaged.conf

All '.conf' files are gone, there is now a single 'drbdmanaged.cfg' per
node. The idea is that this file only contains options that are
absolutely necessary to get the node up and running. Usually, this file
should not be touched at all, and only a very limited set of options is
allowed in this configuration file.

The rest of the cluster/node configuration is now behind a dbus API.

In general:
- you add a node
- you configure it (via 'modify-config [--node]' or via the dbus API)
- you use the node.

All existing '.conf' files are ignored.

In your case you should make use of the new 'set_cluster_config' API
call which takes a dictionary as its input. If you just want to set a
new storage plugin (but do not want to configure the plugin itself,
because the defaults are okay), your configuration dictionary should
look like this:

{
   'nodes': [{'storage-plugin': 'drbdmanage.storage.lvm_thinlv.LvmThinLV',
              'name': 'YOURNODENAME'}], 
   'globals': [{}], 'type': [{'type': 'node'}],
   'sites': [], 'plugins': []
}

As you can see, 'nodes' is a list of dictionaries, so you can set up all
your nodes with one API call.

Currently, you have to send the _whole_ cluster configuration,
incremental update will be there in the future. Every option that is not
set in the dictionary will be removed from the node's settings and falls
back to the default value.

At first, the API looks a bit scary, the best way to get used to it is
to add a 'print cfgdict' at the end of 'cmd_edit_config' (in the
drbdmanage_client.py) and play around with 'drbdmanage modify-config'
and 'drbdmanage modify-config --node YOURNODENAME'.

Regards, rck



More information about the drbd-user mailing list