History | View | Annotate | Download (3.7 kB)
Implement IAllocator node evacuate request
This patch adds the new request loading/execution (trivial), but theactual response formatting becomes more difficult as now the responsetype differs by request.
Signed-off-by: Iustin Pop <iustin@google.com>
Change an internal type from Maybe to list
In preparation for multiple responses, we change from Maybe to List(both used in the container sense).
This allows us to keep the same workflow for all kind of requests.
hail: add '-p' option intended for debugging use
This prints the initial node list on stderr, since stdout is reserved for theiallocator protocol (even though ganeti won't pass -p itself).
Read cluster tags in the IAllocator backend
Turn on, and fix, more warnings
The Makefile was intented to be -Wall and not simply -W, but I missedthat. This enables more warnings and also enables -Werror (except forthe tests).
Unify the command line options and structures
This patch moves all the command line options and their internalrepresentation into CLI.hs. This means that duplicated options betweenany two binaries are no longer declared twice, and that we no longerneed the two *Option classes.
Change the tryAlloc/tryReloc workflow
Currently, the tryAlloc and tryReloc function return a list with all theresults, both failures and successes. This is fine for hail, which doesone round of allocations, but is not so good for hspace, which doesiterative rounds; since at each (successful) step we only take the best...
Slight change to the internal allocation results
Currently the Cluster.AllocSolution type is defined as a list of‘(OpResult Node.list, …)’ and the results for applyMove are defined as‘(OpResult Node.List, …)’. Both these means that the failure/successindication is hidden in the first elements of this tuple, which makes is...
Show errors on stderr instead of stdout
Currently many of the exit and warning conditions mistakenly display errormessages on stdout, which makes parsing the output of programs harder. Thispatch attempts to fix such occurrences.
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...
Introduce a new type for allocation results
Currently the allocation/move operations workflow return ‘Maybe a’,which is very convenient but loses all details about the failure mode.
This patch introduces a new data type which encodes the specific failure...
Fix 'unused X' warnings
This removes some unused functions and imports to cleanup the warnings.
Fix the various monomorphism warning
In a few places (e.g. tryRead or any printf call) it's a little bit hardto add the correct type signatures, but in the it is possible to fixthese warnings (which can bite one in subtle cases).
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 copyright/license information
This doc-patch adds copyright and license information to (hopefully) allneeded files.
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.
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.
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).
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 a function in hail
This is not yet used.
Remove some extraneous uses of ktn/kti
Since we have Node/Instance.name, we can now simplify a few constructs.
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)...
Initial work on hail
This makes hail compile and get a request parsed via IAlloc, but nothingmore.