Trees | Indices | Help |
|
---|
|
DRBD v8.x block device.
This implements the local host part of the DRBD device, i.e. it doesn't do anything to the supposed peer. If you need a fully connected DRBD pair, you need to use this class on both hosts.
The unique_id for the drbd device is a (pnode_uuid, snode_uuid, port, pnode_minor, lnode_minor, secret) tuple, and it must have two children: the data device and the meta_device. The meta device is checked for valid size and is zeroed on create.
|
|||
|
|||
|
|||
string |
|
||
dict as described in drbd_info.BaseShowInfo.GetDevInfo |
|
||
boolean |
|
||
boolean |
|
||
|
|||
|
|||
|
|||
|
|||
list |
|
||
list |
|
||
|
|||
DRBD8Status |
|
||
objects.BlockDevStatus |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
|
|||
BlockDev |
|
|
|||
string |
|
||
|
|||
|
|
|||
_DRBD_MAJOR = 147
|
|||
_NET_RECONFIG_TIMEOUT = 60
|
|
|||
Inherited from |
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
Return the path to a drbd device for a given minor.
|
Set our parameters based on the given minor. This sets our minor variable and our dev_path.
|
Check if the given meta device looks like a valid one. This currently only checks the size, which must be around 128MiB.
|
Return the `drbdsetup show` data.
|
Return parsed information from `drbdsetup show`.
|
Test if our local config matches with an existing device. The parameter should be as returned from `_GetShowInfo()`. This method tests if our local backing device is the same as the one in the info parameter, in effect testing if we look like the given device.
|
Test if our network config matches with an existing device. The parameter should be as returned from `_GetShowInfo()`. This method tests if our network configuration is the same as the one in the info parameter, in effect testing if we look like the given device.
|
Configure the local part of a DRBD device.
|
Configure the network part of the device.
|
Add a disk to the DRBD device. |
Detach the drbd device from local storage. |
Set the parameters of the DRBD syncer. This is the low-level implementation.
|
Set the synchronization parameters of the DRBD syncer. See BlockDev.SetSyncParams for parameter description.
|
Pauses or resumes the sync of a DRBD device. See BlockDev.PauseResumeSync for parameter description.
|
Returns the sync status of the device. If sync_percent is None, it means all is ok If estimated_time is None, it means we can't estimate the time needed, otherwise it's the time left in seconds. We set the is_degraded parameter to True on two conditions: network not connected or local disk missing. We compute the ldisk parameter based on whether we have a local disk or not.
|
Make the local state primary. If the 'force' parameter is given, DRBD is instructed to switch the device into primary mode. Since this is a potentially dangerous operation, the force flag should be only given after creation, when it actually is mandatory.
|
Make the local state secondary. This will, of course, fail if the device is in use.
|
Removes network configuration. This method shutdowns the network side of the device. The method will wait up to a hardcoded timeout for the device to go into standalone after the 'disconnect' command before re-configuring it, as sometimes it takes a while for the disconnect to actually propagate and thus we might issue a 'net' command while the device is still connected. If the device will still be attached to the network and we time out, we raise an exception. |
Reconnects the network. This method connects the network side of the device with a specified multi-master flag. The device needs to be 'Standalone' but have valid network configuration data.
|
Check if our minor is configured. This doesn't do any device configurations - it only checks if the minor is in a state different from Unconfigured. Note that this function will not change the state of the system in any way (except in case of side-effects caused by reading from /proc).
|
Assemble the drbd. Method:
|
Assembles the DRBD device from a (partially) configured device. In case of partially attached (local device matches but no network setup), we perform the network attach. If successful, we re-test the attach if can return success. |
Assemble the drbd device from zero. This is run when in Assemble we detect our minor is unused. |
Detach from the local device. I/Os will continue to be served from the remote device. If we don't have a remote device, this operation will fail.
|
Disconnect from the remote peer. This fails if we don't have a local device.
|
Shutdown the DRBD device.
|
Stub remove for DRBD devices.
|
Rename a device. This is not supported for drbd devices.
|
Resize the DRBD device and its backing storage. See BlockDev.Grow for parameter description.
|
Initialize a meta device. This will not work if the given minor is in use.
|
Create a new DRBD8 device. Since DRBD devices are not created per se, just assembled, this function only initializes the metadata.
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Apr 12 13:38:57 2016 | http://epydoc.sourceforge.net |