Package ganeti :: Package storage :: Module drbd :: Class DRBD8
[hide private]
[frames] | no frames]

Class DRBD8

source code


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.

Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
string
GetUsermodeHelper(filename=_USERMODE_HELPER_FILE)
Returns DRBD usermode_helper currently set.
source code
DRBD8Info
GetProcInfo()
Reads and parses information from /proc/drbd.
source code
list of ints
GetUsedDevs()
Compute the list of used DRBD minors.
source code
int
FindUnusedMinor()
Find an unused DRBD device.
source code
BaseDRBDCmdGenerator
GetCmdGenerator(info)
Creates a suitable BaseDRBDCmdGenerator based on the given info.
source code
 
ShutdownAll(minor)
Deactivate the device.
source code
Class Variables [hide private]
  _USERMODE_HELPER_FILE = "/sys/module/drbd/parameters/usermode_...
  _MAX_MINORS = 255
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

GetUsermodeHelper(filename=_USERMODE_HELPER_FILE)
Static Method

source code 

Returns DRBD usermode_helper currently set.

Parameters:
  • filename (string) - the filename to read the usermode helper from
Returns: string
the currently configured DRBD usermode helper

GetProcInfo()
Static Method

source code 

Reads and parses information from /proc/drbd.

Returns: DRBD8Info
a DRBD8Info instance containing the current /proc/drbd info

FindUnusedMinor()
Static Method

source code 

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: int

GetCmdGenerator(info)
Static Method

source code 

Creates a suitable BaseDRBDCmdGenerator based on the given info.

Parameters:
  • info (DRBD8Info)
Returns: BaseDRBDCmdGenerator

ShutdownAll(minor)
Static Method

source code 

Deactivate the device.

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

Parameters:
  • minor (int) - the minor to shut down

Class Variable Details [hide private]

_USERMODE_HELPER_FILE

Value:
"/sys/module/drbd/parameters/usermode_helper"