Skip to content
Snippets Groups Projects
  1. Nov 05, 2007
    • 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
      c7b46d59
    • 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
          too)
        - 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
      cf5a8306
    • 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
      procedure.
      
      Reviewed-by: imsnah
      65fe4693
    • Michael Hanselmann's avatar
      Rename utils.GetUUID to utils.NewUUID. · 24818e8f
      Michael Hanselmann authored
      Reviewed-by: schreiberal
      24818e8f
    • 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
      
      8ee53a06
    • 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
      valid.
      
      Reviewed-By: iustinp
      
      dfa96ded
    • 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
      
      4e679f11
    • 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
      
      8fa42c7c
    • 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
      
      d2c807e4
    • 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
      37482e7b
  2. Nov 04, 2007
  3. Nov 03, 2007
    • 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
      73415719
  4. Nov 02, 2007
    • 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
      3f78eef2
    • 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
      be345db0
    • 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
      25a915d0
  5. Nov 01, 2007
  6. Oct 31, 2007
    • 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
      page.
      
      Reviewed-by: imsnah
      24a40d57
    • 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
      50ff9a7a
  7. Oct 30, 2007
  8. Oct 29, 2007
  9. Oct 28, 2007
    • 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
      
      78feb6fb
  10. Oct 26, 2007
  11. Oct 25, 2007
    • 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
      153d9724
  12. Oct 24, 2007
    • 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
      a1f445d3
    • 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
      f38478b2
    • 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
      primary.
      
      Reviewed-by: imsnah
      b352ab5b
    • 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
      a2cfdea2
    • Iustin Pop's avatar
      Move/rename _IsValidMeta to base drbd class · ae26a287
      Iustin Pop authored
      The DRBDev._IsValidMeta only checks for the metadata device size. Since
      this is a useful check (but not complete) for DRBD8, move it to the base
      class and name it _CheckMetaSize.
      
      Reviewed-by: imsnah
      ae26a287
    • Iustin Pop's avatar
      More abstractions from DRBD7 to base class · 5a47ad20
      Iustin Pop authored
      This moves the _SetFromMinor and _MassageProcData to the base class.
      
      Reviewed-by: imsnah
      5a47ad20
    • Iustin Pop's avatar
      Improve out-of-minors handling · 0caf6485
      Iustin Pop authored
      Currently, the out-of-minors handling is not very good: though both MD
      and DRBD functions for finding an unused minor can return None, only the
      DRBD code checks for this case.
      
      This patch improves this by making the functions _FindUnusedMinor raise
      an error instead of None, and gets rid of the one manual check for the
      return value.
      
      Reviewed-by: imsnah
      0caf6485
    • Iustin Pop's avatar
      Move some methods from DRBDev to BaseDRBD · 770fe0f9
      Iustin Pop authored
      Since some of the methods and constants are valid for both 0.7 and 8.x
      versions, we move them to the base class.
      
      Reviewed-by: imsnah
      770fe0f9
  13. Oct 19, 2007
Loading