design-optables: Fix maintenance pause example

The example filter did not actually do what was written in its description.

For `reason` predicates, the spec says

    "This predicate is true, if one of the entries of one of the opcodes
    in this job satisfies the expression."

The existing

    ["reason", ["!", ["=~", "reason", "maintenance pink bunny"]]]

would therefore match on pretty much all jobs submitted, as even
jobs with `--reason="maintenance pink bunny"` have other reason trail
entries that are not "maintenance pink bunny", and one such entry
suffices to satisfy the expression. Consequenlty, the given example
would in practice pause all new jobs.

The correct way to do this is a filter chain:

    prio 0  ["reason", ["=~", "reason", "maintenance pink bunny"]]  PASS
    prio 1  ["jobid", [">", "id", "watermark"]]                     PAUSE

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Add a revised design document for networks

This design doc describes how to extend the existing network
management and make it more flexible and able to deal with more
generic use cases. It proposes support for:

 - Networks with multiple subnets
 - Subnets with multiple IP pools
 - NICs with multiple IPs from various subnets of a single network

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Adds configuration option "interval" to data collector

* Adds requesting the configuration to collector thread.
* Adds interval to data collector config in bootstrap and cfgupgrade.

Signed-off-by: Aaron Karper <akarper@google.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Adds gnt-cluster modify option for data collector intervals

The configuration for the data collector intervals is settable via
gnt-cluster modify. The info is visible in gnt-cluster info.

Signed-off-by: Aaron Karper <akarper@google.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Update NEWS: Mond variable interval monitoring

The NEWS file describes the reason for the new dependency and the new
feature.

Signed-off-by: Aaron Karper <akarper@google.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Query.Filter: Improve haddocks for `evaluateFilterM`

This makes clearer what the two type variables are.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Ganeti Filter Language: Delete `qlangOpNotEqual` (!=)

It was never supported. We already have "equals" and "not".

See issue #954.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
qa: Fix lint errors

They were not found so far because of files forgotten in the Makefile.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
Makefile: Add missing qa_scripts

Unfortunately we have nothing that can notice this automatically yet.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
qa: Add missing commands to TestGanetiCommands

They were apparently forgotten.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
qa_rapi: Fix filter arguments being passed in wrong order

We can now also remove the "Filtering locks didn't fail" test
because filtering locks is actually supported.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
qa_rapi: Clean up PUT testing

This makes it clear where `trivial_filter` is actually used.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
qa_rapi: Use `namefield`, not "name" hardcode

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
ReasonRateLimiting: Generalize `slotMapFromJob` a bit

This function doesn't need to take a `JobWithStat`, the `QueuedJob`
inside it is sufficient.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
ReasonRateLimiting: Refactor: Extract `queueSlotMap` function

Makes `reasonRateLimit` easier to read.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Generalize SlotMap

This turns the existing `SlotMap` from the structure

  Map (label :: String, limit :: Int) (occupied :: Int)

into

  Map (label :: a) (occupied :: Int, limit :: Int)

and extracts it into its own module; this makes it possible to use
`SlotMap`s for cases outside of reason rate limiting.

There is also a semantic clean-up (not affecting how reason rate limiting
works): `joinSlotMap` (now `occupySlots`) no longer takes a `SlotMap`
as second argument, removing the need to decide how the limits of the
second `SlotMap` affect the return value.

Before `c = joinSlotMap a b`  allowed to have keys in `b` that don't appear
in `a`, and those would appear in `c` with the limits from `b` (so `a` does
not constrain them).
In the new `occupySlots`, such keys have a limit of 0 instead.

Signed-off-by: Niklas Hambuechen <niklash@google.com>