| 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 the (local_ip, local_port, remote_ip, remote_port) 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.
    
  | 
|||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
| boolean | 
      
  | 
  ||
      
  | 
  |||
| objects.BlockDevStatus | 
      
  | 
  ||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
| 
     Inherited from  Inherited from  Inherited from  Inherited from   | 
  |||
    
  | 
|||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
| boolean | 
      
  | 
  ||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
      
  | 
  |||
| 
     Inherited from  Inherited from   | 
  |||
    
  | 
|||
| 
     Inherited from  Inherited from   | 
  |||
    
  | 
|||
        _MAX_MINORS = 255
     | 
  |||
        _PARSE_SHOW = None
     | 
  |||
        _NET_RECONFIG_TIMEOUT = 60
     | 
  |||
| 
     Inherited from   | 
  |||
    
  | 
|||
| 
     Inherited from   | 
  |||
    
  | 
|||
  
 x.__init__(...) initializes x; see x.__class__.__doc__ for signature 
  | 
  
 Initialize a meta device. This will not work if the given minor is in use.  | 
  
 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.  | 
  
 Return a parser for `drbd show` output. This will either create or return an already-create parser for the output of the command `drbd show`.  | 
  
 Parse details about a given DRBD minor. This return, if available, the local backing device (as a path) and the local and remote (ip, port) information from a string containing the output of the `drbdsetup show` command as returned by _GetShowData.  | 
  
 Test if our local config matches with an existing device. The parameter should be as returned from `_GetDevInfo()`. 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 `_GetDevInfo()`. 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.  | 
  
 Set the speed of the DRBD syncer. This is the low-level implementation. 
  | 
  
 Set the speed of the DRBD syncer. 
  | 
  
 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, the '-o' option is passed to drbdsetup. 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. Args: 
  | 
  
 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.  | 
  
 Deactivate the device. This will, of course, fail if the device is in use.  | 
  
 Shutdown the DRBD device. 
  | 
  
 Stub remove for DRBD devices. 
  | 
  
 Create a new DRBD8 device. Since DRBD devices are not created per se, just assembled, this function only initializes the metadata. 
  | 
  
 Resize the DRBD device and its backing storage. 
  | 
| Trees | Indices | Help | 
        
  | 
  
|---|
| Generated by Epydoc 3.0.1 on Mon Dec 20 13:26:38 2010 | http://epydoc.sourceforge.net |