Get rid of the default_hypervisor slot
authorGuido Trotter <ultrotter@google.com>
Tue, 14 Jul 2009 16:37:49 +0000 (18:37 +0200)
committerGuido Trotter <ultrotter@google.com>
Thu, 16 Jul 2009 13:34:16 +0000 (15:34 +0200)
commit066f465dbc53dd8ae80442dfe2592602be1ac231
tree6dd96379f091992c99c1841833c39b2abe3c66cc
parent00b66530975ecc9c298a4669db90bfc71059073d
Get rid of the default_hypervisor slot

Currently we have both a default_hypervisor and an enabled_hypervisors
list. The former is only settable at cluster init time, while the latter
can be changed with cluster modify.

This becomes cumbersome in a few ways: at cluster init time for example
if we pass in a list of enabled hypervisors which doesn't include the
"default" xen-pvm one, we're also forced to pass a default hypervisor,
or an error will be reported. It is also currently possible to disable
the default hypervisor in cluster-modify (with unknown results).

In order to avoid this we get rid of this field altogether, and define
the "first" enabled hypervisor as the default one. This allows ease of
changing which one is the default, and at the same time maintains
coherency.

At configuration upgrade we make sure that the old default is first in
the list, so that 2.0 cluster defaults are preserved.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
lib/bootstrap.py
lib/cmdlib.py
lib/config.py
lib/objects.py
man/gnt-cluster.sgml
scripts/gnt-cluster
test/ganeti.config_unittest.py