1. 20 Jan, 2009 13 commits
    • Michael Hanselmann's avatar
      .gitignore: Don't exclude whole /autotools/ dir, but only files · ae59efea
      Michael Hanselmann authored
      This way newly added files will be not be excluded by default. Fixes
      also a small whitespace error in utils.py.
      
      Reviewed-by: iustinp
      ae59efea
    • Iustin Pop's avatar
      Convert RenameInstance to (status, data) · 96841384
      Iustin Pop authored
      This allows the rename failures to show the ouput of OS scripts.
      
      Reviewed-by: ultrotter
      96841384
    • Iustin Pop's avatar
      Update gitignore rules · b903ba35
      Iustin Pop authored
      As per Michael's comment, gitignore should not ignore a couple of real
      files from the autotools/ directory.
      
      Reviewed-by: ultrotter
      b903ba35
    • Iustin Pop's avatar
      Fix adding of disks to an instance · 32388e6d
      Iustin Pop authored
      The ConfigWriter.AllocateDRBDMinor requires the instance name, not the
      instance object. The LUSetInstanceParms is passing wrongly the instance
      object, which can cause breakage.
      
      The patch also adds asserts to check for this mismatch in ConfigWriter.
      
      Reviewed-by: ultrotter
      32388e6d
    • Iustin Pop's avatar
      Fix burnin problems when using http checks · 5dc626fd
      Iustin Pop authored
      The urllib2 module has very bad error handling. This patch changes to urllib
      which is simpler, and we derive a custom class from the FancyURLopener. Burning
      is no longer keeping sockets in CLOSE_WAIT state with this patch.
      
      Reviewed-by: ultrotter
      5dc626fd
    • Iustin Pop's avatar
      Make cluster-verify check the drbd minors space · 6d2e83d5
      Iustin Pop authored
      This patch adds support for verification of drbd minors space in cluster
      verify: minors which belong to running instances and should be online
      but are not, and minors which do not belong to any instace but are in
      use.
      
      The patch requires exposing some methods from bdev.DRBD8 and
      config.ConfigWriter which were until now private methods.
      
      Reviewed-by: ultrotter
      6d2e83d5
    • Iustin Pop's avatar
      Fix a couple of epydoc warnings · 2f907a8c
      Iustin Pop authored
      Reviewed-by: ultrotter
      2f907a8c
    • Iustin Pop's avatar
      DRBD: check for in-use minor during Create · 767d52d3
      Iustin Pop authored
      In order to prevent errors with old, in-use DRBD minors, we check and
      abort at create time if our minor is already in use. For this we need to
      also modify DRBD8Status to be able to parse cs:Unconfigured devices.
      
      Reviewed-by: ultrotter
      767d52d3
    • Iustin Pop's avatar
      Add a TailFile function · f65f63ef
      Iustin Pop authored
      This patch adds a tail file function, to be used for parsing and returning in
      the job log OS installation failures.
      
      Reviewed-by: ultrotter
      f65f63ef
    • Iustin Pop's avatar
      Unify some unittest functions · 51596eb2
      Iustin Pop authored
      This patch adds unified temporary file handling to the
      testutils.GanetiTestCase class, which adds easy creation and automated
      cleanup of temporary files.
      
      The patch allows a simpler handling in a couple of test cases but
      requires all child classes to call the parent setUp and tearDown
      methods.
      
      Reviewed-by: ultrotter
      51596eb2
    • Iustin Pop's avatar
      Some small fixes in cmdlib · 1492cca7
      Iustin Pop authored
      Reviewed-by: ultrotter
      1492cca7
    • Iustin Pop's avatar
      Convert AddOSToInstance to (status, data) · 20e01edd
      Iustin Pop authored
      This allows the install and reinstall instance to return (hopefully)
      relevant log files from the OS create scripts.
      
      Reviewed-by: ultrotter
      20e01edd
    • Iustin Pop's avatar
      Convert the start instance rpc to (status, data) · dd279568
      Iustin Pop authored
      This will record the failure cause in starting up the instance in the
      job log (and thus to the user).
      
      Reviewed-by: ultrotter
      dd279568
  2. 19 Jan, 2009 11 commits
    • Iustin Pop's avatar
      Fix handling of failures in create instance disks · 7d81697f
      Iustin Pop authored
      Commit 2302 only modified _CreateBlockDevOnPrimary to the new style
      result, but _CreateBlockDevOnSecondary was forgotten. After the merger
      of the two functions, _CreateBlockDevOnSecondary was taken as template
      so we checked against old-style values, thus completely breaking error
      handling.
      
      Reviewed-by: imsnah
      7d81697f
    • Iustin Pop's avatar
      Move the default MAC prefix to the constants file · c5e489f7
      Iustin Pop authored
      Instead of having the default live in the gnt-cluster script, we move it
      to the constants file. The patch also fixes a typo on constants.py.
      
      Reviewed-by: ultrotter
      c5e489f7
    • Iustin Pop's avatar
      Use instance.all_nodes instead of hand-building it · 6b12959c
      Iustin Pop authored
      This patch replaces a few obvious uses of [instance.primary_node] +
      list(instance.secondary_nodes) (or similar usage) with the new
      instance.all_nodes.
      
      Reviewed-by: ultrotter
      6b12959c
    • Iustin Pop's avatar
      Fix non-drbd instance creation · 99c7b2a1
      Iustin Pop authored
      Commit 2294 introduced a new instance.all_nodes property, which
      unfortunately is working incorrectly for non-drbd instances.
      
      This patch fixes it by making sure the primary node is always added to
      the set, even before recursing over (any potential) children.
      
      Reviewed-by: imsnah
      99c7b2a1
    • Iustin Pop's avatar
      Small simplification in MapLVsByNode · 7c5abcae
      Iustin Pop authored
      We don't need to pre-create the node entries in lvmap, since they will
      be created at recursion time.
      
      Reviewed-by: ultrotter
      7c5abcae
    • Iustin Pop's avatar
      Split the block device creation in two parts · de12473a
      Iustin Pop authored
      Some callers of _CreateBlockDev need recursive behaviour, but not all.
      The replace secondary first creates (manually) new LVs to ensure storage
      is there, and then it creates the new DRBD. At this point, we need a
      non-recursive call so that the LVs are not needlessly re-created.
      
      This patch splits the single device creation into a separate function,
      so that LUReplaceDisks can use it.
      
      Reviewed-by: ultrotter
      de12473a
    • Iustin Pop's avatar
      Combine the two _CreateBlockDevOnXXX functions · 428958aa
      Iustin Pop authored
      Since only two boolean parameters differ between these two functions, we
      combine them as to have less code duplication. This will be needed in
      the future as we will need to split off the recursive part off.
      
      Reviewed-by: ultrotter
      428958aa
    • Iustin Pop's avatar
      Switch call_blockdev_create call to (status, data) · dab69e97
      Iustin Pop authored
      This allows errors to be visible at the user level instead of just node
      daemon logs.
      
      Reviewed-by: ultrotter
      dab69e97
    • Iustin Pop's avatar
      Small change in the instance disk creation path · 796cab27
      Iustin Pop authored
      For future propagation of error messages from backend to cmdlib and to
      the job log, just having True/False return from the disk creation
      function is not enough.
      
      This patch converts these functions (_CreateDisks, _CreateBlockDevOnXXX)
      to raise exception on errors, and otherwise the return value is None.
      
      Reviewed-by: ultrotter
      796cab27
    • Iustin Pop's avatar
      Block device creation cleanup · 6c626518
      Iustin Pop authored
      Currently when creation LVM-based instances, we always get the
      extremely-confusing message "ERROR Can't find LV /dev/xenvg/..." which
      is actually expected. This behaviour was introduced before we had
      UUID-style LV names, since at that point it was not a unexpected to have
      such volumes laying around after a failed creation.
      
      Today, it's much more of an error to see existing volumes, and it's
      better to abort with a failure. Since bdev.LogicalVolume.Create() method
      will raise an error in case it exists, we can remove this check in
      backend before creating the device.
      
      The Create methods for DRBD and FileStorage currently don't raise
      exception, as behaviour is not very well defined here.
      
      We also change some exception types raised in bdev so that all
      exceptions raised by device creation are a subclass of GenericError.
      
      Reviewed-by: ultrotter
      6c626518
    • Iustin Pop's avatar
      Use the same root for both _data and _meta LVs · e6c1ff2f
      Iustin Pop authored
      Currently we use a different UUID for the _data and _meta volumes of a
      DRBD disk. This is confusing as it's hard to associate the two in the
      output of “lvs” or “gnt-node volumes”.
      
      The patch changes so that they use the same prefix.
      
      Reviewed-by: ultrotter
      e6c1ff2f
  3. 16 Jan, 2009 5 commits
    • Iustin Pop's avatar
      Fix LUExportInstance · 998c712c
      Iustin Pop authored
      Due to deficiencies in our block device implementation, it is a must to
      call SetDiskID on disks before passing them to remote nodes. Since in
      export/import, we don't touch the disks themselves, this was not needed
      before in this function.
      
      However, since having instance symlinks, the correct ID is needed here
      too, and with static minors it's a "must need". This reflects into
      failed instance starts after migration and/or failover.
      
      Reviewed-by: ultrotter
      998c712c
    • Iustin Pop's avatar
      burnin: only call self.GrowDisks() if needed · aa089b65
      Iustin Pop authored
      In case we pass --disk-grow 0[,0..] then we should not call GrowDisks as it
      prints confusing log lines.
      
      Reviewed-by: imsnah
      aa089b65
    • Iustin Pop's avatar
      Instance: add a new all_nodes property · cfcc5c6d
      Iustin Pop authored
      Since we often need the list of all nodes of an instance, we add a new
      "all_nodes" property that returns all nodes of the instance, and we
      switch secondary_nodes to a simpler implementation based on this new
      function.
      
      Reviewed-by: ultrotter
      cfcc5c6d
    • Iustin Pop's avatar
      Fix gnt-backup export with short names · aeb83a2b
      Iustin Pop authored
      We need to pass the fully-qualified node to _CheckNodeOnline, not the short
      one.
      
      Reviewed-by: imsnah
      aeb83a2b
    • Iustin Pop's avatar
      burnin: add option to not remove instances · 320eda24
      Iustin Pop authored
      This patch adds a burnin option to keep instances at the end, so that
      debugging after a burnin failure is easier.
      
      Also, we reorder the command line parsing and client query so that one
      can use ./tools/burnin --help even on non-ganeti machines.
      
      Reviewed-by: ultrotter
      320eda24
  4. 15 Jan, 2009 2 commits
    • Iustin Pop's avatar
      Some docstring updates · 25e7b43f
      Iustin Pop authored
      This patch rewraps some comments to shorter lengths, changes
      double-quotes to single-quotes inside triple-quoted docstrings for
      better editor handling.
      
      It also fixes some epydoc errors, namely invalid crossreferences (after
      method rename), documentation for inexistent (removed) parameters, etc.
      
      Reviewed-by: ultrotter
      25e7b43f
    • Iustin Pop's avatar
      ganeti-noded: reduce log noise · 14d57a8b
      Iustin Pop authored
      The source port/addr is currently logged three times for each
      connection, and this is unnecessary. We change two log entries to debug,
      since they are useful for precise timing, and we keep only one at INFO
      level.
      
      Reviewed-by: imsnah
      14d57a8b
  5. 14 Jan, 2009 1 commit
  6. 13 Jan, 2009 8 commits
    • Iustin Pop's avatar
      Forward port of the burnin migration · 99bdd139
      Iustin Pop authored
      This is again a copy of the latest 1.2 burnin code related to migration.
      
      Reviewed-by: ultrotter
      99bdd139
    • Iustin Pop's avatar
      Forward port the live migration from 1.2 branch · 53c776b5
      Iustin Pop authored
      This is forward port via copy (and not individual patches cherry-pick)
      of the latest code on the 1.2 branch related to the migration.
      
      The changes compared to 1.2 are the fact that we don't need the
      IdentifyDisks step anymore (the drbd rpc calls are independent now), and
      the rpc module improvements.
      
      Reviewed-by: ultrotter
      53c776b5
    • Iustin Pop's avatar
      Port replace disk/change node to the new DRBD RPCs · a2d59d8b
      Iustin Pop authored
      In replace disks to new secondary, since Attach (and therefore
      call_blockdev_find) is not modifying the devices anymore, we need to
      switch this LU to the new call_drbd_disconnect_net and
      call_drbd_attach_net functions.
      
      Due to the authentication needed in 2.0, we need to be more careful with
      the activation order. In 1.2, we have the case that the new node was
      directly activated with networking information, and could connect to the
      primary while it was still connected or WFConnect to the old secondary.
      
      In the new scheme, we:
        - create the new drbd in StandAlone mode
        - shutdown old secondary (primary becomes WFConnection)
        - disconnect primary (and thus it goes into StandAlone)
        - connect both primary and new secondary to network using the
          call_drbd_attach_net rpc
      
      This should be safer, and is cleaner. This passes burnin.
      
      Reviewed-by: ultrotter
      a2d59d8b
    • Iustin Pop's avatar
      Forward-port DrbdNetReconfig · 6b93ec9d
      Iustin Pop authored
      This is a modified forward-port of DrbdNetReconfig and their associated
      RPCs. In Ganeti 2.0, these functions will be used for two things:
        - live migration (as in 1.2)
        - and for other network reconfiguration tasks, since DRBD8.Attach()
          doesn't do them anymore
      
      Because of the Attach() changes, we can now implement the
      AttachNet/DisconnectNet functions as independent entities, and we don't
      need the cache anymore.
      
      Note these functions are copies of the latest 1.2 code, and not
      cherry-picks of the (many) patches that went into 1.2.
      
      Reviewed-by: ultrotter
      6b93ec9d
    • Iustin Pop's avatar
      backend: rename AttachOrAssemble to Assemble · f96e3c4f
      Iustin Pop authored
      Since now the Assemble function is different than Attach, we rename this
      backend function to show that the intent is to fully assemble the device
      (and it's always allowed to modify the device).
      
      Reviewed-by: ultrotter
      f96e3c4f
    • Iustin Pop's avatar
      drbd: change the semantics of Attach vs. Assemble · 2d0c8319
      Iustin Pop authored
      Currently, both the Attach and Assemble methods for DRBD8 devices will use and
      alter the device state. This is suboptimal, and it has been worked
      around in 1.2 via a special cache in the node daemon so that we don't
      need to call Attach() again in migration, for example.
      
      Since in 2.0 we have static minors, we can change these functions so
      that:
        - Attach() does not affect the device in any way, and only checks if
          the minor is already in use or not
        - Assemble() has two logic paths, one for startup from unused minor
          (the old Assemble, now renamed _FastAssemble) and one for
          re-checking/fixing an in-use minor (the old Attach, now renamed
          _SlowAttach)
      
      Basically Attach was renamed to _SlowAttach, Assemble to _FastAssemble,
      and we have a new, simple Assemble that calls one or the other based on
      the result of the new Attach.
      
      The LUReplaceDisks (with new secondary) is relying on the special
      semantics of Attach modifying the device and is broken until the end of
      the patch series.
      
      Reviewed-by: ultrotter
      2d0c8319
    • Iustin Pop's avatar
      bdev: Do not call Assemble() on children · f87548b5
      Iustin Pop authored
      The caller of dev.Assemble() (backend._RecursiveAssembleBD) is doing an
      explicit recursion over all the children of the device, with better
      error reporting. As such, we don't need this repeated assembly inside
      the base BlockDev class.
      
      Reviewed-by: ultrotter
      f87548b5
    • Iustin Pop's avatar
      Fix modification of instance memory · ea33068f
      Iustin Pop authored
      ... as found by the QA script - bug was introduced by me in commit 2117.
      
      Reviwed-by: imsnah
      ea33068f