History | View | Annotate | Download (11.1 kB)
Change the module import hierarchy
This patch makes the Types module a base module, and Node/Instance onesimport it, from the previous (opposite) situation. This will allow inthe future to use newtypes for the index and name types.
Remove the ktn/kti from second half of loading
This removes the return of ktn/kti from Loader.mergeData and associatedfunctions.
Remove most uses of ktn/kti
This patch removes all uses of ktn/kti from the past-loader stages.
Remove some extraneous uses of ktn/kti
Since we have Node/Instance.name, we can now simplify a few constructs.
Some small layout changes
Move common loading sequence in CLI
This patch moves the common loading sequence to CLI, such that hbal/hn1and possible future scripts that take the input from same sources canuse it.
Move checkData from Cluster to Loader
This moves the remaining loading function to Loader (together with itsassociated support functions).
Introduce a class for CLI options
This patch generalizes a little the CLI handling by not passing in aspecial function for help and such, but instead requiring that theoptions object supports some common functionality.
More code reorganizations
This new big patch does a couple of more cleanups in the loading of datachapter: - 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)...
Rework the loader model
This big patch changes the loader model from “string data as commonformat” to actual object structures as common format.
The text loading function move from Cluster.hs to a new Text.hs module,some common functions are moved to a new Loader.hs module, and the...
Convert Cluster.loadData to Result return
This patch changes Cluster.loadData to return a Result, instead ofdirectly the values; this will allow us to return meaningful errorvalues (e.g. when an instances lives on unknown node) rather than simplyabort. Currently the result is always an Ok, the actual signalling of...
Switch from hand-written monads to a real one
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 theextra constructs. Hopefully the code is also more clear....
hbal: add a --quiet option
This option is the opposite of the --verbose option, and it allowsdecreasing the verbosity level from the default of one to zero (whichcurrently doesn't show the warning messages for missing disk/memory).
hbal: Simplify the oneline formatting
This patch moves the oneline format into a separate function for easierusage.
hbal: Early exit when we don't have any instances
For clusters with no instances, there is no point in computing eitherthe score or in running the algorithm. In this case, we exit prematurelyand when running in one-line mode we show dummy information.
hbal: Add a new min-score option
This new parameter causes the algorithm to finish (or even not start atall) if we reach/have a score better than it.
Add reading the file names from env vars
This patch adds support for selecting the instance/node file names viatwo environment variables (HTOOLS_NODES, HTOOLS_INSTANCES).
Unfortunately we still have lots of duplicated code, since the optionsare not unified.
Implement error checks for extra arguments
Neither hbal nor hn1 take any arguments beside the options, so if anyare passed is most likely an unintended error. This patch aborts in suchcases.
Implement writing the command list to a script
This patch adds support in hbal for writing the command list to a shellscript, with error checking and allowing for early exit.
hbal: Abort for invalid offline node names
Since it's easy to pass a wrong node name as offline, we should abortinstead of silently ignoring it.
Show the x_mem/i_mem in node list
This patch adds checking of cluster data in the binaries and display ofnode's x_mem/i_mem in the node list.
Split common CLI functionality into a module
This patch moves the common CLI functionality (as much as currentlypossible) into a separate module. This means we only have one parseOptsand that Utils.hs doesn't keep this kind of functions anymore.
Add a separate type for the [(Int, String)] list
This is added for better readability, since this is very often used indeclarations.
Add command line support for offlining nodes
This patch modifies hbal (only, hn1 not yet) for setting nodes offline.
Introduce a namespace for the modules
The modules are moved from the ‘top’ namespace to ‘Ganeti.HTools’, incompliance with standard practices.