Add cpu ratio to cluster calculation
Update cpu counters correctly after pinst changes
The cpu counters are update on primary instance adds/removes.
Add cpu-count-related attributes to nodes
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 doanything yet while moving instances around. The cpu ratio is shown in...
Add a new vcpus attribute to instances
This patch adds reading of vcpu count for instances, in preparation forusing the vcpu ratio in cluster scoring.
Fix reading of total disk space in iallocator
IAllocator currently uses a wrong key name for reading the total diskspace (‘disk_usage’ which was copied from RAPI, but the actualiallocator key is ‘disk_space_total’).
This patch fixes that and also makes iallocator always use this key,...
Update NEWS and README for the 0.1.3 release
Small updates to the documentation and make a new small release.
Fix the ReplacePrimary instance move
During a replace-primary instance move, on the real cluster the instanceis temporarily started on the secondary, and as such we must check thatthe secondary node can hold it for this duration. Currently the codedoes not, and depending on cluster scoring it will put instances on such...
Update NEWS file for the 0.1.2 release
Update the README file with hspace informations
Fix hspace with plain type instances
This also fixes other required node numbers.
Add a man page for hspace
Rework the tryAlloc/tryReloc functions
Currently tryAlloc/tryReloc do not return the new instance, as this isnot needed for IAllocator alloc/reloc requests. However, for computingthe space, the new instance is useful, so we modify these functions toreturn this information too....
Add an utility function for triples
Initial add of the hspace tool
This is a tool that checks how many instances (of same size, specifiedby command line arguments) can be added to a cluster while remaining N+1compliant.
Small doc change
And an alignment issue.
Ensure consistent naming of the tools
This patch makes sure that all references to the name of the software isganeti-htools, not simply htools.
Small documentation update
Add copyright/license information
This doc-patch adds copyright and license information to (hopefully) allneeded files.
tests: move the test declaration in QC.hs
This patch moves the test declaration into QC.hs, so that test.hs has tobe modified only when we add a new test category.
Small whitespace change
Move some alloc functions from hail into Cluster
These are generic enough to be used from multiple places, they belongbetter in Cluster.hs than in the hail source.
Move the RqType and Request types to Loader.hs
These two will be more generic than now, and belong somewhere else -Loader.hs is a generic module for data loading, thus we move them there.
Cleanup an old function
Also replace a type with its synonim.
Lots of documentation updates
This patch does only doc build changes, doc changes and function movearound (for more logical documentation). It should have no impact at allon the code.
Change the check rule in Makefile
Since ghc won't trigger recompilation due to the -fhpc flag, it's notuseful to rm && make test, as this will only relink the binary.Therefore we simplify this rule.
A simple test for Container.addTwo
Add some very trivial Instance tests
This is more of an exercise in QuickCheck than strong testing.
Finish removal of unused params from PeerMap
This completes the removal started earlier byt removeing the need topass the number of nodes to Node.buildPeers, which is now unused.
Add test infrastructure and initial tests
This patch adds a QuickCheck-based test infrastructure and initial testsbased on it. The PeerMap module has a 100% coverage ☺
Side-note: one has to read the source of QuickCheck to see how to use it(especially the Batch submodule), the docs are not enough…
Some cleanup of the PeerMap module
This patch removes some unused functions and does some cleanup of theremaining ones.
Remove unused parameters from PeerMap creation
We remove some unused arguments (added way back for compatibility withArrays, which we didn't use in the end). This makes the code clearer(and doesn't need the Ndx type to be an instance of Num).
Remove an unused type synonim
Add a separate function for looking up instances
Currently we (wrongly) use lookupNode to lookup instances, just becausethe name assoc list has the same type. This patch adds a separatefunction for it.
Add type synonyms for the node/instance indices
This is a first step towards full datatype renaming. That requires morechanges, so at first we only want to document clearly what is a nodeindex, what is an instance index, and what is a plain Int.
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.
Update NEWS file for the second attempt at 0.1.1
Add a maintainer-clean makefile rule
This splits the current “clean” rule into proper clean (cleaning ofbuild artifacts) and maintainer-clean (cleaning of distributed files).This should make it better for Debian packaging.
Port offline node fixes from Rapi to IAllocator
The IAllocator source was copied from Rapi before the offline node fixeswere made. This changes such that offline nodes are accepted correctly.
Update NEWS file for the 0.1.1 release
Also replace tabs in an older entry with spaces.
Fix loading of plain instances via iallocator
Currently iallocator is broken when reading single-node instances (andwith an ugly error message). This patch fixes this case, by marking themwith secondary node “noSecondary” like the rest of the code.
hail: don't relocate to current primary node
This patch fixes the relocate-to-primary-node problem, and doesn't markthe excluded nodes as offline anymore (we don't use them anyway, solet's not use a different/fake cluster state).
Fix some haddock issues
Slash is a reserved char. Slash is a reserved char. Slash is a…
Update README for hail
Add man page and .gitignore entry for hail
hail: do not allocate on offline/drained nodes
This patch implements filtering out of the offline/drained nodes andfixes a bug in IAllocator.hs parsing (similar to an older bug in Rapi.hsfrom where the code was copied).
hail: cleanup unused options
hail: Implement non-mirrored instance allocation
This patch implements non-mirrored instance allocation, by allocating assecondary node “noSecondary”.
hail: unify the post-processing of results
Both allocate and relocate compute new node lists, whose score must beranked and the best option chosen. This means we can convert the code toa generic function.
Implement hail allocate (for 2-node requests)
This patch implements allocate for two node requests. One node requestscan be done as soon as we have a valid allocateOn function for singlenodes.
Working implementation if relocate
This patch completes the implementation of hail relocate. It maps allvalid destination nodes through a ReplaceSecondary IMove, filters outthe failed relocations, computes the resulting scores and picks thelowest one.
Start implementing the hail functionality
This patch implements a very stupid (and broken) version of hail‘allocate’.
Remove ktn/kti from first half of loader
This patch removes the ktn/kti lists from most parts of the first halfof the loading sequence. Some remain as the [(String, Int)] is thenicest way to lookup names and get indices back.
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 a function in hail
This is not yet used.
Add some utility functions for kt deprecation
These will be used to remove even more uses of ktn/kti in non-criticalpaths.
Remove some extraneous uses of ktn/kti
Since we have Node/Instance.name, we can now simplify a few constructs.
Strip the suffix from the names in the objects
This strips the suffix from the objects themselves, not only from thektn/kti vars.
Make IAlloc.loadData return maps
This patch makes the format of IAlloc.loadData be similar the same asLoader.mergeData.
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.
Add a small class for Nodes and Instances
Since both nodes and instances support some common functionality (namesand indices), we add a class so that we can access these attributes in ageneric way.
Add back names to nodes/instances
In order to simplify the data structures, we add back the name on thenode 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 ridof the ktn/kti arguments which are passed around everywhere.
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...
Initial work on hail
This makes hail compile and get a request parsed via IAlloc, but nothingmore.
Experimental support for non-redundant instances
This patch adds experimental support to hbal for non-redundant instances(i.e. instances with only one node). They are currently handled asnon-moveable, and as such the algorithm simply ignores them.
Supports needs to be added when reading from RAPI via hscan, and...
Small doc addition
Introduce nice errors on invalid input fields
This patch switches from plain read to a wrapper over readsPrec thatreturns better error messages than the buildin 'Prelude: no parse'.
Split node/instance parsing into functions
This allows easy checking for valid format of the input data (row-wise).
Add initial validation checks in Cluster.loadData
This patch converts loadTabular and loadData to a monadic form, thusallowing meaningful error messages from the node/instance load routines.
Small syntax improvement
D'oh, one can extract from a wrapped variable, not only from functions.
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...
Allow hscan to save data for fully-spec'd URLs
In case we pass a fully-specified URL to hscan, currently it will use asis and that means the directory in which we want to save the statusfiles changes from what we mean. This patch changes hscan to replace all...
Allow overriding the RAPI port/scheme
This patch adds a very dumb way to override the port and scheme forRAPI: if the master string doesn't contain a colon, we consider it asimple hostname specification, and thus prepend ‘https://’ and append‘:5080’, (the default RAPI port); otherwise, we consider it a fully...
Remove some 1.2 specific code
Now that we dropped 1.2 compatibility, we can removed the special casingfor RAPI differences.
Generalize some Result function into monad ones
We don't really needed, but is more clean like this.
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....
Small changes to the IAlloc module
Adding a small request type data structure.
Update NEWS file for the 0.1.0 release
Don't consider offline nodes as N+1 failed
This is just a cosmetic (I hope) change; the nodes shouldn't be usedanyway, and we only correct the display message.
Drop RAPI v1 compatiblity
Since we only support Ganeti 2.0, we drop the 1.2 compatibility.
Add support for 'offline' nodes
This patch drops compatiblity with Ganeti 1.2 and adds support foroffline nodes in the cluster. When reading from RAPI, the drained nodesare considered offline so that we don't allocate on them too.
Update the IAlloc module
We know have a working parseData function that returns the node andinstance data. This uncovered bad support for non-drbd instances ☹
Move the JSON utilities to Utils.hs
This patch moves the generic/reusable JSON functions to Utils.hs, sothat they're shared between RAPI/IAlloc.
Add a copy of Rapi.HS as IAlloc.hs
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 :)
Remove the apidoc dir on clean
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.
hbal: Change hardcoded tests to monadic composition
In some case we manually do “if isNothing … then Nothing else …”, whichcan be very easily replaced with a monadic construct in the Maybe monad.
Fix the makefile dist rule
It was missing a dependency on the Version.hs file, so right after “makeclean”, a “make dist” used to fail.
Update NEWS file for the 0.0.8 release
Increase allowed missing memory to 512MB
Since Xen seems to “steal” some amounts of memory (depending on totalnode memory), we increase the maximum allowed missing memory to 512MB,based on gathered data from multiple machines.
Update man pages with the env variables
This patch documents the environment variables in the man pages of hbaland hn1.
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.