ganeti-local
15 years agoSimplify the checkInstanceMove function
Iustin Pop [Sun, 15 Feb 2009 13:48:39 +0000 (14:48 +0100)]
Simplify the checkInstanceMove function

This patch flattens the two folds into one, by simply building the whole
list of moves instead  of the double recursion (nodes and the each
node's moves). This has no functional change, but it's much cleaner.

15 years agoA small optimization in node computation
Iustin Pop [Sun, 15 Feb 2009 13:40:42 +0000 (14:40 +0100)]
A small optimization in node computation

Currently we always compute the available node list for moves (for an
instances) based on the nodes of the initial table. This works find,
however is a repeated calculation.

We optimize this by passing a node list (of indexes, not full objects),
which helps in two ways:
  - faster to filter later
  - allows restriction of target nodes by enforcing only this subset as
    target for moves

15 years agoContainer: add a 'keys' function
Iustin Pop [Sun, 15 Feb 2009 13:40:13 +0000 (14:40 +0100)]
Container: add a 'keys' function

15 years agoReplace a foldl by foldl'
Iustin Pop [Sun, 15 Feb 2009 13:35:53 +0000 (14:35 +0100)]
Replace a foldl by foldl'

15 years agoSplit checkMove into two
Iustin Pop [Sun, 15 Feb 2009 13:10:41 +0000 (14:10 +0100)]
Split checkMove into two

This cleans up and splits the individual instance move into a separate function.

15 years agoChange the balancing algorithm
Iustin Pop [Sat, 14 Feb 2009 21:22:26 +0000 (22:22 +0100)]
Change the balancing algorithm

This patch changes the balancing algorithm to not iterate linearly over
the instances (in a random, but fixed order), instead selecting at each
step the best next move. This should allow a better score (most of the
time), and usually also a shorter solution.

15 years agoAdd RAPI support to hn1
Iustin Pop [Sat, 14 Feb 2009 08:05:06 +0000 (09:05 +0100)]
Add RAPI support to hn1

This patch moves a function to Utils and changes hn1 to be able to take
data from RAPI.

15 years agoImplement oneline-output for hbal
Iustin Pop [Sat, 14 Feb 2009 08:00:56 +0000 (09:00 +0100)]
Implement oneline-output for hbal

15 years agoDo not try both http and https against the server
Iustin Pop [Sat, 14 Feb 2009 07:51:15 +0000 (08:51 +0100)]
Do not try both http and https against the server

This patch changes the tryRapi function so that if the http request
succeeded, we don't try https too.

15 years agoSimplify some JSON transforms
Iustin Pop [Sat, 14 Feb 2009 07:46:16 +0000 (08:46 +0100)]
Simplify some JSON transforms

... hopefully this is more clear.

15 years agoAdd compatibility with rapi v1
Iustin Pop [Fri, 13 Feb 2009 21:26:23 +0000 (22:26 +0100)]
Add compatibility with rapi v1

The patch adds compatibility with RAPI v1, and this required some new
JSON functions as valFromObj doesn't behave nicely.

Some other unrelated changes were done too.

15 years agoImplement reading data from RAPI v2
Iustin Pop [Fri, 13 Feb 2009 08:28:57 +0000 (09:28 +0100)]
Implement reading data from RAPI v2

15 years agoSome more utility functions
Iustin Pop [Fri, 13 Feb 2009 08:27:55 +0000 (09:27 +0100)]
Some more utility functions

15 years agoFix a bug in Cluster.fixNodes
Iustin Pop [Fri, 13 Feb 2009 08:26:13 +0000 (09:26 +0100)]
Fix a bug in Cluster.fixNodes

We need to lookup the moving accumulator, of course.

15 years agoMake RAPI return the same data format as gnt-*
Iustin Pop [Thu, 12 Feb 2009 20:14:17 +0000 (21:14 +0100)]
Make RAPI return the same data format as gnt-*

This patch changes the RAPI endpoint return the same data format as the
input files. This will allow using it instead of the files.

15 years agoChange the input file formats
Iustin Pop [Thu, 12 Feb 2009 19:55:51 +0000 (20:55 +0100)]
Change the input file formats

This patch changes the format of the input node and instance lists. It
removes the list of primary and secondary instances from the nodes, and
adds the primary and secondary nodes to the instance list.

This is done so that we can have the same input data from commands as
from the RAPI.

15 years agoInitial support for reading from RAPI
Iustin Pop [Wed, 11 Feb 2009 20:37:42 +0000 (21:37 +0100)]
Initial support for reading from RAPI

15 years agoInitial import htools-v0.0.3
Iustin Pop [Wed, 28 Jan 2009 11:09:09 +0000 (12:09 +0100)]
Initial import

This is the initial import of release 0.0.3.