1. 30 Aug, 2009 1 commit
    • Iustin Pop's avatar
      Split the balancing algorithm in two parts · f25e5aac
      Iustin Pop authored
      Currently the computation, recursing part and the IO part (progress
      updates) of the balancing main function (iterateDepth) are all in the
      same function, which makes it hard to test. This patch moves the
      decision/computation part (whether to proceed one more round, whether we
      got a good result, etc.) into Cluster.hs, and leaves only the iteration
      and screen update in hbal.hs.
  2. 26 Aug, 2009 3 commits
    • Iustin Pop's avatar
      Implement support for 'cheap' moves only · c0501c69
      Iustin Pop authored
      This patch adds support for cheap (failover/migrate) operations only in
      the balancing algorithm and in the hbal command line options.
      This allows a very quick balancing (compared to allowing replace-disks)
      which can be useful as a scheduled operation.
    • Iustin Pop's avatar
      Simplify the wrapIO function · 633e6bcb
      Iustin Pop authored
      This fixes one warning from hlint.
    • Iustin Pop's avatar
      Use migrate or failover based on instance state · c9926b22
      Iustin Pop authored
      While we can't guarantee that the instance will be in the same state by
      the time the migrate/failover command will be run, we can at least try
      to do the right thing assuming no other changes to the cluster state.
      Of course, the right fix would be for Ganeti to accept a
      migrate-or-failover opcode that atomically does the move…
  3. 19 Aug, 2009 2 commits
  4. 18 Aug, 2009 1 commit
  5. 28 Jul, 2009 1 commit
  6. 15 Jul, 2009 2 commits
    • Iustin Pop's avatar
      CLI: Handle error better · 175cc337
      Iustin Pop authored
      This patch adds an error handler for any exceptions that are raised
      during the external data load phase. This can be improved further, but
      it's a good start.
    • Iustin Pop's avatar
      Unify the command line options and structures · 0427285d
      Iustin Pop authored
      This patch moves all the command line options and their internal
      representation into CLI.hs. This means that duplicated options between
      any two binaries are no longer declared twice, and that we no longer
      need the two *Option classes.
  7. 14 Jul, 2009 8 commits
  8. 09 Jul, 2009 4 commits
    • Iustin Pop's avatar
      Update NEWS file for the 0.1.5 release · d8de9112
      Iustin Pop authored
      This is basically a hspace release, so the changelog is small.
    • Iustin Pop's avatar
      Fix a haddoc issue · 7d11799b
      Iustin Pop authored
    • Iustin Pop's avatar
      hspace: fix failure handling of tryAlloc results · 31e7ac17
      Iustin Pop authored
      Currently hspace doesn't handle failures from tryAlloc correctly; this
      patch changes the iterateDepth function in hspace to return a Result (…)
      so that errors can be propagated correctly.
      The patch also changes one output key to be more clear and a typo in
    • Iustin Pop's avatar
      Change the tryAlloc/tryReloc workflow · 478df686
      Iustin Pop authored
      Currently, the tryAlloc and tryReloc function return a list with all the
      results, both failures and successes. This is fine for hail, which does
      one round of allocations, but is not so good for hspace, which does
      iterative rounds; since at each (successful) step we only take the best
      solution, it means that we're using lots of heap space to compute and
      store node lists which are thrown away at the end of the step.
      This patch changes these two functions and their callers in hail/hspace
      to only return the best solution, and error/success counters. This
      allows hspace to run in a much smaller space, and reduces GC cost
      Overall, it is a cleanup, as hail/hspace did a lot of work to chose this
      best solution, whereas now it's automatically promoted within
  9. 08 Jul, 2009 5 commits
    • Iustin Pop's avatar
      Simplify the Cluster.tryAlloc structures · 685935f7
      Iustin Pop authored
      Currently the tryAlloc function calls the
      allocateOnSingle/allocateOnPair and the builds a new tuple with those
      functions's result plus the new node list. This is however suboptimal
      in two respects:
        - the new nodes added are the 'old' versions of the respective nodes,
          so even though we don't use more than their names, it's logically
        - we do an extra unpack/repack of the result, while we could simply
          pass it through if allocateOnX returned the correct result
      This patch makes the allocateOnX functions return the node list too and
      also removes them and applyMove from the export list, as these are only
      used within Cluster.hs.
    • Iustin Pop's avatar
      Slight change to the internal allocation results · 8880d889
      Iustin Pop authored
      Currently the Cluster.AllocSolution type is defined as a list of
      ‘(OpResult Node.list, …)’ and the results for applyMove are defined as
      ‘(OpResult Node.List, …)’. Both these means that the failure/success
      indication is hidden in the first elements of this tuple, which makes is
      harder to add other elements depending on the success/failure (like the
      score for the new node list).
      This patch moves the OpResult to outside of the tuple, in effect making
      all these ‘OpResult (…)’ which makes the internal tuple elements
      consistent. The patch is affecting the applyMove, tryAlloc and
      tryRealloc functions, and only briefly the hail and hspace programs.
    • Iustin Pop's avatar
      Add a 'tags' makefile target · 9ea446d2
      Iustin Pop authored
      This uses hasktags for building emacs TAGS.
    • Iustin Pop's avatar
      hspace: switch output to shell-script format · 2bbf77cc
      Iustin Pop authored
      This (big) patch changes the output of hspace from text-format
      (separated by ‘: ’) to a shell-snippet, in ‘key=value’ format.
      This will allow sourcing the output or parsing it via awk/sed/etc.
    • Iustin Pop's avatar
      hspace: move instance count and score into CStats · de4ac2c2
      Iustin Pop authored
      Currently the instance count and cluster score are separated from the
      other initial/final phase stats, even though they are very similar. This
      patch moves computation of these two into totalResources/CStats and
      removes special printing in hspace.
  10. 07 Jul, 2009 7 commits
    • Iustin Pop's avatar
      Fix unittests · 79a72ce7
      Iustin Pop authored
      The recent OpResult and CPU values additions broke unittests.
    • Iustin Pop's avatar
      Export more stats in hspace · 8c4c6a8a
      Iustin Pop authored
      This patch changes Cluster.totalResources to compute more resources and
      prints them in hspace.
    • Iustin Pop's avatar
      Show errors on stderr instead of stdout · 2795466b
      Iustin Pop authored
      Currently many of the exit and warning conditions mistakenly display error
      messages on stdout, which makes parsing the output of programs harder. This
      patch attempts to fix such occurrences.
    • Iustin Pop's avatar
      Fix score calculation to work with empty clusters · 16103319
      Iustin Pop authored
      Currently the cluster score calculation includes an offline instance
      percentage, expressed as “offline inst / (offline + online inst)”, which
      results in NaN for empty clusters. This patch changes the calculation
      such that clusters with no offline instances (this criteria includes
      completely empty clusters) get a score of zero on this component of the
      total score.
    • Iustin Pop's avatar
      hspace: convert N1 error exit into FailN1 result · dca7f396
      Iustin Pop authored
      Currently hspace exits with an error if the cluster is not N+1 compliant
      at the beginning of the run. This patch changes hspace such that this
      condition is instead treated as a zero-allocation-possible, FailN1 mode.
      This allows the same stats to be reported in this case as in the normal
    • Iustin Pop's avatar
      Some docstring updates · 58631b72
      Iustin Pop authored
    • Iustin Pop's avatar
      hspace: add display of instance spec · 7e74e7db
      Iustin Pop authored
      This is mostly for user-friendliness in the default mode, when we don't
      specify the instance parameters.
  11. 06 Jul, 2009 4 commits
    • Iustin Pop's avatar
      Optimize the Utils.stdDev function · e6f4f05c
      Iustin Pop authored
      This patch optimizes the stdDev function in two respects:
        - first, we don't do sum . map which builds an intermediate list, but
      	instead use a fold over the list to build incrementally the sum;
      	this should reduce both the time and space characteristics, as we
      	have fewer objects created
        - second, we move from “a ^ 2” to “a * a” as the latter has a much
      	simpler implementation and thus a higher performance
      Since the ‘square’ function is obsoleted by the above the patch also
      removes it.
    • Iustin Pop's avatar
      Take the foldl out of Loader.fixNodes · d71d0a1d
      Iustin Pop authored
      Currently Loader.fixNodes is foldl' with a complicated function. It
      makes more sense to take foldl' out of this function (and put it into
      the caller) and let fixNodes be only this internal function.
    • Iustin Pop's avatar
      Simplify Cluster.computeMoves · 41c3b292
      Iustin Pop authored
      This patch changes the function Cluster.computeMoves to use guards and a
      couple of subexpressions in order to greatly simplify it.
    • Iustin Pop's avatar
      Fix hlint-generated warnings · 9f6dcdea
      Iustin Pop authored
      This big patch cleans up the code per hlint indications. Many removals
      of extra parentheses, replacements of concat . map with concabtMap,
      extra dollar signs, eta reductions, etc. were performed.
      The code still compiles and passes a couple of manual tests on sample
      files. The individual changes are also small enough as to be visually
      easy to confirm.
  12. 05 Jul, 2009 2 commits
    • Iustin Pop's avatar
      Add computation of the failure reason in hspace · 44763b51
      Iustin Pop authored
      This patch enhances hspace to report why the allocation sequence
      stopped, both in absolute error count and for the top reason.
    • Iustin Pop's avatar
      Return correct failure data from Node.add* · c43c3354
      Iustin Pop authored
      This patch alters the Node.addPri/addSec to return correct failure data.
      It removes the computeFailN1 function from the module as that used to
      combine both mem and disk checks in the same function and thus the real
      error reason cannot be deduced when using it.