Jose A. Lopes [Tue, 10 Sep 2013 11:11:12 +0000 (13:11 +0200)]
Add user separation constants
Add user separation constants, such as, 'daemonsGroup', 'rapiGroup',
and 'rapiUser', to the Haskell to Python constant generation
infrastructure.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Jose A. Lopes [Wed, 21 Aug 2013 22:18:13 +0000 (00:18 +0200)]
Add target 'AutoConf.hs'
Add Makefile target to generate 'AutoConf.hs' and add this file to
'.gitignore'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Jose A. Lopes [Wed, 21 Aug 2013 22:17:39 +0000 (00:17 +0200)]
Add AutoConf.hs.in
Add 'AutoConf.hs.in' which is the template for generating the file
'AutoConf.hs'. This file mimics the Python equivalent
'lib/_autoconf.py' and it is necessary for Haskell constants to be
able to retrieve their values from 'configure'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Klaus Aehlig [Tue, 10 Sep 2013 11:25:36 +0000 (13:25 +0200)]
Also clean up top-level *.tix files
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Jose A. Lopes [Thu, 29 Aug 2013 13:17:53 +0000 (15:17 +0200)]
Haskell to Python constants: Update 'ADMINST_ALL' reference
Update constant 'ADMINST_ALL' to take its value from the generated
'lib/_constants.py' module.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Jose A. Lopes [Thu, 29 Aug 2013 09:12:56 +0000 (11:12 +0200)]
Haskell to Python constants: add 'adminstAll'
Add constant 'adminstAll' to Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Jose A. Lopes [Thu, 29 Aug 2013 09:12:01 +0000 (11:12 +0200)]
Add 'FrozenSet'
Add type 'FrozenSet' that wrap a Haskell 'Set', and a guarded
constructor for this type and a 'PyValue' instance.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Jose A. Lopes [Thu, 29 Aug 2013 11:56:39 +0000 (13:56 +0200)]
Fix module documentation
Fix 'Ganeti.Hs2Py.ListContants.hs.in' template module documentation to
warn about automatic module generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Jose A. Lopes [Thu, 29 Aug 2013 11:42:26 +0000 (13:42 +0200)]
Fix module documentation
Fix 'lib/_constants.py.in' documentation to be consistent with other
modules.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Jose A. Lopes [Thu, 29 Aug 2013 09:10:50 +0000 (11:10 +0200)]
Fix module documentation
Fix 'HsConstants' module documentation to warn about proper module
usage.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Jose A. Lopes [Fri, 30 Aug 2013 12:30:04 +0000 (14:30 +0200)]
Wrap 'Set' in 'ListSet' for the opcodes
In what Haskell to Python opcodes are concerned, a Haskell 'Set' is
translated into a Python 'list'. In other words, currently, opcodes
that handle sets of parameters are actually handling lists because
this is how sets are currently encoded. This patch introduces a new
type called 'ListSet' that wraps a Haskell 'Set' and it is used to
represent on the Haskell side a Python 'list' without duplicate
elements. This patch also updates the respective opcode parameters
and updates the opcode tests.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Jose A. Lopes [Thu, 29 Aug 2013 09:08:51 +0000 (11:08 +0200)]
Fix 'List' instance of 'PyValue'
Fix 'List' instance of 'PyValue' to properly convert Haskell lists to
Python lists.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Fri, 30 Aug 2013 07:42:19 +0000 (09:42 +0200)]
Replace literals with constants
In "lib/cmdlib/node.py", in lines 1315-1316, 1354, and 1359-1370,
replace string literals with constants. Fixes issue 558.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Klaus Aehlig [Fri, 30 Aug 2013 11:47:02 +0000 (13:47 +0200)]
Don't install dangling symlink for hail
hail is installed to the iallocators directory, not to the binary
directory. Hence, if --enable-symlinks is given (the default), do
not install a symbolic links there either.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Thu, 29 Aug 2013 12:46:59 +0000 (14:46 +0200)]
Haskell to Python opcodes: fix Unit
Fix how Haskell to Python opcode generation handles unit. It seems
that, in 'template-haskell-2.7.0', unit is represented by Template
Haskell as a constructor of the form '(ConT name)', where 'name' is
the constructor name for 'Unit'. However, in 'template-haskell-2.8.0'
unit is represented as a tuple with no elements (i.e., 'TupleT 0').
This patch fixes the opcode generation to handle both cases, not just
the first.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Jose A. Lopes [Mon, 26 Aug 2013 13:05:02 +0000 (15:05 +0200)]
Import original constants instead of generated
Haskell to Python constant generation introduced duplicated constants
in Haskell. This patch eliminates the duplication and fixes Haskell
to import the correct constants, instead of the generated ones.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Fri, 23 Aug 2013 19:53:02 +0000 (21:53 +0200)]
Update Python constants references to '_constants.py'
Update Python constants 'ADMINST_{DOWN,UP,OFFLINE}' to take their
values from the Haskell generated module 'lib/_constants.py'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Tue, 27 Aug 2013 13:16:55 +0000 (15:16 +0200)]
Setup constant generation infrastructure
Setup a transitional Haskell to Python constant generation
infrastructure. This infrastructure is transitional and Python
constants will not be migrated to Haskell all at once. Instead, some
constants will be incrementally pulled from Python and moved to
Haskell. This is a list of the relevant modules in this
infrastructure:
* Ganeti.HsConstants: contains the Haskell constants that are used
both in Haskell (once re-exported through Ganeti.Constants) and
generated in Python
* Ganety.Hs2Py.ListConstants: contains the list of Haskell constants
to be generated in Python; these constants are defined in the
previous module and the list is automatically generated by the
Makefile
* hs2py-constants: Haskell program that outputs the actual constant
definitions in Python; this task cannot be performed by 'hs2py' just
yet because this programs depends on the 'Constants' module. But
once all the constants have migrated to Haskell, then
'hs2py-constants' and 'hs2py' can be merged.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Tue, 27 Aug 2013 08:55:35 +0000 (10:55 +0200)]
Rename 'Constants.hs' to 'PyConstants.hs'
Rename the generated 'Constants.hs' module, which contains the Haskell
constants generated from Python, to 'PyConstants.hs' in order to
eliminate duplicated constants in Haskell, a problem introduced by the
Haskell to Python constant generation, and to circumvent a problem
with import/export of Haskell modules. Add a new module named
'Constants.hs' which imports 'PyConstants.hs' and exports its names.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Thu, 22 Aug 2013 19:52:51 +0000 (21:52 +0200)]
Add Template Haskell code for constant generation
Add Template Haskell functions that generate a list in Haskell
containing all the constants to be generated in Python. This list is
an association list mapping the constant name to its Python value,
which is stored as a string.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Thu, 22 Aug 2013 19:50:04 +0000 (21:50 +0200)]
Move some 'PyValue' instances to a separate file
Move some 'PyValue' instances to a separate file so they can be
available to other modules which need these instances but do not want
to depend on the constants module, which led to compilation
constraints.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Tue, 27 Aug 2013 13:22:18 +0000 (15:22 +0200)]
Provide symlinks for all myexeclib_SCRIPTS
As we also install the nodist_myexeclib_SCRIPTS, we also need to
provide symbolic links for them if symlink installation is desired.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Helga Velroyen [Wed, 21 Aug 2013 16:40:22 +0000 (18:40 +0200)]
CLI: actually remove the --no-drbd-storage option
This removes the '--no-drbd-storage' option completely
from the command line interface. The hugepages design
doc still had a left-over reference to --no-lvm-storage,
which is removed in this patch as well.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 21 Aug 2013 14:57:10 +0000 (16:57 +0200)]
cluster init/modify: set helper without DRBD being enabled
The logic around the DRBD usermode helper so far was that
setting it was only possible when DRDB was not explicitely
disabled. This patches changes it in a way that it is
consistent to how Ganeti handles the volume group name.
Now, the user can specify a DRBD usermode helper independent
of whether or not DRBD is enabled or not. She will however
get a warning when she sets a helper without having DRBD
enabled. The reasoning behind this is that one might want
to configure a helper while not yet having set up DRBD
completely or while having DRBD disabled temporarily without
loosing this piece of configuration.
This change was done earlier in the patch series, because
I wanted to do the refactoring in two steps, first
just transforming the original logic from --no-drbd-storage
to --enabled-disk-templates and if that goes well, adjust
to the more user-friendly behavior.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 21 Aug 2013 11:02:29 +0000 (13:02 +0200)]
QA: adapt changes wrt DRBD usermode helper
This adjusts and extends the QA for 'gnt-cluster modify'
with respect to the changes regarding the DRBD
usermode helper.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 21 Aug 2013 15:01:31 +0000 (17:01 +0200)]
objects.py: upgrade config
Upgrading the config with respect to the DRBD usermode
helper was so far based on a guess whether or not DRBD
is enabled by checking if there are any DRBD instances
running. This check can now be replaced to look at the
list of enabled disk templates in the cluster's
configuration.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Tue, 20 Aug 2013 12:05:42 +0000 (14:05 +0200)]
cluster modify: deprecate --no-drbd-storage
As in the previous patch, the option '--no-drbd-storage'
is deprectated, because it is subsumed by the non-inclusion
of 'drbd' in the list of enabled disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Tue, 20 Aug 2013 09:47:00 +0000 (11:47 +0200)]
cluster init: deprecate --no-drbd-storage
Whether or not a particular type of storage is enabled
or not is determined by the list of enabled disk templates
in the cluster's configuration. This makes the option
'--no-drbd-storage' obsolete, because it is subsumed by
not including 'drbd' in the list of enabled disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Thu, 8 Aug 2013 14:23:10 +0000 (16:23 +0200)]
cluster verify: check drbd helper only when drbd enabled
This change makes sure that 'gnt-cluster verify' only
checks for the DRBD usermode helper, if DRBD is actually
enabled.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Thu, 8 Aug 2013 09:31:12 +0000 (11:31 +0200)]
cmdlib/cluster.py: unit tests for usermode helper
This patch factors out the functions that deal with setting
and modifying the DRBD usermode helper in cluster.py in
order to make them more unittestable. The unit tests are
provided as well. No functional changes otherwise.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Thu, 8 Aug 2013 08:35:00 +0000 (10:35 +0200)]
gnt_cluster.py: unit test for usermode helper
This patch factors out the functions in gnt_cluster
(related to cluster init and cluster modify) which
deal with setting / determining the drbd usermode helper
to make them more testable. Unit tests for the extracted
functions are provided as well. No function changes
otherwise.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Thu, 8 Aug 2013 08:31:18 +0000 (10:31 +0200)]
bootstrap.py: unit tests for setting the usermode helper
This patch factors out the function that checks the DRBD
usermode helper in bootstrap (cluster init) in order to make
it more testable. It also contains the unit tests. Otherwise,
no functional changes.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Klaus Aehlig [Tue, 27 Aug 2013 09:24:20 +0000 (11:24 +0200)]
In the manpages, use unversioned paths
Ganeti now installs all its files into a version-specific directory
and only adds symbolic links at the canonical installation places.
Nevertheless, make documentation, in particular man pages, still contain
the old places, i.e., the places where the symbolic links are added.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Tue, 27 Aug 2013 08:29:02 +0000 (10:29 +0200)]
Change versiondir to adhere the changed design
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Klaus Aehlig [Tue, 27 Aug 2013 08:22:55 +0000 (10:22 +0200)]
Change design to install to ${PREFIX}/lib/ganeti-${VERSION}
Even though the ${PREFIX}/opt/ only came into the design in the review
process, it is not the best choice, as /opt is reserverd for manually
installed software, but Ganeti intends to be packaged. Use ${libdir}
instead, defaulting to ${PREFIX}/lib.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Jose A. Lopes [Fri, 23 Aug 2013 16:03:25 +0000 (18:03 +0200)]
Simplify '_CheckOutputFields'
Function '_CheckOutputFields' was receiving three field sets, two of
which were simply being merged together. This was complicated and
unnecessary. This patch simplifies '_CheckOutputFields' to take
simply two field sets.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 23 Aug 2013 15:57:13 +0000 (17:57 +0200)]
Add 'SF_NODE' to 'VALID_STORAGE_FIELDS'
Constant 'SF_NODE' is a storage field and, therefore, should be in
'VALID_STORAGE_FIELDS'. This patch fixes this and also reference to
these constants, namely, in 'cmdlib' and 'qa'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Jose A. Lopes [Fri, 23 Aug 2013 15:55:41 +0000 (17:55 +0200)]
Remove storage field duplication in 'qa'
QA was adding 'SF_TYPE' to a list containing all storage fields (i.e.,
'VALID_STORAGE_FIELDS'). However, 'SF_TYPE' is already part of
'VALID_STORAGE_FIELDS', which means this element was occurring twice
in the list.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Spyros Trigazis [Wed, 21 Aug 2013 15:27:49 +0000 (18:27 +0300)]
Update iallocator design to include MonD data
Add "MonD data" sub-section.
Signed-off-by: Spyros Trigazis <strigazi@gmail.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Klaus Aehlig [Thu, 22 Aug 2013 16:48:16 +0000 (18:48 +0200)]
Add name for the Parameter ND_OVS
That was forgotten when the parameter was added.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Klaus Aehlig [Thu, 22 Aug 2013 15:06:22 +0000 (17:06 +0200)]
Add new node parameters to Object.hs
In commit
807d8853, new node parameters were introduced in the python world.
Add them to the haskell world as well to restore consistency.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Klaus Aehlig [Wed, 21 Aug 2013 09:30:01 +0000 (11:30 +0200)]
Add configure option on whether to install symlinks
As of Ganeti 2.10, all files are installed into a single, version
specific, directory. In this way, several Ganeti versions can be
installed in parallel. Appropriate symbolic links in the search path
will be added by the Ganeti upgrade procedure. For the initial
installation, however, links in the search path are needed. So make
the installation of symbolic links a configure-time option, defaulting
to the current behavior, that that installation is visible in the
path.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Klaus Aehlig [Tue, 20 Aug 2013 13:42:40 +0000 (15:42 +0200)]
Move installation to a single Ganeti specific directory
As first step of implementing the new upgrade procedure (see design
document), make Ganeti install all files into a single directory,
$(prefix)/opt/Ganeti-$(VERSION). Symbolic links outside to this directory
will be added (either at install time, or by a version specific install
script at upgrade/downgrade time). This will make it possible to have
multiple version of Ganeti installed at the same machine, with only one
being active.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:05 +0000 (10:44 +0000)]
Minor documentations fixed to gnt-node man page
Fix two grammatical errors in gnt-node man page
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:05 +0000 (10:44 +0000)]
Documentation of new node parameters
This will add the new node parameters to the ganeti man page.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:05 +0000 (10:44 +0000)]
Add parameters for OpenvSwitch to gnt-node
Extend gnt-node by parameters for OpenvSwitch. --ovs Flag to enable
OpenvSwitch, --ovs-name for the name of the OpenvSwitch and --ovs-link
for the interface to connect to.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:04 +0000 (10:44 +0000)]
Add RPC functionality for creating OpenvSwitches
This patches adds the needed RPC functions in order to create the
OpenvSwitches on the nodes.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:04 +0000 (10:44 +0000)]
Add OpenvSwitch functionality to LUNodeAdd
This patch adds functionality to LUNodeAdd to
- check the arguments given. It will warn if no physical link is given
and fail if OpenvSwitch is not enabled, but parameters are given
- call the RPC to configure OpenvSwitch on the node
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:03 +0000 (10:44 +0000)]
Backend: Create openvswitches on the nodes
This is the functionality to create the OpenvSwitches on the nodes.
Parameters are given via opcode and checked as well as extended with
the defaults.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:03 +0000 (10:44 +0000)]
Add params for OpenvSwitch to ndparams
This patch introduces the needed fields for OpenvSwitch parameters
into ndparams and also provides the default values.
The parameters are:
ND_OVS: boolean, to show whether OpenvSwitch is enabled or not
ND_OVS_NAME: the name of the OpenvSwitch to create
ND_OVS_LINK: the physical link to the OpenvSwitch
While ND_OVS and ND_OVS_NAME are mandatory and default to FALSE and
constants.DEFAULT_OVS respectively, ND_OVS_LINK is optional and can
be left empty.
Adding a new node with OpenvSwitch and no physical interface might
or might not be what the user wants, so this case will result in a
warning to inform the user (see later patch in this series).
This patch also fixes unittests which are using these parameters.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Sebastian Gebhard [Tue, 20 Aug 2013 10:44:02 +0000 (10:44 +0000)]
Add design for OpenvSwitch autoconfiguration
This design doc adds details about how the autoconfiguration of
openvswitch should work in the cluster <-> node group <-> node
hierarchy. Parameters that are needed for succesful configration
are idenfied and inheritance of parameters is defined.
Also, some rephrasing of the definition in the first part of the
document. After looking into gnt-network, in my opinion it is not the
right place to put the switch management into, since it has more to
do with links and nics than with network names and addresses.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Thomas Thrainer [Tue, 20 Aug 2013 13:12:54 +0000 (15:12 +0200)]
Adapt tests for merged changes in IPolicy handling
The enabled disk templates in IPolicies are stricter checked after the
merge from 2.9, so adapt the tests to follow those changes.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 13:52:30 +0000 (15:52 +0200)]
Add unit tests for LUInstanceMultiAlloc
This patch adds unit test coverage for LUInstanceMultiAlloc.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 13:16:45 +0000 (15:16 +0200)]
Add unit test for LUInstanceRename
This patch adds unit test coverage for LUInstanceRename.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 12:11:55 +0000 (14:11 +0200)]
Add basic unit tests for instance import
This patch adds basic unit tests for instance import in
LUInstanceCreate. It does not provide full coverage though.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 08:34:46 +0000 (10:34 +0200)]
Introduce GetMockLU and reduce use of _FakeLU
Introduce a new method of creating a mocked LU for tests, and reduce the
use of the legacy _FakeLU class.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 07:54:21 +0000 (09:54 +0200)]
Add unit tests for LUInstanceRemove and -Move
This patch adds unit test coverage for LUInstanceRemove and
LUInstanceMove.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Wed, 14 Aug 2013 12:18:56 +0000 (14:18 +0200)]
Add unit tests for LUInstanceCreate and move tests
- Move instance related tests to instance_unittest.py
- Adapt moved tests to the new test framework where appropriate
- Add unit test coverage for LUInstanceCreate
- Only instance creation is covered yet, no imports
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Wed, 14 Aug 2013 13:26:00 +0000 (15:26 +0200)]
disk_template param is optional in instance create
The disk_template parameter is optional during disk create (the first
enabled disk template is taken in this case), so don't require it.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Wed, 21 Aug 2013 06:36:20 +0000 (08:36 +0200)]
Merge branch 'stable-2.9' into master
* stable-2.9
Allow instance mods if only osparams are given
Use node UUIDs for locking instead of node names
Allow instance mods if only osparams are given
Fix a node name vs. UUID bug in instance import
Typo in hroller man page
Use node UUID for locking in LUInstanceMove
Fix harep manpage title
Fix IPolicy violation check in LUGroupSetParams
Use FQDN to check master node status
Revert "Display node name instead of UUID in error message"
Display node name instead of UUID in error message
Use node name in error message
QA: make ipolicy test respect enabled disk templates
QA: adjust tests wrt to ipolicy disk templates
ClusterSetParams: move vg-name checks from to CheckPrereq
man gnt-cluster: mention ipolicy check
Update NEWS file regarding ipolicy checks
gnt-group add/modify: ipolicy vs disk templates
Move Ipolicy utility function to cmdlib/common.py
bootstrap: restrict ipolicy to enabled disk templates
gnt-cluster modify: ipolicy vs enabled disk templates
gnt-cluster modify: factor out ipolicy check
Conflicts:
lib/cmdlib/group.py (due to moved function, changes already in
master)
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Klaus Aehlig [Thu, 25 Jul 2013 09:13:39 +0000 (11:13 +0200)]
Design document for automatised upgrades
This design document describes how upgrade and downgrades
can be made more automatic for future versions.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Tue, 20 Aug 2013 12:20:52 +0000 (14:20 +0200)]
Merge branch 'stable-2.8' into stable-2.9
* stable-2.8
Allow instance mods if only osparams are given
Fix harep manpage title
Use FQDN to check master node status
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Thomas Thrainer [Tue, 20 Aug 2013 10:37:08 +0000 (12:37 +0200)]
Allow instance mods if only osparams are given
osparams are now recognized as changes, so changing only those without
other changes works too now.
(cherry picked from commit
5eae613c2e1e65101c5d5f7d2e8ffd7cc6edc7d5)
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 13:51:23 +0000 (15:51 +0200)]
Use node UUIDs for locking instead of node names
LUInstanceMultiAlloc used node names instead of node UUIDs to lock
required nodes. This patch fixes this bug.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Helga Velroyen [Thu, 8 Aug 2013 13:42:40 +0000 (15:42 +0200)]
Set pcre version to 0.94.4
Running 'make' in the chroot complains about pcre 0.94.4
being required.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Thomas Thrainer [Tue, 20 Aug 2013 10:37:08 +0000 (12:37 +0200)]
Allow instance mods if only osparams are given
osparams are now recognized as changes, so changing only those without
other changes works too now.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 12:10:18 +0000 (14:10 +0200)]
Fix a node name vs. UUID bug in instance import
This patch fixes a bug where node names were incorrectly used as node
UUID's.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
Helga Velroyen [Mon, 19 Aug 2013 11:22:43 +0000 (13:22 +0200)]
Typo in hroller man page
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Thomas Thrainer [Mon, 19 Aug 2013 07:53:12 +0000 (09:53 +0200)]
Use node UUID for locking in LUInstanceMove
This LU (incorrectly) used the node name for locking. This patch
corrects this error.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Apollon Oikonomopoulos [Fri, 16 Aug 2013 11:58:03 +0000 (14:58 +0300)]
Fix harep manpage title
The harep manpage title underline was one character short, leading in
pandoc producing an invalid manpage header.
Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 14:00:41 +0000 (16:00 +0200)]
Add unit test for LUGroupVerifyDisks
This patch adds unit test coverage for LUGroupVerifyDisks.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 12:32:41 +0000 (14:32 +0200)]
Add unit test for LUGroupEvacuate
This patch adds unit test coverage for LUGroupEvacuate.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 12:01:12 +0000 (14:01 +0200)]
Add unit tests for LUGroupRename
This patch adds unit test coverage for LUGroupRename.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 11:56:36 +0000 (13:56 +0200)]
Add unit tests for LUGroupRemove
This patch adds unit test coverage for LUGroupRemove.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 09:58:41 +0000 (11:58 +0200)]
Add unit tests for LUGroupSetParams
This adds unit test coverage for LUGroupSetParams.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 09:17:46 +0000 (11:17 +0200)]
Add unit test for LUGroupQuery
Provide unit test coverage for LUGroupQuery.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 08:58:44 +0000 (10:58 +0200)]
Add unit tests for LUGroupAssignNodes
Add unit test coverage for LUGroupAssignNodes, including the split
instances check.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 08:28:44 +0000 (10:28 +0200)]
Add unit tests for LUGroupAdd
Provide unit test coverage for LUGroupAdd.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 12 Aug 2013 14:50:56 +0000 (16:50 +0200)]
Move TestLUGroupAssignNodes to group_unittest.py
While moving the test, it is adapted to the new test framework.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 09:54:52 +0000 (11:54 +0200)]
Fix IPolicy violation check in LUGroupSetParams
cfg.GetMultiInstanceInfoByName returns a list of tuples, not a list of
instance objects which is required by ComputeNewInstanceViolations.
This patch fixes this type error.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 09:54:52 +0000 (11:54 +0200)]
Fix IPolicy violation check in LUGroupSetParams
cfg.GetMultiInstanceInfoByName returns a list of tuples, not a list of
instance objects which is required by ComputeNewInstanceViolations.
This patch fixes this type error.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 07:50:42 +0000 (09:50 +0200)]
Use FQDN to check master node status
The master node name in SS conf is stored as FQDN, so also use the FQDN
on each node to check if it is the master node.
This fixes issue 551.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 12 Aug 2013 14:07:29 +0000 (16:07 +0200)]
Add test for LUClusterVerifyDisks
This LU only creates additional jobs as result, so this is a trivial
unit test.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 12 Aug 2013 05:25:57 +0000 (07:25 +0200)]
Extend unit tests for LUClusterVerifyGroup
- Add tests for additional Verify* methods
- Converted test for VerifyFiles to the new test framework
- Added possibility to prepare the LU in a test class before actually
executing the test method with it
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Tue, 13 Aug 2013 06:55:29 +0000 (08:55 +0200)]
Revert "Display node name instead of UUID in error message"
This reverts commit
fbff213691328562cc4029f3babaa2e72e2012c4.
When running hooks, the node name is used to identify nodes, not (as
wrongly assumed in the patch) the node UUID.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 12 Aug 2013 13:56:00 +0000 (15:56 +0200)]
Display node name instead of UUID in error message
The hooks callback in LUClusterGroupVerify misinterpreted the key in the
node result as name instead of node UUID. This patch fixes this, which
leads to more user friendly error messages.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Thomas Thrainer [Mon, 12 Aug 2013 07:10:17 +0000 (09:10 +0200)]
Use node name in error message
CheckNodeNotDrained displayed only the node UUID if the node is drained.
In order to provide a more helpful error message, use the node name
instead.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Sebastian Gebhard [Thu, 8 Aug 2013 17:00:07 +0000 (19:00 +0200)]
Remove duplicate argument from cabal install
network==2.3 is duplicate in cabal install. One occurrence can thus be removed.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Sebastian Gebhard [Fri, 9 Aug 2013 06:43:33 +0000 (08:43 +0200)]
Typo fix in lib/server/noded.py
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Helga Velroyen [Thu, 8 Aug 2013 16:41:45 +0000 (18:41 +0200)]
QA: make ipolicy test respect enabled disk templates
This makes the 'gnt-cluster modify --ipolicy-*' tests
respect the enabled disk templates on the QA cluster.
If the required disk templates are not enabled, the
test is skipped.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 13:39:14 +0000 (15:39 +0200)]
QA: adjust tests wrt to ipolicy disk templates
This adjusts the cluster QA with respect to the new checks
between the ipolicy disk templates and the enabled disk
templates.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 15:52:38 +0000 (17:52 +0200)]
ClusterSetParams: move vg-name checks from to CheckPrereq
This fixes a bug in the logic of 'gnt-cluster modify'.
Some checks that should better be done in 'CheckPrereq'
were actually done in 'Exec'. This lead to a strange
behavior in case the execution failed, because an
inconsistent state of the cluster's config was kept in
memory.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 12:30:21 +0000 (14:30 +0200)]
man gnt-cluster: mention ipolicy check
This updates the 'gnt-cluster' man page to mention the
relationship between the ipolicy's list of allowed disk
templates and the cluster-wide enabled-disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 12:26:37 +0000 (14:26 +0200)]
Update NEWS file regarding ipolicy checks
This patch updates the NEWS file to mention the new checks
between the ipolicy's list of allowed disk tempaltes and
the cluster-wide enabled disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 12:08:51 +0000 (14:08 +0200)]
gnt-group add/modify: ipolicy vs disk templates
This patch adds a consistency check between the ipolicy's
list of allowed disk templates with the cluster-wide
enable disk templates when a new node group is added
or a group is modified.
It also fixes a bug in gnt-group where the list of allowed
disk templates was not propagated properly.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 11:50:27 +0000 (13:50 +0200)]
Move Ipolicy utility function to cmdlib/common.py
Since the check of consistency between an ipolicy and
the list of enabled disk templates will not only be
needed on cluster modification, but also on group
modification, we move the respective function and its
unit tests to the 'common' module.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 11:39:51 +0000 (13:39 +0200)]
bootstrap: restrict ipolicy to enabled disk templates
With this patch, on cluster creation, the initial instance
policy's list of allowed disk templates will be modified
in a way that it does not contain any disk templates which
are not enabled cluster-wise.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 11:04:45 +0000 (13:04 +0200)]
gnt-cluster modify: ipolicy vs enabled disk templates
This patch adds a check to LUClusterSetParams which
ensures that the list of allowed disk templates is a
subset of the list of cluster-wide enabled disk
templates. Unit tests are included.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Helga Velroyen [Wed, 7 Aug 2013 09:41:51 +0000 (11:41 +0200)]
gnt-cluster modify: factor out ipolicy check
This refactors the LUClusterSetParams to do all ipolicy
sanity / validity checks in a separate function
in order to increase testability. No function changes
otherwise.
Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>
Thomas Thrainer [Thu, 8 Aug 2013 15:05:25 +0000 (17:05 +0200)]
Disable pylint warning to fix build
The _CheckLUResult method gets overridden in a subclass which actually
requires the self parameter, so ignore the pylint remark about it.
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>