DRBD does not shutdown cleanly when rebooting

e100

Renowned Member
Nov 6, 2010
1,268
45
88
Columbus, Ohio
ulbuilder.wordpress.com
If I reboot a node DRBD does not shutdown cleanly.
At first I thought maybe this was an issue with the order services were turned off, so I adjusted drbd to turn off after pve-cluster.
That did not help.

Next I manually turned off services using the same order they would normally be turned off.

After turning off pve-cluster, drbd was next but instead of shutting down I got this error:

Code:
Stopping all DRBD resources:/dev/drbd0: State change failed: (-12) Device is held open by someone
/dev/drbd1: State change failed: (-12) Device is held open by someone
ERROR: Module drbd is in use

That reminded me of this thread: forum.proxmox.com/threads/6720-Device-mapper-doesn-t-remove-the-device-in-a-clustered-setup

I looked in /dev/mapper and /proc/partitions and sure enough, some LVM disks on the DRBD volumes were still in /proc/partitions

I ran these commands:
Code:
dmsetup remove /dev/mapper/drbdvg0-vm--100--disk--1
dmsetup remove /dev/mapper/drbdvg1-vm--102--disk--1

Then I was able to cleanly turn off drbd and reboot.

I notice this because everytime I rebooted when DRBD re-connected it was synchronizing data.
That did not happen when I manually turned off each service and ran the dmsetup commands.

Any suggestions on how to fix this problem?
 
There were two problems causing this:

1. I forgot to use -c y when running vgcreate, important since we now have cLVM!:
Code:
vgcreate -c y drbdvg0 /dev/drbd0
vgcreate -c y drbdvg1 /dev/drbd1

2. The startup/shutdown order for DRBD is wrong, simple fix:
Code:
cat >> /etc/insserv/overrides/drbd <<DELIM
### BEGIN INIT INFO
# Provides: drbd
# Required-Start: $local_fs $network $syslog
# Required-Stop:  $local_fs $network $syslog
# Should-Start:   sshd multipathd
# Should-Stop:    sshd multipathd
# Default-Start:  2 3 4 5
# Default-Stop:   0 1 6
# X-Start-Before: heartbeat corosync pve-cluster
# X-Stop-After:   heartbeat corosync pve-cluster
# Short-Description:    Control drbd resources.
### END INIT INFO
DELIM

insserv -r drbd
insserv -d drbd

Could the Proxmox team include that override file in one of the pve packages so we do not need to do this manually?
 
Could the Proxmox team include that override file in one of the pve packages so we do not need to do this manually?

I guess we will provide a drbd8-utils package later, so we can include those fixes there. Would you mind to create a bug report for that on bugzilla.proxmox.com (so that we do not forget that).
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!