ganeti-local
10 years agoAdd Template Haskell 'declareLADT'
Jose A. Lopes [Mon, 16 Sep 2013 13:26:31 +0000 (15:26 +0200)]
Add Template Haskell 'declareLADT'

Add 'declareLADT' in Template Haskell module to declare Haskell
datatypes using 'String's directly as values for the JSON
serialization, as opposed to 'Name's which is what the current
'declareADT' allows.  To achieve this, 'genFromRaw' must be
generalized, similarly to 'genToRaw'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUpdate Python references to exit code constants
Jose A. Lopes [Thu, 12 Sep 2013 15:19:14 +0000 (17:19 +0200)]
Update Python references to exit code constants

Update Python references to exit code constants to take their values
from the generated 'lib/_constants.py'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHaskell to Python constants: add exit code constants
Jose A. Lopes [Mon, 16 Sep 2013 11:57:09 +0000 (13:57 +0200)]
Haskell to Python constants: add exit code constants

Add exit code constants to Haskell to Python constant generation
infrastructure.  The module 'Ganeti.ConstantUtils' must be imported
qualified in order to avoid a clash between
'Ganeti.ConstantUtils.exitFailure' and
'Ganeti.HsConstants.exitFailure'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUpdate Python reference to 'DAEMONS_LOGBASE'
Jose A. Lopes [Thu, 12 Sep 2013 13:12:03 +0000 (15:12 +0200)]
Update Python reference to 'DAEMONS_LOGBASE'

Update Python reference of 'DAEMONS_LOGBASE' to fetch 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>

10 years agoHaskell to Python constants: add 'daemonsLogbase'
Jose A. Lopes [Mon, 16 Sep 2013 11:45:41 +0000 (13:45 +0200)]
Haskell to Python constants: add 'daemonsLogbase'

Move constant 'DAEMONS_LOGBASE' from Python to Haskell to be
automatically generated.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFlip dependency between Haskell types and constants
Jose A. Lopes [Mon, 16 Sep 2013 10:30:18 +0000 (12:30 +0200)]
Flip dependency between Haskell types and constants

Before this patch, Haskell types, such as, 'GanetiDaemon' and
'GanetiGroup', and related functions were taking their values from
Haskell constants.  However, given that the role of Haskell to Python
constants is to leverage Haskell and its typesystem, it makes sense to
first define the Haskell types and then have the constants depend on
these types.  In other words, this patch series inverts the dependency
between (some) Haskell types and constants.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoReplace import in 'Ganeti.Path'
Jose A. Lopes [Fri, 13 Sep 2013 11:00:27 +0000 (13:00 +0200)]
Replace import in 'Ganeti.Path'

Given that Haskell has its own generated 'AutoConf' module, it makes
sense that other Haskell modules import 'configure' variables directly
from 'AutoConf' instead of importing the Python to Haskell generated
constants.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix missing dependency on 'src/hs2py-constants'
Jose A. Lopes [Thu, 12 Sep 2013 13:16:45 +0000 (15:16 +0200)]
Fix missing dependency on 'src/hs2py-constants'

Fix missing dependency on target 'src/hs2py-constants' in
'Ganeti.ConstantUtils'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFurther tests for LUNodeAdd
Sebastian Gebhard [Tue, 17 Sep 2013 09:19:18 +0000 (09:19 +0000)]
Further tests for LUNodeAdd

This patch adds tests for the remaining functionality of LUNodeAdd.

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>

10 years agoAdd unittests for OpenvSwitch in LUNodeAdd
Sebastian Gebhard [Tue, 17 Sep 2013 09:19:17 +0000 (09:19 +0000)]
Add unittests for OpenvSwitch in LUNodeAdd

This patch adds node_unittest.py containing the framework for unit
testing LUNodeAdd.
At this point, only test setup and tests for OpenvSwitch are
implemented.

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>

10 years agoReplace more IPs with reserved adresses
Sebastian Gebhard [Tue, 17 Sep 2013 09:19:17 +0000 (09:19 +0000)]
Replace more IPs with reserved adresses

Recently, some IP addresses were changed to TEST-NETs from RFC 5737.
This patch changes some more occurences of wrong IPs and replaces them.

TEST-NET-1 is used for primary_ips, TEST-NET-2 for networks and TEST-NET-3 for
secondary_ips.

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>

10 years agoMock RPC for unit tests
Sebastian Gebhard [Tue, 17 Sep 2013 09:19:16 +0000 (09:19 +0000)]
Mock RPC for unit tests

This patch enables patching the rpc module to create a mocked version
which can be used to mock a rpc.DnsOnlyRunner(). This is needed for
unit testing LUNodeAdd, as it need to run RPCs against nodes not yet
present in the configuration.

Also, the default return IP of _GetHostnameMock needs to be changed, since
x.x.x.1 is the default IP of the first mocked node and will cause problems.

Parts of this patch were written by Thomas Thrainer.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
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>

10 years agoFix monitoring daemon extra log filepaths
Jose A. Lopes [Mon, 16 Sep 2013 09:01:41 +0000 (11:01 +0200)]
Fix monitoring daemon extra log filepaths

Haskell constants 'daemonsExtraLogfilesGanetiMondAccess' and
'daemonsExtraLogfilesGanetiMondError' cannot be constants because
their Python counterparts are calculated through
'pathutils.GetLogFilename', which indirectly depends on the
environment variable 'GANETI_ROOTDIR', as part of the virtual cluster
configuration.  Instead, these paths must be computed at runtime, as
opposed to being computed at compile time through the Python to
Haskell constant generation, and must also depend on the same
environment variable.  Fixes issue 575.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix lint errors in fix keyerrors patch
Sebastian Gebhard [Fri, 13 Sep 2013 11:28:11 +0000 (11:28 +0000)]
Fix lint errors in fix keyerrors patch

This patch fixes one lint error introduced by my recent patch to
fix keyerrors in lib/cmdlib/node.py.

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>

10 years agoFix example IPs and hostnames in tests
Klaus Aehlig [Fri, 13 Sep 2013 09:07:38 +0000 (11:07 +0200)]
Fix example IPs and hostnames in tests

Our tests are a form of documentation, and hence should use
IPs from the TEST-NET ranges according to RFC 5737. They definitely
should not use real public IP addresses.

Similarly, example host names should be from one of the reserved
domains according to RFC 2606.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix keyerrors in cmdlib node
Sebastian Gebhard [Sat, 24 Aug 2013 10:08:34 +0000 (10:08 +0000)]
Fix keyerrors in cmdlib node

This patch fixes potential key errors in the OpenvSwitch implementation
in cmdlib/node.py. The checks in that file expected to have a ndparams dict
with certain keys to be present. This should not be the case as it will
result in KeyErrors when those keys are not present.

Also: Don't assume that ndparams is given at all.

Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agodesign update: symlink structure
Klaus Aehlig [Mon, 9 Sep 2013 12:41:52 +0000 (14:41 +0200)]
design update: symlink structure

Update the upgrade design document according to the outcome
of the design discussion at GanetiCon 2013. There are two
changes in the design.

* As revision upgrades are binary compatible at all levels,
  one can accept a rough upgrade, just replacing the binaries.
  Therefore, it will become a configure option whether version
  includes revision and suffix, or not.

* The install/uninstall scripts are replaced in favor of another
  level of indirection. In this way, at run time, only two symlinks
  in ${sysconfdir}/ganeti, will be changed, whereas links under
  ${PREFIX}/bin, ${PREFIX}/sbin, and similar, are not touched by
  ganeti itself.

* The layout for the ganeti python libraries, which do not provide
  stable interface, are changed to be used as private modules.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMake CPUload Data Collector aware of clock ticks
Spyros Trigazis [Tue, 10 Sep 2013 13:17:35 +0000 (16:17 +0300)]
Make CPUload Data Collector aware of clock ticks

Modify CPUload data collector to get the number of clock ticks
per second from Posix.Unistd. Since CPUload collector converts
clock ticks (jiffies) to seconds and the clock ticks to seconds
ratio varies between linux distributions, it must be read from
the corresponding library to be consistent.

Signed-off-by: Spyros Trigazis <strigazi@gmail.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoAdd shelltest for the --ignore-dynu option of hbal
Klaus Aehlig [Mon, 9 Sep 2013 13:29:25 +0000 (15:29 +0200)]
Add shelltest for the --ignore-dynu option of hbal

In the example, we have two nodes and 6 instances, all using external
storage. There are four small instances on one node, and two big
instances, requiring twice the amount of resources of a small instance,
on the other node. So, with respect to static data, the cluster
is already perfectly balanced. Using the default assumption of
dynamic usage, however, the cluster can be improved by moving
one small instance to the other node. The reason is, that by default,
all instances are assumed to use the same resources, and this measure
dominates, as all static resources are greatly underutilized.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMake hbal support the option --ignore-dynu
Klaus Aehlig [Tue, 10 Sep 2013 10:13:53 +0000 (12:13 +0200)]
Make hbal support the option --ignore-dynu

This will allow to do balancing based only on static information.
In particular, the effect of balancing towards same number of
instances per node that the dynamic usage consideration has
if no usage file is provided, can be turned off, if this is
desired.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMake ExtLoader honor the --ignore-dynu option
Klaus Aehlig [Tue, 10 Sep 2013 11:40:00 +0000 (13:40 +0200)]
Make ExtLoader honor the --ignore-dynu option

Make the external data loader correctly honor the --ignore-dynu option
by clearing the dynamic utilisation data from all instances if the option
is given.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoProvide utility function to clear utilisation data
Klaus Aehlig [Tue, 10 Sep 2013 11:17:11 +0000 (13:17 +0200)]
Provide utility function to clear utilisation data

Using this utility function, the dynamic utilisation of all instances
can be set to 0. This will have the effect of all utilisation being ignored.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoDefine a new option --ignore-dynu
Klaus Aehlig [Tue, 10 Sep 2013 09:52:11 +0000 (11:52 +0200)]
Define a new option --ignore-dynu

This option, if set, will tell htools to ignore any dynamic
use data.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoAdd unit test for LUInstanceQuery and -QueryData
Thomas Thrainer [Tue, 27 Aug 2013 13:49:46 +0000 (15:49 +0200)]
Add unit test for LUInstanceQuery and -QueryData

This patch provides rudimentary unit test coverage for LUInstanceQuery
and LUInstanceQueryData.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd unit tests for LUInstanceMigrate and -Failover
Thomas Thrainer [Tue, 27 Aug 2013 13:34:03 +0000 (15:34 +0200)]
Add unit tests for LUInstanceMigrate and -Failover

This patch adds rudimentary unit test coverage for LUInstanceMigrate and
LUInstanceFailover.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd unit tests for LUInstanceChangeGroup
Thomas Thrainer [Thu, 22 Aug 2013 15:13:07 +0000 (17:13 +0200)]
Add unit tests for LUInstanceChangeGroup

This patch provides unit test coverage for LUInstanceChangeGroup.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUse RpcResult.Warn where appropriate
Thomas Thrainer [Wed, 11 Sep 2013 14:12:00 +0000 (16:12 +0200)]
Use RpcResult.Warn where appropriate

Those two occurrences of warnings can be replaced the RpcResult.Warn
method, which is done in this patch.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoRemove unneeded except block
Thomas Thrainer [Wed, 11 Sep 2013 14:10:25 +0000 (16:10 +0200)]
Remove unneeded except block

The validation of the opcodes already checks the size parameter for the
right type, so this except block is not required.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoRename variable to reflect its content
Thomas Thrainer [Wed, 11 Sep 2013 14:08:55 +0000 (16:08 +0200)]
Rename variable to reflect its content

Rename the "node" variable to "node_uuid" as that's the content it
actually receives.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd unit tests for LUInstanceSetParams
Thomas Thrainer [Wed, 11 Sep 2013 14:05:17 +0000 (16:05 +0200)]
Add unit tests for LUInstanceSetParams

This patch adds unit tests for LUInstanceSetParams. It does not provide
100% coverage, but covers a significant portion.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix testMasterNetmask in TestLUClusterSetParams
Thomas Thrainer [Wed, 11 Sep 2013 14:06:29 +0000 (16:06 +0200)]
Fix testMasterNetmask in TestLUClusterSetParams

The netmask was previously wrongly given as a bitmask, now it's given as
the net prefix length.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix missing dependency in 'src/hs2py-constants'
Jose A. Lopes [Thu, 12 Sep 2013 11:56:24 +0000 (13:56 +0200)]
Fix missing dependency in 'src/hs2py-constants'

Fix target 'src/hs2py-constants' because it must depend on
'src/AutoConf.hs'. Fixes issue 573.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoMerge branch 'stable-2.9' into master
Thomas Thrainer [Thu, 12 Sep 2013 11:23:29 +0000 (13:23 +0200)]
Merge branch 'stable-2.9' into master

* stable-2.9
  Fix bridging in net-common
  Sync build_chroot with buildbot slack role
  Auto-upgrade of disks' config wrt LD-renaming
  Fix tests regarding DISK_LD_DEFAULTS
  Fixing renaming of DISK_LD_DEFAULTS
  Replace LD_* constants with DT_* constants
  QA: fix file storage QA wrt ipolicy
  Bump versions to release 2.9~beta1
  Add design-2.9 to docinput
  NEWS update and version bump for 2.8 rc2
  Lint improvements to regexps
  Add unit test for GetLinuxNodeInfo
  Prepare GetLinuxNodeInfo for testing
  Check right disk template in inst set params
  Make the DRBD collector more failure-resilient
  Add function to unwrap Results logging failures
  Fix bug in NodeD and RapiD usage strings

* stable-2.8
  Make tools/users-setup explain its actions first
  Generate tools/users-setup from descriptions
  Provide ganeti user and group data in easy-to-parse form
  Remove dsahostkeypub during config downgrade
  Mark the DSA host pubkey as optional
  Fix documentation for gnt-node evacuate -p option

Conflicts:
Makefile.am (trivial)
devel/build_chroot (took changes from 2.9 but newer regex-pcre
                        version)
lib/cmdlib/cluster.py (followed LD_* -> DT_* change)
lib/objects.py (followed LD_* -> DT_* change)
test/py/ganeti.cmdlib_unittest.py (followed LD_* -> DT_* change)

The LD_* -> DT_* change required some more changes in the cmdlib unit
tests.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUpdate reference to Python constants
Jose A. Lopes [Wed, 11 Sep 2013 10:41:40 +0000 (12:41 +0200)]
Update reference to Python constants

Update reference to 'DAEMONS_PORTS' and related constants that are
used on the Haskell side to construct the 'daemonsPorts' constant.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd 'daemonsPorts' and related constants
Jose A. Lopes [Wed, 11 Sep 2013 09:21:35 +0000 (11:21 +0200)]
Add 'daemonsPorts' and related constants

* add 'daemonsPorts' and related constants used in the construction of
  the 'Map' that maps each daemon to its corresponding protocol and
  port.  This breaks constant 'daemonsPortsGanetiNoded' which is
  automatically generated from the Python dictionary 'DAEMONS_PORTS'

* replace reference from constant 'daemonsPortsGanetiNoded' to
  'defaultNodedPort' because constant 'daemonsPortsGanetiNoded' was a
  tuple containing the protocol and the port for node daemon, but only
  the port was needed.  And because this tuple was making Haskell to
  Python constant generation more difficult, it is preferable to
  replace this tuple with the actual port and use it directly, in
  module 'Ganeti.Rpc'

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd 'Protocol' datatype
Jose A. Lopes [Wed, 11 Sep 2013 07:57:25 +0000 (09:57 +0200)]
Add 'Protocol' datatype

Add 'Protocol' datatype which is necessary for the 'daemonsPorts'
constant.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix instances of 'PyValue'
Jose A. Lopes [Wed, 11 Sep 2013 08:19:51 +0000 (10:19 +0200)]
Fix instances of 'PyValue'

Fix instances of 'PyValue', namely, for tuples and maps.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUpdate references to Python constants
Jose A. Lopes [Wed, 11 Sep 2013 09:02:55 +0000 (11:02 +0200)]
Update references to Python constants

Update references to the Python constants introduced by the previous
patch.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoHaskell to Python constants: more constants
Jose A. Lopes [Tue, 10 Sep 2013 13:45:51 +0000 (15:45 +0200)]
Haskell to Python constants: more constants

* move several groups of constants, from Python to Haskell, which are
  currently being used in Haskell, including SSH and daemon related
  constants, policy allocation, blockdev driver manual (this is a
  single constant), auto repair related constants, and data collector
  version (also a single constant)
* constant 'AUTO_REPAIR_ALL_RESULTS' is moved to Python and its type
  changes from '[String]' to 'FrozenSet String' in order to be
  consistent with the Python type
* fix tests related to the constant 'autoRepairAllResults' (i.e., the
  Haskell version of 'AUTO_REPAIR_ALL_RESULTS') to reflect the type
  change
* update instances of 'FrozenSet'

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoMerge branch 'stable-2.8' into stable-2.9
Thomas Thrainer [Thu, 12 Sep 2013 08:55:43 +0000 (10:55 +0200)]
Merge branch 'stable-2.8' into stable-2.9

* stable-2.8
  Make tools/users-setup explain its actions first
  Generate tools/users-setup from descriptions
  Provide ganeti user and group data in easy-to-parse form
  Remove dsahostkeypub during config downgrade
  Mark the DSA host pubkey as optional
  Fix documentation for gnt-node evacuate -p option

Conflicts:
Makefile.am (trivial)
tools/cfgupgrade (removed downgrade code to 2.7)

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoMake tools/users-setup explain its actions first
Klaus Aehlig [Wed, 11 Sep 2013 09:00:15 +0000 (11:00 +0200)]
Make tools/users-setup explain its actions first

Before doing any changes, make tools/users-setup explain its
actions first, and ask the user for confirmation. If the first
argument is --yes-do-it, this step will be skipped.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoGenerate tools/users-setup from descriptions
Klaus Aehlig [Wed, 11 Sep 2013 08:27:23 +0000 (10:27 +0200)]
Generate tools/users-setup from descriptions

Now that we have a machine readable description of the users
to be added to the system, use it to generate the tools/users-setup
script, so that we again have only one authoritative source of
the user and group requirements. This also has the advantage of
of avoiding duplicate additions and attemps add a user root.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoProvide ganeti user and group data in easy-to-parse form
Klaus Aehlig [Tue, 10 Sep 2013 16:00:23 +0000 (18:00 +0200)]
Provide ganeti user and group data in easy-to-parse form

Upon build time, also generate, in the directory doc/users, files
containing the groups, the users with their primary group, and the
additional groupmemberships to be added. In this way, packages can use
their own way of adding users to the system, instead of telling the
adiministrator to run tools/users-setup.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoInconsistent auto repair related constant
Jose A. Lopes [Wed, 11 Sep 2013 08:14:17 +0000 (10:14 +0200)]
Inconsistent auto repair related constant

In 'lib/constants.py', fix inconsistency in the value of
'AUTO_REPAIR_TAG_SUSPENDED'. Fixes issue 569.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoUpdate constant references
Jose A. Lopes [Tue, 10 Sep 2013 11:13:11 +0000 (13:13 +0200)]
Update constant references

Update Python user separation constants to reference the generated
module 'lib/_constants.py' instead of 'lib/_autoconf.py'.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd user separation constants
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>

10 years agoAdd target 'AutoConf.hs'
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>

10 years agoAdd AutoConf.hs.in
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>

10 years agoAlso clean up top-level *.tix files
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>

10 years agoHaskell to Python constants: Update 'ADMINST_ALL' reference
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>

10 years agoHaskell to Python constants: add 'adminstAll'
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>

10 years agoAdd 'FrozenSet'
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>

10 years agoFix module documentation
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>

10 years agoFix module documentation
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>

10 years agoFix module documentation
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>

10 years agoWrap 'Set' in 'ListSet' for the opcodes
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>

10 years agoFix 'List' instance of 'PyValue'
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>

10 years agoReplace literals with constants
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>

10 years agoFix bridging in net-common
Sebastian Gebhard [Wed, 4 Sep 2013 13:12:02 +0000 (13:12 +0000)]
Fix bridging in net-common

Bridging does not work correctly in net-common. The parameters passed
by Ganeti are put in /var/run/ganeti/xen-hypervisor/nic/$domname/$devid
and read again from there before running the setup functions according
to the $MODE which is read from the file.

When using MODE=bridged, the script expects to get the name of the
bridge passed as $BRIDGE, but is actually stored and passed as $LINK.
This patch fixes the issue.

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>

10 years agoRemove dsahostkeypub during config downgrade
Apollon Oikonomopoulos [Sun, 1 Sep 2013 20:37:08 +0000 (23:37 +0300)]
Remove dsahostkeypub during config downgrade

Remove the newly-added DSA host public key field from the configuration file
when downgrading to 2.7, if present. Otherwise masterd will refuse to start.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoMark the DSA host pubkey as optional
Apollon Oikonomopoulos [Sun, 1 Sep 2013 20:36:29 +0000 (23:36 +0300)]
Mark the DSA host pubkey as optional

Commit a9542a4 introduced support for DSA SSH keys. However, the dsahostkeypub
field added to the config is not marked as optional in the Haskell components.
As a result, luxid thinks the config file is corrupt and refuses to start. We
fix this by marking the dsahostkeypub as an optionalField.

This fixes issue 560.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoSync build_chroot with buildbot slack role
Michele Tartara [Fri, 30 Aug 2013 12:25:22 +0000 (14:25 +0200)]
Sync build_chroot with buildbot slack role

Keep the build_chroot script as similar as possible to the buildbot's slack role
for squeeze.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoDon't install dangling symlink for hail
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>

10 years agoAuto-upgrade of disks' config wrt LD-renaming
Helga Velroyen [Thu, 29 Aug 2013 12:30:02 +0000 (14:30 +0200)]
Auto-upgrade of disks' config wrt LD-renaming

This patch adds auto-upgrade functionality to the disk
objects with respected to the switch from LD constants
to DT constants. Unit tests are provided.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoHaskell to Python opcodes: fix Unit
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>

10 years agoImport original constants instead of generated
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>

10 years agoUpdate Python constants references to '_constants.py'
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>

10 years agoSetup constant generation infrastructure
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>

10 years agoRename 'Constants.hs' to 'PyConstants.hs'
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>

10 years agoAdd Template Haskell code for constant generation
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>

10 years agoMove some 'PyValue' instances to a separate file
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>

10 years agoFix tests regarding DISK_LD_DEFAULTS
Helga Velroyen [Thu, 29 Aug 2013 07:52:29 +0000 (09:52 +0200)]
Fix tests regarding DISK_LD_DEFAULTS

This fixes two remaining issues regarding the renaming
of DISK_LD_DEFAULTS:

- The keys of the map DISK_LD_DEFAULTS cannot be compared
to DISK_TEMPLATES right away, because there are no
defaults for the diskless template. This patch adjusts
the test.

- The test data for the LV collector of the monitoring
agent needed to be adjusted to the new usage of the
DT constants.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFixing renaming of DISK_LD_DEFAULTS
Helga Velroyen [Wed, 28 Aug 2013 16:46:10 +0000 (18:46 +0200)]
Fixing renaming of DISK_LD_DEFAULTS

This fixes the somewhat over-eager renaming of
DISK_LD_DEFAULTS to DISK_DT_DEFAULTS, which clashes
with another occurence of DISK_DT_DEFAULTS. This
patch just undoes the renaming and additionally fixes
a test regarding shared file storage.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix documentation for gnt-node evacuate -p option
Leon Handreke [Wed, 28 Aug 2013 15:10:49 +0000 (16:10 +0100)]
Fix documentation for gnt-node evacuate -p option

Update the documentation to remove the claim that the --primary-only
option results in data copies while in fact it only fails over/migrates
the all primary instances.

Signed-off-by: Leon Handreke <lhandreke@google.com>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoReplace LD_* constants with DT_* constants
Helga Velroyen [Tue, 27 Aug 2013 13:38:58 +0000 (15:38 +0200)]
Replace LD_* constants with DT_* constants

LD_* constants are basically like DT_* constants, except
for that both file and shared file were mapped to file.
In order to not having to maintain three slightly different
sets of disk-related constants (DT, LD and ST), we merge
DT and LD here. This patch does the renaming of the
various constants and then fixes the handling of shared
file disks.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoQA: fix file storage QA wrt ipolicy
Helga Velroyen [Tue, 27 Aug 2013 13:15:18 +0000 (15:15 +0200)]
QA: fix file storage QA wrt ipolicy

Ipolicy-allowed disk templates are now dependend on the
cluster-wide enabled disk-templates. The QA for file
storage did not consider this updated logic so far.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoBump versions to release 2.9~beta1 v2.9.0beta1
Klaus Aehlig [Tue, 27 Aug 2013 13:41:33 +0000 (15:41 +0200)]
Bump versions to release 2.9~beta1

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoAdd design-2.9 to docinput
Klaus Aehlig [Tue, 27 Aug 2013 15:24:09 +0000 (17:24 +0200)]
Add design-2.9 to docinput

While design-2.9.rst was already created earlier, it
wasn't registered in the Makefile. Fix this.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoProvide symlinks for all myexeclib_SCRIPTS
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>

10 years agoCLI: actually remove the --no-drbd-storage option
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>

10 years agocluster init/modify: set helper without DRBD being enabled
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>

10 years agoQA: adapt changes wrt DRBD usermode helper
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>

10 years agoobjects.py: upgrade config
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>

10 years agocluster modify: deprecate --no-drbd-storage
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>

10 years agocluster init: deprecate --no-drbd-storage
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>

10 years agocluster verify: check drbd helper only when drbd enabled
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>

10 years agocmdlib/cluster.py: unit tests for usermode helper
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>

10 years agognt_cluster.py: unit test for usermode helper
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>

10 years agobootstrap.py: unit tests for setting the usermode helper
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>

10 years agoIn the manpages, use unversioned paths
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>

10 years agoMerge branch 'stable-2.8' into stable-2.9
Klaus Aehlig [Tue, 27 Aug 2013 11:02:07 +0000 (13:02 +0200)]
Merge branch 'stable-2.8' into stable-2.9

* stable-2.8
  Add function to unwrap Results logging failures
  Make the DRBD collector more failure-resilient
  Prepare GetLinuxNodeInfo for testing
  Add unit test for GetLinuxNodeInfo
  NEWS update and version bump for 2.8 rc2

Conflicts:
Makefile.am
NEWS
configure.ac
lib/hypervisor/hv_base.py

For hv_base.py, take the changes of stable-2.8, for
configure.ac take the version of stable-2.9, for the
rest, take both additions.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoChange versiondir to adhere the changed design
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>

10 years agoChange design to install to ${PREFIX}/lib/ganeti-${VERSION}
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>

10 years agoNEWS update and version bump for 2.8 rc2 v2.8.0rc2
Michele Tartara [Tue, 27 Aug 2013 07:59:14 +0000 (09:59 +0200)]
NEWS update and version bump for 2.8 rc2

Latest modifications and fixes added to the NEWS file.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

10 years agoSimplify '_CheckOutputFields'
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>

10 years agoAdd 'SF_NODE' to 'VALID_STORAGE_FIELDS'
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>

10 years agoRemove storage field duplication in 'qa'
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>

10 years agoUpdate iallocator design to include MonD data
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>

10 years agoLint improvements to regexps
Michele Tartara [Wed, 21 Aug 2013 12:19:19 +0000 (12:19 +0000)]
Lint improvements to regexps

Fix some regular expressions so that they pass lint checks with newer versions
of pylint.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoAdd name for the Parameter ND_OVS
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>