<div dir="ltr">I have built a drbd cluster. The storage setting is like the following:<div><br></div><div>backend LV--->drbd0--->pv-->vg-->userlv</div><div><br></div><div>That means I create a drbd device on a LV, and create a volume group on drbd device again. </div>
<div><br></div><div>In /etc/lvm/lvm.conf, I add a filter so that pvscan do not probe for the backend LV. This works fine on normal suitation.</div><div><br></div><div>Now A is primary, and B is secondary. Break the link of A's storage(fc san), HA cluster will detect the error and failover the resource from A to B. But the drbd resource and filesystem can not be stopped on A, so A will be reboot (due to stop fail handle) and B will takeover all the resource. When A rejoin the cluster, the drbd resource can not be start as secondary automatically: the backend LV can not be attached to the drbd resource.</div>
<div><br></div><div><div>vcs2:~ # lvs</div><div> LV VG Attr LSize Origin Snap% Move Log Copy% Convert</div><div> drbd0_lv drbdvg -wi-ao 800.00M </div><div> oralv oravg -wi-a- 1000.00M </div>
<div>vcs2:~ # modprobe drbd</div><div>vcs2:~ # drbdadm up drbd0</div><div>0: Failure: (104) Can not open backing device.</div><div>Command 'drbdsetup 0 disk /dev/drbdvg/drbd0_lv /dev/drbdvg/drbd0_lv internal --set-defaults --create-device --on-io-error=pass_on --no-disk-barrier --no-disk-flushes' terminated with exit code 10</div>
<div>vcs2:~ # fuser -m /dev/drbdvg/drbd0_lv </div></div><div><div>vcs2:~ # lvdisplay /dev/drbdvg/drbd0_lv </div><div> --- Logical volume ---</div><div> LV Name /dev/drbdvg/drbd0_lv</div><div> VG Name drbdvg</div>
<div> LV UUID Np92C2-ttuq-yM16-mDf2-5TLE-rn5g-rWrtVq</div><div> LV Write Access read/write</div><div> LV Status available</div><div> # open 1</div><div> LV Size 800.00 MB</div>
<div> Current LE 200</div><div> Segments 1</div><div> Allocation inherit</div><div> Read ahead sectors auto</div><div> - currently set to 1024</div><div> Block device 252:6</div>
</div><div><br></div><div><br></div><div>My solution is:</div><div>1.restore the default configure of /etc/lvm/lvm.conf and run pvscan/vgchange -ay to active the lv on drbd0(now on the backend lv) and deactive it again.</div>
<div>2. change the lvm.conf to cluster config and run pvscan/vgchange -ay again</div><div>3. start drbd0 , attach the backend lv </div><div>4. run drbdadm verify drbd0 on primary node.</div><div><br></div><div>It does work.</div>
<div><br></div><div>Have anyone a better solution? Thanks.</div>
</div>