class documentation

class DRBD8(object):

View In Hierarchy

Various methods to deals with the DRBD system as a whole.

This class provides a set of methods to deal with the DRBD installation on the node or with uninitialized devices as opposed to a DRBD device.

Static Method FindUnusedMinor Find an unused DRBD device.
Static Method GetCmdGenerator Creates a suitable BaseDRBDCmdGenerator based on the given info.
Static Method GetProcInfo Reads and parses information from /proc/drbd.
Static Method GetUsedDevs Compute the list of used DRBD minors.
Static Method GetUsermodeHelper Returns DRBD usermode_helper currently set.
Static Method ShutdownAll Deactivate the device.
Constant _MAX_MINORS Undocumented
Constant _USERMODE_HELPER_FILE Undocumented
@staticmethod
def FindUnusedMinor():

Find an unused DRBD device.

This is specific to 8.x as the minors are allocated dynamically, so non-existing numbers up to a max minor count are actually free.

Returns
intUndocumented
@staticmethod
def GetCmdGenerator(info):

Creates a suitable BaseDRBDCmdGenerator based on the given info.

Parameters
info:DRBD8InfoUndocumented
Returns
BaseDRBDCmdGeneratorUndocumented
@staticmethod
def GetProcInfo():

Reads and parses information from /proc/drbd.

Returns
DRBD8Infoa DRBD8Info instance containing the current /proc/drbd info
@staticmethod
def GetUsedDevs():

Compute the list of used DRBD minors.

Returns
list of intsUndocumented
@staticmethod
def GetUsermodeHelper(filename=_USERMODE_HELPER_FILE):

Returns DRBD usermode_helper currently set.

Parameters
filename:stringthe filename to read the usermode helper from
Returns
stringthe currently configured DRBD usermode helper
@staticmethod
def ShutdownAll(minor):

Deactivate the device.

This will, of course, fail if the device is in use.

Parameters
minor:intthe minor to shut down
_MAX_MINORS: int =

Undocumented

Value
255
_USERMODE_HELPER_FILE: str =

Undocumented

Value
'/sys/module/drbd/parameters/usermode_helper'