History | View | Annotate | Download (4.9 kB)
Replace fromJResult with annotateJResult
This patch removes all old uses of fromJResult with the annotatedversion, and removes the non-annotated version. All JSON parsing pointsshould now have annotated errors.
Add annotations to loadJSArray
This allows, for example, the RAPI backend to detail which information(instance or node data) fails to parse.
A number of small fixes from hlint
Fix unused imports for ghc 6.12
GHC 6.12 has become more picky about unused imports, so we need toremove/tighten some of them.
Use the oper_ram field if available
For the RAPI and LUXI backends, we can get the actual memory usage (ifinstances are running) via the oper_ram, whereas backend/memory onlytell what the instance will use at the next boot.
Not using oper_ram means that the node model is flawed and we consider...
rapi, luxi: treat drained nodes as offline
Commit e97f211 changed the iallocator backend to handle drained nodes asoffline. This commit completes that change by making the rapi and luxibackend do the same (the text backend ignores any '?' values which are...
Read cluster tags in the RAPI backend
This also shows them in hbal in verbose mode.
Introduce support for reading the cluster tags
While these are not actually populated from the backends, and all theprograms ignore them, this patch contains the changes in the functiontypes required.
Add a tags attribute to instances
… and read it in all the loaders. hscan is modified to save it to thefiles it generates.
The attribute is not yet used in any place.
Enhance the error reporting for Rapi and Luxi
Currently the JSON conversion in Rapi and Luxi are giving somethinglike: Error: failed to load data. Details: Unable to read Double
This doesn't tell one where the error is (in a node specification? and...
Change the Utils.fromObj signature
Currently the fromObj function takes a JSON object which is thenconverted into a list of (String, JSValue) in which we make a lookup.However, most of the callers of this function call it repeatedly on thesame object, which means we do the object→list conversion repeatedly....
Introduce timeout in RAPI queries
The patch adds two constants in Types.hs for connect and query timeout,then modifies Rapi.hs to use them as the connect and general curltimeout.
Rapi could be improved more, as currently we wait double the totaltimeout due to not aborting early in case the node queries failed.
Fix hlint-generated warnings
This big patch cleans up the code per hlint indications. Many removalsof 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...
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.
Add copyright/license information
This doc-patch adds copyright and license information to (hopefully) allneeded files.
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.
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.
Fix some haddock issues
Slash is a reserved char. Slash is a reserved char. Slash is a…
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.
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...
Small syntax improvement
D'oh, one can extract from a wrapped variable, not only from functions.
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....
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.
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.
Include DRBD overhead in sda/sdb size
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 patchmodifies the RAPI collection to do this, but loading from disk does notas it's unknown if the query came from hscan or RAPI 1.2 or RAPI 2.0...
Add a new instance field denoting run status
This patch modifies Rapi, the Cluster.loadData and hscan serialization to loadand save the instance run status. At instance level, we add both a booleanfield denoting the true/false run status, and a string field which holds the...
Add node memory field to Node objects
This patch adds a new n_mem field to the node objects, and implementsread/save/show support for it. The field is not currently used (exceptin the node list) but will be used for checking data consistency andinstance up/down status.
Introduce a namespace for the modules
The modules are moved from the ‘top’ namespace to ‘Ganeti.HTools’, incompliance with standard practices.