import re
import time
import errno
+import shlex
import stat
import pyparsing as pyp
import os
" in lvm.conf using either 'filter' or 'preferred_names'")
free_size = sum([pv[0] for pv in pvs_info])
current_pvs = len(pvlist)
- desired_stripes = params[constants.STRIPES]
+ desired_stripes = params[constants.LDP_STRIPES]
stripes = min(current_pvs, desired_stripes)
if stripes < desired_stripes:
logging.warning("Could not use %d stripes for VG %s, as only %d PVs are"
barrier_args = \
self._ComputeDiskBarrierArgs(vmaj, vmin, vrel,
- self.params[constants.BARRIERS],
- self.params[constants.NO_META_FLUSH])
+ self.params[constants.LDP_BARRIERS],
+ self.params[constants.LDP_NO_META_FLUSH])
args.extend(barrier_args)
+ if self.params[constants.LDP_DISK_CUSTOM]:
+ args.extend(shlex.split(self.params[constants.LDP_DISK_CUSTOM]))
+
result = utils.RunCmd(args)
if result.failed:
_ThrowError("drbd%d: can't attach local disk: %s", minor, result.output)
# sync speed only after setting up both sides can race with DRBD
# connecting, hence we set it here before telling DRBD anything
# about its peer.
- sync_speed = self.params.get(constants.RESYNC_RATE)
+ sync_speed = self.params.get(constants.LDP_RESYNC_RATE)
self._SetMinorSyncSpeed(minor, sync_speed)
if netutils.IP6Address.IsValid(lhost):
args.append("-m")
if hmac and secret:
args.extend(["-a", hmac, "-x", secret])
+
+ if self.params[constants.LDP_NET_CUSTOM]:
+ args.extend(shlex.split(self.params[constants.LDP_NET_CUSTOM]))
+
result = utils.RunCmd(args)
if result.failed:
_ThrowError("drbd%d: can't setup network: %s - %s",
# the device
self._SlowAssemble()
- sync_speed = self.params.get(constants.RESYNC_RATE)
+ sync_speed = self.params.get(constants.LDP_RESYNC_RATE)
self.SetSyncSpeed(sync_speed)
def _SlowAssemble(self):