[DRBD-user] primary reverts to secondary after reboot

Nico De Ranter nico.deranter at esaturnus.com
Wed May 16 10:20:08 CEST 2018

Hi all,

I'm trying to create a simple setup containing 2 servers.  One server has a
filesystem on /dev/drbd0 mounted as /var/lib/libvirt/. The drbd disk is
synchronised to a second 'passive' server.  If something goes wrong with
the primary a script should be run manually on the secondary to promote it
to primary and restart all VM's.  I do not intend this to be automatic.

The initial configuration seems to run fine until I reboot the primary
server.  After the primary reboots the drbd0 resource is set to
Secondary/Secondary. I need to manually promote it back to Primary and
restart all my services.

cat /proc/drbd
version: 8.4.5 (api:1/proto:86-101)
srcversion: 4B3E2E2CD48CAE5280B5205
 0: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate C r-----
    ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0

How can I prevent this from happening?  I want my primary to remain primary
until I manually promote the secondary in which case the original primary
is considered dead and will be wiped.

content of /etc/drbd.d/test.res
resource r0 {
        protocol C;
        startup {
                wfc-timeout  15;
                degr-wfc-timeout 60;
    syncer {
        rate 200M;
        al-extents 1801;
        net {
                cram-hmac-alg sha1;
                shared-secret "somesillypassword";
        max-buffers    8000;
        max-epoch-size    8000;
    on core1-spc {
                device /dev/drbd0;
                disk /dev/md3;
                meta-disk internal;
    on core2-spc {
                device /dev/drbd0;
                disk /dev/md3;
                meta-disk internal;

content of /etc/fstab
/dev/drbd0        /var/lib/libvirt        ext4     defaults,_netdev
0       0


Nico De Ranter

Operations Engineer

T. +32 16 38 72 10



Romeinse straat 12
3001 Leuven – Belgium

T. +32 16 40 12 82
F. +32 16 40 84 77


*For Service & Support *

Support Line: +32 16 387210 or via email : support at esaturnus.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20180516/2a5a72db/attachment.htm>

More information about the drbd-user mailing list