1. 06 Nov, 2007 4 commits
    • Iustin Pop's avatar
      Allow DRBD8 operation without backing storage · fc1dc9d7
      Iustin Pop authored
      This patch adds the following functionality:
        - DRBD8 devices can assemble without local storage (done by allowing
          None in the list of children, and making DRBD8 to ignore all
          children if any is None)
        - DRBD8 devices can attach (i.e. identify a device) which is not
          connected to backing storage but to the correct network ports; this
          is a rare case in normal operation (it's what would happen if one
          manually detaches the local disk, and the backing LV still exists)
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Make DRBD8 disks show 'degraded' status if diskless · 583e3f6f
      Iustin Pop authored
      This patch enables the bdev.DRBD8 class report a degraded status if the
      local disk is missing. This allows `gnt-instance info` to report the
      actual situation in this case.
      Note that DRBD7 should also behave like this, however the diskless case
      is less often met there and we also don't want to change behaviour.
      The patch also fixes some docstrings for the GetSyncStatus methods.
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Change the way remove children is called in bdev · e739bd57
      Iustin Pop authored
      For some cases, we don't have to have access to the children of a device
      in order to remove them (e.g. md over lvs, or drbd over lvs). In order
      to ease the removal process, skip over finding the child if it provides
      a static dev path.
      This is needed in order to support removal of children when the
      underlying storage has gone away.
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Add a support function to objects.Disk · 222f2dd5
      Iustin Pop authored
      This patch adds a function returning the device path if it is computable
      from the disk object (and we don't need to instantiate a bdev object on
      the target node in order to compute this). Only LVs support this.
      Reviewed-by: imsnah
  2. 05 Nov, 2007 11 commits
    • Iustin Pop's avatar
      Small cleanup for error formatting · e2e521d0
      Iustin Pop authored
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Handle missing init script at cluster init · c7b46d59
      Iustin Pop authored
      This patch adds a check in the prereq of LUInitCluster for the existence
      of the init script.  This allows a clean abort instead of a stack dump.
      Based on a report by admin@steibei.net
      Reviewed-by: ultrotter
    • Iustin Pop's avatar
      Fix a unhandled error case in device creation · cf5a8306
      Iustin Pop authored
      The block device creation process is the following:
        - device create
        - device assembly (on primary or depending on dev_type, on secondary
        - set sync speed
        - return
      The problem is that device assembly after creation was not checked for
      errors, and as this is a very unusual case, we did not have problems
      with it (or we didn't detect them). The recent DevCacheManager however
      tripped on this case (because the dev_path of the device is None if the
      assembly fails) and the creation aborted with an unclear error message.
      The patch adds a check for the assembly success and aborts the creation
      of the device in this case - the error is quite clear in the instance
      add, for example. The patch also changes DevCacheManager to log the
      cases when dev_path is None but not raise an error (keeping consistent
      with the goal that the cache manager should be transparent to the code).
      For the record, this error case was detected with a mismatch between
      drbd kernel module and utilities.
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Miscellaneous style fixes · 65fe4693
      Iustin Pop authored
      This patch fixes some minor pylint warnings (unused variables, wrong
      indentation, etc.) and a real bug in the recovery for drbd8 rename
      Reviewed-by: imsnah
    • Michael Hanselmann's avatar
      Rename utils.GetUUID to utils.NewUUID. · 24818e8f
      Michael Hanselmann authored
      Reviewed-by: schreiberal
    • Guido Trotter's avatar
      Bump protocol version up · 8ee53a06
      Guido Trotter authored
      The OS cleanup patches change the wire protocol. Increment the protocol number
      by one.
      Reviewed-By: iustinp
    • Guido Trotter's avatar
      Convert os_get to use OS rather than InvalidOS · dfa96ded
      Guido Trotter authored
      In order to do this for simplicity we leave the OSFromDisk function as-is and
      we convert the eventual exception to an OS object in ganeti-noded. The
      unmangling gets simplified and so does the code for checking whether the OS is
      Reviewed-By: iustinp
    • Guido Trotter's avatar
      Simplify diagnose mangling/unmangling functions · 4e679f11
      Guido Trotter authored
      The functions in ganeti-noded and rpc.py still deal with the fact that an
      InvalidOS error could be returned by DiagnoseOS. As this is not the case
      anymore simplify their code for the current behavior.
      Reviewed-By: iustinp
    • Guido Trotter's avatar
      Make DiagnoseOS use the modified OS objects · 8fa42c7c
      Guido Trotter authored
      Modify backend.py so that DiagnoseOS only returns OS objects rather than
      InvalidOS errors, and make sure gnt-os understands the new objects. Also delete
      the deprecated helper functions from gnt-os.
      Reviewed-By: iustinp
    • Guido Trotter's avatar
      Create OS from an InvalidOS error · d2c807e4
      Guido Trotter authored
      Add a new FromInvalidOS static function to objects.OS that makes it easy to
      create an object representing a broken OS starting from the relevant exception.
      Reviewed-By: iustinp
    • Guido Trotter's avatar
      Make the OS object able to represent broken OSes · 37482e7b
      Guido Trotter authored
      Till now the OS object just represents a correct OS instance.  Change it so it
      can represent a broken one too, by adding a "status" field: if this field is
      different from the OS_VALID_STATUS constant the object is considered to be an
      invalid OS, the "status" field to be a debugging message, and its boolean
      status is set to false.
      Reviewed-By: iustinp
  3. 04 Nov, 2007 2 commits
    • Guido Trotter's avatar
      Make call_os_get a single node function · 00fe9e38
      Guido Trotter authored
      call_os_get is never called with a real list of nodes, so there's no point in
      it being multi-node. Making it single-node till a usage for multi-node call is
      Reviewed-By: iustinp
    • Guido Trotter's avatar
      Fix two typos in a doc string · 74b4217d
      Guido Trotter authored
      Remove a wrong "i" and add a missing ")" to the DiagnoseOS function doc string.
      Reviewed-By: iustinp
  4. 03 Nov, 2007 1 commit
    • Iustin Pop's avatar
      Implement tag searching · 73415719
      Iustin Pop authored
      This patch adds a search command for locating tags on all objects of the
      cluster using a regex pattern.
      Reviewed-by: aat
  5. 02 Nov, 2007 3 commits
    • Iustin Pop's avatar
      Implement device to instance mapping cache · 3f78eef2
      Iustin Pop authored
      Currently, troubleshooting DRBD problems involves a manual process of going
      backwards from the DRBD device to the instance that owns it.
      This patch adds a weak (i.e. not guaranteed to be correct or up-to-date)
      cache of device to instance. The cache should be, in normal operation,
      having correct information as the only time when devices change paths
      are when they are started/stopped, and the code in backend.py adds cache
      updates to exactly these operations.
      The only drawback of this implementation is that we don't fully update
      the cache on renames of devices (we clean the old entries but we don't
      add new ones). Since the rename changes the path only for LVs (and not
      drbd and md), this is less of a problem as the target of this code is
      debugging DRBD and MD issues.
      The patch writes files named bdev_drbd<N> (or bdev_md<N>,
      bdev_xenvg_...) in /var/run/ganeti (more exactly, LOCALSTATEDIR/ganeti).
      The files start with 'bdev_' and continue with the path of the device
      under /dev/ (this prefix stripped), and contain the following values,
      space separated:
        - instance name
        - primary or secondary (depending on how the device is on the primary
          or secondary node)
        - instance visible name: sda or sdb or not_visible, the latter case
          when the device is not the top-level device (i.e. remote_raid1
          templates will have sd[ab] for the md, but not_visible for drbd and
          logical volumes)
      The cache is designed to not raise any errors, if there is an I/O error
      it will only be logged in the node daemon log file. This is in order to
      reduce the possible impact of the cache on the block device activation
      and shutdown code.
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Update the dev_path on LVs on rename · be345db0
      Iustin Pop authored
      When renaming a logical volume, we should change the dev_path (and other
      internal variables) in order to be consistent.
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Revision 302 is broken, this fixes it · 25a915d0
      Iustin Pop authored
      I forgot a pair of parentheses in that revision which break the common
      case. This patch adds them.
      Reviewed-by: ultrotter
  6. 01 Nov, 2007 2 commits
  7. 31 Oct, 2007 2 commits
    • Iustin Pop's avatar
      More sane handling of errors during failover · 24a40d57
      Iustin Pop authored
      Currently we ignore errors on instance shutdown (on the source node)
      during instance failover. We should do this only if the user gave a
      command line options allowing this, as it's a dangerous thing to do.
      This patch fixes this by using the same "--ignore-consistency" option
      for deciding whether to continue or abort. It also expands a bit the man
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Fix bridge checking in instance failover · 50ff9a7a
      Iustin Pop authored
      The current code checks the bridge on the primary node of the instance,
      but we need to check it on the destination node.
      This was caught by testing failover with a down primary node.
      Reviewed-by: imsnah
  8. 30 Oct, 2007 1 commit
  9. 29 Oct, 2007 7 commits
  10. 28 Oct, 2007 1 commit
    • Guido Trotter's avatar
      Import two itertools recipes · 78feb6fb
      Guido Trotter authored
      The two function 'any' and 'all' are copied as-is from the python 2.4
      documentation for the itertools module. They are useful (and are already
      builtin function in python 2.5).
      Reviewed-by: iustinp
  11. 26 Oct, 2007 1 commit
  12. 25 Oct, 2007 1 commit
    • Iustin Pop's avatar
      Modify two mirror-device related rpc calls · 153d9724
      Iustin Pop authored
      The two calls mirror_addchild and mirror_removechild take only one child
      for addition/removal. While this is enough for our md usage, for local
      disk replacement in drbd8, we need to be able to specify both the data
      and metadata device. This patch modifies these two rpc calls (and their
      backend implementation and their usage in cmdlib) to take a list of
      children to add/remove.
      Reviewed-by: imsnah
  13. 24 Oct, 2007 4 commits
    • Iustin Pop's avatar
      Initial implementation of drbd8 template type · a1f445d3
      Iustin Pop authored
      This is a partially working drbd8 template type. It does:
        - add/remove
        - startup/failover/shutdown
      Not working is replace disks, which needs custom code for this template.
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Allow DRBD8 to sync after sb1-pri with no changes · f38478b2
      Iustin Pop authored
      Currently the way we shutdown or startup disks seems to make DRBD8
      unhappy. Until we rewrite the sequence of (de)activation, allow DRBD to
      connect after a sb1-pri condition with no changes to the data.
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Fix a disk handling bug triggered by failover · b352ab5b
      Iustin Pop authored
      This leaves an instance's disks configured for the primary node as after
      disk activation we want to start the instance anyway. As such,
      _GatherBlockDevs in backend.py will need the disks configured for the
      Reviewed-by: imsnah
    • Iustin Pop's avatar
      Add DRBD8 class for handling drbd version 8.x · a2cfdea2
      Iustin Pop authored
      This duplicates some code from the DRBDev class, but not very much, and
      it will be expanded with the new functionality available for the 8.x
      version. Currently the code is not accessible outside the module.
      This patch introduces a dependency on the pyparsing module.
      Reviewed-by: imsnah