Add 'dnsmasq' section and TAP interface names

* add section 'dnsmasq' explaining how to configure dnsmasq to work
  with the communication mechanism

* add names to TAP interfaces (e.g., ``gnt.com.0``) which allow DHCP
  servers to filter the TAP interfaces to bind to

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Make disk.name and disk.uuid available in bdev

Until now Disk name and uuid was not available on bdev level.
In case of ExtStorage, this info is useful, and may be for other
templates in the future too.

This patch treats the name and uuid object slots just like the size
one and passes them to BlockDev.__init__() and to BlockDev.Create().

The ExtStrorage interface exports these options to scripts via the
VOL_CNAME and VOL_UUID environment variables.

This fixes Issue 696.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Make BlockDev subclasses adhere to new interface

In commit 702c3270 two new parameters were added to the
constructor of BlockDev. Make the subclassess accept these
additional parameters as well.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Make BlockDev subclasses adhere the interface for Create

In commit 702c3270 two new parameters were added to the
Create function of BlockDev. Make subclasses also adhere
this specification.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Fix specification of TIDiskParams

Commit 580b1fdd incorrectly assumes that disk parameters are
just the standard ones, whereas the man page explicitly states
that additional parameters can be passed as well, if they make
sense for the chosen storage type. Fix this.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add additional constructor AndRestArguments to OptionalType

A field of this type will capture all the remaining fields
of an object as JSValues. Obviously, the intended use is
to have precisely one such field. This mechanism will allow
to pass opaque values trough, as it is, e.g., required for
the disk parameters for external storage.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add genAndRestArguments :: Gen (Map String JSValue)

So that objects using AndRestArguments are available for testing.
As the AndRestArguments are intended for passing through additional
parameters passed on the command line, we restrict them to the
values that are allowed at this position: Strings of ASCII characters
and Integers.

Also, another property guaranteed by the specification is that the
keys in the map are different from all the other fields. To obtain
this property without adding additional complexity to the test
infrastructure, we choose a length for the keys that is longer than
all the valid fields.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add function providing the canonical andRestArguments

The field catching the remaining fields will always be of the same
shape, so add a function for this to make usage simple.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Add andRestArguments to IDiskParams

In this way, we cann pass through the opaque parameters
required for disk creation and modification in the case of
external storage.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Merge branch 'stable-2.11' into master

* stable-2.11
  Add andRestArguments to IDiskParams
  Add function providing the canonical andRestArguments
  Add genAndRestArguments :: Gen (Map String JSValue)
  Add additional constructor AndRestArguments to OptionalType
  Fix specification of TIDiskParams
  Make BlockDev subclasses adhere the interface for Create
  Make BlockDev subclasses adhere to new interface
  Make disk.name and disk.uuid available in bdev
  Add 'dnsmasq' section and TAP interface names

Conflicts:
	src/Ganeti/THH.hs

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
rpcs: fix docstrings for instance_os_add
OpCodes test: fix argument order (expected/but got)
algo: add GetRepeatedKeys

We do not want public, private and secret parameters to have
overlapping keys. This function implements this check.
constants: add visibility levels
Add Private types to Python, Haskell
serializer.py: emit and encode Private values

For inbound data the simplest, safest thing to do is to traverse all
JSON right after encoding and search for private parameters by key.

This ensures that all consumers of this data get Private values
transparently and consistently; the serializing methods don't have to
worry about trying to understand what kind of JSON it is receiving.
It also minimizes the surface area of codebase that is exposed to the
values directly.

The downside is it adds a ~5% time overhead to all JSON decoding as
measured through:

$ time make hs-test-py_compat_types

As far as encoding to JSON is concerned, the serializer will redact
Private values unless told to do so explicitly (e.g., for tests).
Config: add private OS parameters to the configuration

This updates objects, constructors and mocks for Instance and Cluster
objects in Python and Haskell.
cli: add parameters for private and secret OS parameters
opcodes: Modify InstanceSetParams
opcodes: modify ClusterSetParams