- Jan 13, 2012
-
-
Iustin Pop authored
… instead of always using "printTestCase … False". Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This adds a new optional (so we're backwards-compat) section to the cluster data so that we can reliably save/restore the policy data. Note that different from the other sections, we save all policies together and separately from the group data. I thought this is cleaner than extending adding the policy data near each group, and a new section just for the cluster policy. This change also allows simplification of the unittest for cluster create/serialize, although we would need a more complete test (right now we only dump/load the defIPolicy or nullIPolicy). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This is unfortunately a complex test that checks if: - starting from a empty cluster - allocating a few instances on it - serialising it via the Text backend - loading it back into internal data structures we end up with the same thing. More precisely, it checks that the cluster after dump/load is the same as after allocation. While this is in the Text unittests, as the docstring saying, this check more stuff than just the dump/load. It increases the overall coverage by about 3%. There were a few changes needed for this unittest: adding some Eq instances for some data types, and fixing a cosmetic bug in Cluster.iterateAlloc, where the instance indices were growing by 2 instead of by 1 in each round. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Nothing breaks otherwise in the cluster routines, but serialisation to/from text gets confused otherwise. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This abstracts the concept of "give an sane, online node" in a single place, rather than spread around the tests. We also change the signature for isNodeBig for easier usage. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
The addition of the offline state for instances has introduced a few bugs related to their handling. The current code adds a helper function for making the check whether an instances uses reserved memory on the secondary (and uses it instead of just autoBalance), and furthermore uses consistently the state for primary node operations. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Currently, in the human-readable mode, hspace doesn't show any messages when no instances can be allocated in tiered-alloc mode. This is confusing, so let's add an explicit message. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This currently checks the minimum/maximum sizes and the disk template. Unittests will come later. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
In order to be able to use the group policy during allocation, we have a few choices: - pass the group policy as a separate argument to all involved functions, or - add the policy as an attribute to nodes, or - add the group (not only the group index) as an attribute to nodes The first and last one would change more than wanted for this patch, so I went with the second one; it will allow easily checking the target policy at runtime (based on the instance's primary node), with the only downside that without a node, we can't check the policy. Note that the first option also would complicate the allocation routines, which examine (big) lists of node/node pairs, so adding the group to this would complicate things even more. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
During loading, we can eliminate some intermediate data structures. This only matters for big clusters, and even there it's less than 1% less memory allocated, but still, it's a no-brainer. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This is not in the hot-path, but still, no sense in doing O(n) instead of O(1). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This is straightforward; as before, so far the text and simu backends have no way to use a non-default ipolicy. Furthermore, we do some unit-test preparation for future changes (these seem a no-op for now, but they are needed for later patches). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This is needed for the next patch. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
The default disk template is the first enabled template. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
The default value is badly defined (hardcoded defaults)… Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This is needed since we'll need the DiskTemplate definition in the IPolicy one. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This is a bit more complex patch, as it requires changing the assumption that all keys in the policy dict points to values that are themselves dicts. Right now we introduce an assumption that any non-dicts are lists, we'll see in the future if this holds or whether we need more complex type checking (manual, yay Python). The patch also does some trivial style changes. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
The values are already checked in CreateIPolicy, no need to manually check them again. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Currently these are defined twice, instead of a single time in cli.py. Also adds the new disk_templates option to the common block, even though it's not yet used. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This simply splits the value in the option parser, instead of needing to do it in the client code. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This code raises a configuration error, but we need to transform it into a prereq error (or possibly exec error), depending on when we call this function. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This changes from the current hardcoded defaults to the cluster policy. The command line options now override the defaults from the cluster, and the tiered spec mode is always enabled. Also fixes a tiny typo in the man page (together with the man page updates). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
The rspec type is simpler than the ispec one; most likely it should be deprecated later. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This requires changing from querying the /tags resource to the /info resource. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Recent changes to the instance beparams have replaced memory with maxmem in Rapi bulk queries. Until this is either reverted (for backwards compat) or we decide to go ahead with only maxmem, we change the backend to read both; this only affects the "instance down" code path (where ``oper_ram`` is missing). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Also show it in hbal's verbose output (helpful for debugging). Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This attribute is always initialised to the default, and is not (yet) read/saved in the various backends. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This is a trivial conversion. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Unfortunately, we only support lists of simple types, and not even lists of tuples. If we actually needed those, it would be possible to implement them, with a bit more complexity in the converter. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
This prepares for tuple and other conversions. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
The two main drawbacks for convert-constants are the fact that it can't handle sets/frozensets (mainly due to the fact that I don't know how useful this would be to the Haskell code) and that it cannot export dictionaries. To fix the second case, the current patch changes the code to support flattening (potentially nested) dictionaries into single name space. Yes, this could generate conflicts, but they will be detected at compile time. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-