Logo Search packages:      
Sourcecode: ganeti version File versions  Download package

def lib::bdev::DRBD8::Assemble (   self  ) 

Assemble the drbd.

Method:
  - if we have a local backing device, we bind to it by:
- checking the list of used drbd devices
- check if the local minor use of any of them is our own device
- if yes, abort?
- if not, bind
  - if we have a local/remote net info:
- redo the local backing device step for the remote device
- check if any drbd device is using the local port,
  if yes abort
- check if any remote drbd device is using the remote
  port, if yes abort (for now)
- bind our net port
- bind the remote net port

Reimplemented from lib::bdev::BlockDev.

Definition at line 2126 of file bdev.py.

02126                     :
    """Assemble the drbd.

    Method:
      - if we have a local backing device, we bind to it by:
        - checking the list of used drbd devices
        - check if the local minor use of any of them is our own device
        - if yes, abort?
        - if not, bind
      - if we have a local/remote net info:
        - redo the local backing device step for the remote device
        - check if any drbd device is using the local port,
          if yes abort
        - check if any remote drbd device is using the remote
          port, if yes abort (for now)
        - bind our net port
        - bind the remote net port

    """
    self.Attach()
    if self.minor is not None:
      logger.Info("Already assembled")
      return True

    result = super(DRBD8, self).Assemble()
    if not result:
      return result

    minor = self._FindUnusedMinor()
    need_localdev_teardown = False
    if self._children and self._children[0] and self._children[1]:
      result = self._AssembleLocal(minor, self._children[0].dev_path,
                                   self._children[1].dev_path)
      if not result:
        return False
      need_localdev_teardown = True
    if self._lhost and self._lport and self._rhost and self._rport:
      result = self._AssembleNet(minor,
                                 (self._lhost, self._lport,
                                  self._rhost, self._rport),
                                 "C")
      if not result:
        if need_localdev_teardown:
          # we will ignore failures from this
          logger.Error("net setup failed, tearing down local device")
          self._ShutdownAll(minor)
        return False
    self._SetFromMinor(minor)
    return True

  @classmethod
  def _ShutdownLocal(cls, minor):


Generated by  Doxygen 1.6.0   Back to index