1. 09 Mar, 2010 1 commit
    • Iustin Pop's avatar
      Fix iallocator crash when no solutions exist · e41f4ba0
      Iustin Pop authored
      Commit 54365762 added an un-guarded `head' call, which crashes with
      “Prelude.head: empty list” when no results exists for the per-instance
      allocation/relocation calls.
      This patch fixes this, and also adds another check for an unguarded
      `head' call during parsing of input data.
  2. 26 Feb, 2010 1 commit
  3. 23 Feb, 2010 1 commit
    • Iustin Pop's avatar
      Update the loader pipeline to set the movable flag · 39f979b8
      Iustin Pop authored
      This updates the movable flag on instances if they have only one node
      (we don't rely on OpMoveInstance) or if they are set so via the command
      line options.
      This doesn't yet enable the use of the new flag.
  4. 22 Feb, 2010 2 commits
  5. 01 Dec, 2009 1 commit
  6. 27 Nov, 2009 1 commit
  7. 17 Nov, 2009 1 commit
    • Iustin Pop's avatar
      Add a command-line option to filter exclusion tags · 0f15cc76
      Iustin Pop authored
      Since we don't want all instance tags to be used for exclusion, we add a
      command line option to filter on these. Since the iallocator protocol
      cannot accept command line options, currently it's not possible to
      specify these for hail, and thus it will never use any exclusion tags.
  8. 11 Nov, 2009 1 commit
    • Iustin Pop's avatar
      Add a tags attribute to instances · 17e7af2b
      Iustin Pop authored
      … and read it in all the loaders. hscan is modified to save it to the
      files it generates.
      The attribute is not yet used in any place.
  9. 06 Nov, 2009 1 commit
    • Iustin Pop's avatar
      Change the Utils.fromObj signature · 262f3e6c
      Iustin Pop authored
      Currently the fromObj function takes a JSON object which is then
      converted into a list of (String, JSValue) in which we make a lookup.
      However, most of the callers of this function call it repeatedly on the
      same object, which means we do the object→list conversion repeatedly.
      This patch converts it to take directly the list, and converts its
      callers to do the conversion themselves (and only once).
      While this is not in the hot-path today, it would be if we ever were to
      process much data over Luxi (or RAPI), and is a good cleanup in any
  10. 18 Oct, 2009 1 commit
    • Iustin Pop's avatar
      Change the Container.findByName function · e7724ccc
      Iustin Pop authored
      This patch changes the signature and implementation of the function;
      returning the item makes more sense (saves a lookup later again in the
      container, and applying idx is cheap), and the previous implementation
      was ugly.
  11. 16 Oct, 2009 1 commit
    • Iustin Pop's avatar
      Add loading and processing of utilisation data · aa8d2e71
      Iustin Pop authored
      This patch adds loading and processing the utilisation data during
      instance moves. While the data is not yet used, it is correctly modified
      by instance changes between nodes.
      hbal has the new ‘-U’ command line argument for this. The format of the
      file is simply instance name and the four stats, space-separated.
  12. 08 Oct, 2009 1 commit
    • Guido Trotter's avatar
      parseNode: don't lookup values in drained nodes · e97f211e
      Guido Trotter authored
      Currently parseNode skips looking for values in offline nodes, but tries
      to read them for drained ones. With this patch we treat offline and
      drained nodes in the same way (which is compatible with the iallocator
      protocol changes introduced in Ganeti 2.0.4, but also doesn't break
      retrocompatibility). As a bonus we don't need to calculate the value of
      the internal Node "offline" parameter, because we know that the node is
      going to be online anyway, if we lookup values (and it was statically
      set to offline, before, in the offline case).
      Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
  13. 06 Jul, 2009 1 commit
    • 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.
  14. 10 Jun, 2009 3 commits
    • Iustin Pop's avatar
      Add cpu-count-related attributes to nodes · 1a82215d
      Iustin Pop authored
      This patch adds cpu-count related attributes to nodes:
        - total cpus
        - cpus in use
        - ratio of virtual:physical cpus
      We also set correctly the cpu values at load time, but we don't do
      anything yet while moving instances around. The cpu ratio is shown in
      the cluster list.
    • Iustin Pop's avatar
      Add a new vcpus attribute to instances · d752eb39
      Iustin Pop authored
      This patch adds reading of vcpu count for instances, in preparation for
      using the vcpu ratio in cluster scoring.
    • Iustin Pop's avatar
      Fix reading of total disk space in iallocator · 734b1ff1
      Iustin Pop authored
      IAllocator currently uses a wrong key name for reading the total disk
      space (‘disk_usage’ which was copied from RAPI, but the actual
      iallocator key is ‘disk_space_total’).
      This patch fixes that and also makes iallocator always use this key,
      instead of computing the size by itself—with Ganeti 2.0 this is
      key is always available.
  15. 01 Jun, 2009 3 commits
  16. 27 May, 2009 2 commits
  17. 26 May, 2009 2 commits
    • Iustin Pop's avatar
      Change the module import hierarchy · 262a08a2
      Iustin Pop authored
      This patch makes the Types module a base module, and Node/Instance ones
      import it, from the previous (opposite) situation. This will allow in
      the future to use newtypes for the index and name types.
    • Iustin Pop's avatar
      Port offline node fixes from Rapi to IAllocator · 1de50907
      Iustin Pop authored
      The IAllocator source was copied from Rapi before the offline node fixes
      were made. This changes such that offline nodes are accepted correctly.
  18. 25 May, 2009 2 commits
    • Iustin Pop's avatar
      Fix loading of plain instances via iallocator · bd1794b2
      Iustin Pop authored
      Currently iallocator is broken when reading single-node instances (and
      with an ugly error message). This patch fixes this case, by marking them
      with secondary node “noSecondary” like the rest of the code.
    • Iustin Pop's avatar
      hail: do not allocate on offline/drained nodes · 8c2ebac8
      Iustin Pop authored
      This patch implements filtering out of the offline/drained nodes and
      fixes a bug in IAllocator.hs parsing (similar to an older bug in Rapi.hs
      from where the code was copied).
  19. 24 May, 2009 1 commit
  20. 23 May, 2009 4 commits
  21. 22 May, 2009 2 commits
    • Iustin Pop's avatar
      Add back names to nodes/instances · 2727257a
      Iustin Pop authored
      In order to simplify the data structures, we add back the name on the
      node and instance objects. We still keep the index for, well, indexing,
      but we will use the name directly from the object, in order to get rid
      of the ktn/kti arguments which are passed around everywhere.
    • Iustin Pop's avatar
      More code reorganizations · e4c5beaf
      Iustin Pop authored
      This new big patch does a couple of more cleanups in the loading of data
        - introduce a Types module that holds most types (except the base
          Node/Instance/etc.) so that multiple other modules can use these
          (instead of only Cluster and its users)
        - bring IAlloc.hs in line with the recent changes of providing data
          types and not strings
        - removal of obsolete Utils.hs json-related functions
  22. 21 May, 2009 1 commit
    • Iustin Pop's avatar
      Initial work on hail · 585d4420
      Iustin Pop authored
      This makes hail compile and get a request parsed via IAlloc, but nothing
  23. 20 May, 2009 2 commits
    • Iustin Pop's avatar
      Switch from hand-written monads to a real one · 942403e6
      Iustin Pop authored
      This big patch converts from our home-grown monad-like constructs
      (the Either stuff) to a real, Either-like-but-another-name monad.
      We introduce a “Result a” monad, and this allows dropping many of the
      extra constructs. Hopefully the code is also more clear.
      Many of the functions could now be written in a generic-monad style,
      instead of Result specifically, but that will come in future patches.
      IAlloc.hs also has some unrelated patches.
    • Iustin Pop's avatar
      Small changes to the IAlloc module · 144f190b
      Iustin Pop authored
      Adding a small request type data structure.
  24. 18 May, 2009 3 commits
    • Iustin Pop's avatar
      Update the IAlloc module · 3f6af65c
      Iustin Pop authored
      We know have a working parseData function that returns the node and
      instance data. This uncovered bad support for non-drbd instances 
    • Iustin Pop's avatar
      Move the JSON utilities to Utils.hs · 9ba5c28f
      Iustin Pop authored
      This patch moves the generic/reusable JSON functions to Utils.hs, so
      that they're shared between RAPI/IAlloc.
    • Iustin Pop's avatar
      Add a copy of Rapi.HS as IAlloc.hs · 43643696
      Iustin Pop authored
      This will be used in two ways:
        - format the response to Ganeti (easy, implemented)
        - parse the input data and build the node/instance lists (hard :)
  25. 22 Mar, 2009 1 commit
    • Iustin Pop's avatar
      Include DRBD overhead in sda/sdb size · 190ce47c
      Iustin Pop authored
      For Ganeti 1.2 which doesn't have the ‘disk_usage’ instance query field,
      we need to manually include the DRBD overhead (per disk). This patch
      modifies the RAPI collection to do this, but loading from disk does not
      as it's unknown if the query came from hscan or RAPI 1.2 or RAPI 2.0...