(2.10) Allow instances to obtain externally reserved IPs
authorDimitris Aragiorgis <dimara@grnet.gr>
Fri, 1 Nov 2013 14:24:38 +0000 (16:24 +0200)
committerDimitris Aragiorgis <dimara@grnet.gr>
Thu, 27 Mar 2014 07:57:08 +0000 (09:57 +0200)
commitd20498322bd257b04939c818ca436899147d8032
tree209643d409601e455a1ebc56063d8b6182c57ac5
parent58625baa40e0c729bb47fb674120d6578788e41b
(2.10) Allow instances to obtain externally reserved IPs

The administrator should be able to assign an externally reserved IP
to a Ganeti instance manually, if desired. Currently this is not
supported. External reservations should act as holes in the pool and
not just as IPs already used by someone outside of Ganeti.
Automatic allocation with ip=pool will continue to exclude those IPs
as happens now.

To allow such functionality the administrator needs to pass explicitly
the desired IP along with the ``--no-conflicts-check`` option, or else
an error will be produced as happens now.

The aforementioned require the following changes:

 - Make IsReserved() to look either in reservations or external ones.
 - Make Reserve() and Release() to use IsReserved() with external
   argument True or False.
 - Pass extra option to ReserveIp() to bypass checking of external reservations
 - Update man pages and design doc for this change.

Furthermore, a side effect of this patch is that it fixes the
following problem:
Currently, one could not mark an IP as external if it was already
reserved (i.e. belonged to an instance). The code would produce a warning
and fail silently.

Fix config_mock.py so that if network and ip is given then reserve it in
the pool.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

Conflicts:
test/py/cmdlib/testsupport/config_mock.py

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
doc/design-network.rst
lib/cmdlib/instance.py
lib/cmdlib/network.py
lib/config.py
lib/network.py
man/gnt-instance.rst