Notes on systemd mount points and drbd/iscsi/multipath interaction

By steve, 17 September, 2015

There are 2 parts to this that I would like to note. First, in order to get drbd, iscsi and multipath to play nicely together under systemd, I had to do the following:
Create /etc/systemd/system/drbd.service.d/override-after.conf with the following contents:

[Unit]
After=systemd-modules-load.service network.target open-iscsi.service dev-mapper-bhqibm01\x2dr6\x2dsata01\x2dlun01.device
Requires=dev-mapper-bhqibm01\x2dr6\x2dsata01\x2dlun01.device

I also had to edite each of the /etc/iscsi/nodes/_iqn_/_ip_/default files and set:

node.session.timeo.replacement_timeout = 5 

My multipath config file was as follows:

devices {
    device {
        vendor                  IBM
        product                 "1726-2xx"
        path_checker            rdac
        path_grouping_policy    group_by_prio
        prio                    rdac
    }
}
blacklist {
    wwid _localdisk_
    wwid _localdisk_
}
multipaths {
    multipath {
        wwid    _iscsidisk_
        alias   bhqibm01-r6-sata01-lun01
    }
}

In order to mount the filesystems, I created /etc/systemd/system/ddumbfs-veeamfs.mount and /etc/systemd/system/var-veeam.mount as follows (the filenames mush match the path names).

[Unit]
Description=Veeam Filesystem
DefaultDependencies=no
ConditionPathIsSymbolicLink=!/ddumbfs/veeamfs
Requires=drbd.service
After=drbd.service

[Mount]
What=/dev/drbd/by-res/_resourcename_
Where=/ddumbfs/veeamfs
Type=ext4
Options=defaults,relatime

and

[Unit]
Description=Veeam Backup Repository
DefaultDependencies=no
ConditionPathIsSymbolicLink=!/var/veeam
Requires=ddumbfs-veeamfs.mount
After=ddumbfs-veeamfs.mount

[Mount]
What=-oparent=/ddumbfs/veeamfs,nolock_index
Where=/var/veeam
Type=fuse.ddumbfs
Options=defaults
TimeoutSec=0

[Install]
WantedBy = multi-user.target

For the second file, I had to add an entry into /etc/fstab (possibly becuase it's a FUSE mount):

-oparent=/ddumbfs/veeamfs,nolock_index  /var/veeam      fuse.ddumbfs    defaults,noauto 0 0

Finally, I had to run the following command to enable the resource:

systemctl enable var-veeam.mount

Comments