ganeti-local
12 years agoMerge branch 'devel-2.5'
Michael Hanselmann [Thu, 12 Apr 2012 19:17:24 +0000 (21:17 +0200)]
Merge branch 'devel-2.5'

* devel-2.5: (29 commits)
  gnt-* {add,list,remove}-tags: Unify options
  Bump version for 2.5.0 final release
  configure.ac: Fix “too many arguments” error
  Fix extra whitespace
  Further fixes concerning drbd port release
  Fix a bug concerning TCP port release
  Fix extra whitespace
  Fix a bug concerning TCP port release
  ganeti.initd: Add “status” action
  Add whitelist for opcodes using BGL
  LUOobCommand: acquire BGL in shared mode
  Fix docstring bug
  LUNodeAdd: Verify version in Prereq
  LUNodeAdd: Verify version in Prereq
  Fix LV status parsing to accept newer LVM
  gnt-instance info: Show node group information
  cmdlib: Factorize checking acquired node group locks
  Bump version for 2.5.0~rc6 release
  cmdlib: Stop forking in LUClusterQuery
  locking: Notify only once on release
  ...

Conflicts:
NEWS: Trivial
daemons/daemon-util.in: Copyright line
lib/client/gnt_group.py: Tag operations
lib/cmdlib.py: Not so trivial, hopefully correct

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agognt-* {add,list,remove}-tags: Unify options
Michael Hanselmann [Thu, 12 Apr 2012 17:31:37 +0000 (19:31 +0200)]
gnt-* {add,list,remove}-tags: Unify options

- Listing tags is a query, so neither “--priority” nor “--submit” make
  sense
- Support both options for adding/removing tags
- Also remove “--submit” from “gnt-node health”; it doesn't work and
  doesn't make sense for listing node health

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoMerge branch 'stable-2.5' into devel-2.5
Michael Hanselmann [Thu, 12 Apr 2012 16:12:48 +0000 (18:12 +0200)]
Merge branch 'stable-2.5' into devel-2.5

* stable-2.5:
  Bump version for 2.5.0 final release
  configure.ac: Fix “too many arguments” error
  Fix extra whitespace
  Further fixes concerning drbd port release
  Fix a bug concerning TCP port release
  Fix extra whitespace
  Fix a bug concerning TCP port release

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoBump version for 2.5.0 final release v2.5.0
Michael Hanselmann [Wed, 11 Apr 2012 17:34:58 +0000 (19:34 +0200)]
Bump version for 2.5.0 final release

Also update NEWS file.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoMerge branch 'devel-2.4' into stable-2.5
Michael Hanselmann [Wed, 11 Apr 2012 18:26:35 +0000 (20:26 +0200)]
Merge branch 'devel-2.4' into stable-2.5

* devel-2.4:
  Fix extra whitespace
  Further fixes concerning drbd port release
  Fix a bug concerning TCP port release

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoconfigure.ac: Fix “too many arguments” error
Michael Hanselmann [Wed, 11 Apr 2012 17:34:54 +0000 (19:34 +0200)]
configure.ac: Fix “too many arguments” error

If GHC_PKG_QUICKCHECK contains multiple values, the test would fail
with “too many arguments”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoFix extra whitespace
Iustin Pop [Fri, 30 Mar 2012 10:44:51 +0000 (12:44 +0200)]
Fix extra whitespace

Sorry, didn't catch this before…

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit 54b010cad1ea0a536ed037bf315a04dd1c079964)

Signed-off-by: Michael Hanselmann <hansmi@google.com>

12 years agoFurther fixes concerning drbd port release
Dimitris Aragiorgis [Mon, 2 Apr 2012 18:27:35 +0000 (21:27 +0300)]
Further fixes concerning drbd port release

Commit 3b3b1bc does not entirely fix the bug introduced in commit
f396ad8. It fixes consistency of config data in permanent storage, but
does not ensure consistency in data held in runtime memory of masterd.

The bug of duplicate ports is still triggered when LUInstanceRemove()
invokes _RemoveDisks() and this returns False (in case
call_blockdev_remove RPC fails). The drbd ports get returned in the
pool, but execution is aborted and RemoveInstance() is never invoked.

Due to the fact that port handling is not done with
TemporaryReservationManager, ensure that ports are released, only if
disk related config data is deleted.

In _RemoveDisks() release ports only if all RPCs succeed.

Extend _RemoveDisks() to include ignore_failures argument passed by
_RemoveInstance() to handle the ports appropriately.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix a bug concerning TCP port release
Dimitris Aragiorgis [Fri, 30 Mar 2012 09:47:14 +0000 (11:47 +0200)]
Fix a bug concerning TCP port release

Commit f396ad8 returns the TCP port used by DRBD disk back to the
TCP/UDP port pool using AddTcpUdpPort().

However, AddTcpUdpPort() writes the config on every invocation,
using _WriteConfig(). This causes two problems:

 * it causes critical errors logged by VerifyConfig(), after the DRBD
   disk removal, and until the actual instance removal.
 * if the code following AddTcpUdpPort() fails, the port is already
   returned back the pool, which causes the port to have duplicates
   (inconsistent config).

AddTcpUdpPort() is invoked in three cases:

 * during InstanceRemove() through _RemoveDisks().
 * during InstanceSetParams() in case of disk removal.
 * during InstanceSetParams() through _ConvertDrbdToPlain().

This commit fixes the problem by removing the _WriteConfig() call from
AddTcpUdpPort(), delegate it to Update() via the
TemporaryReservationManager and ensure AddTcpUdpPort() precedes
Update().

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
[iustin@google.com: small comments adjustements]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit 3b3b1bca566a005acd622a5b6e49528e5e3dbe85)

12 years agoFix query unittests after converting jobs to query2
Michael Hanselmann [Fri, 30 Mar 2012 13:01:38 +0000 (15:01 +0200)]
Fix query unittests after converting jobs to query2

I missed these among some shelltest-related failures.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoQA: Add tests for “gnt-job list”
Michael Hanselmann [Wed, 28 Mar 2012 12:31:46 +0000 (14:31 +0200)]
QA: Add tests for “gnt-job list”

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agognt-job list: Switch to query2
Michael Hanselmann [Wed, 28 Mar 2012 12:37:55 +0000 (14:37 +0200)]
gnt-job list: Switch to query2

This brings “gnt-job list” up to the same level as “gnt-instance list”
with filters. Further updates will add more parameters for the most
common filters (e.g. only running jobs).

Also update the man page.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agognt-job info: Convert to query2
Michael Hanselmann [Wed, 28 Mar 2012 12:36:12 +0000 (14:36 +0200)]
gnt-job info: Convert to query2

Otherwise detecting unavailable jobs is hard (“status” is None, is this
an error or just an unavailable job?).

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoAdd job support to query2 via LUXI
Michael Hanselmann [Wed, 28 Mar 2012 12:34:16 +0000 (14:34 +0200)]
Add job support to query2 via LUXI

This enables the use of filters through query2 when listing jobs.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agojqueue: Cache prepared field list in _JobChangesChecker
Michael Hanselmann [Wed, 28 Mar 2012 12:32:59 +0000 (14:32 +0200)]
jqueue: Cache prepared field list in _JobChangesChecker

… instead of re-calculating it on every file change.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoNEWS: Deprecate LUXI calls replaced with query2
Michael Hanselmann [Wed, 28 Mar 2012 12:30:37 +0000 (14:30 +0200)]
NEWS: Deprecate LUXI calls replaced with query2

Adding the “luxi” namespace is necessary in “sphinx_ext”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agojqueue: Convert GetInfo to query2
Michael Hanselmann [Wed, 28 Mar 2012 12:28:50 +0000 (14:28 +0200)]
jqueue: Convert GetInfo to query2

This rather inefficient implementation (fields are evaluated on every
call to GetInfo) is not good for WaitForJobChanges and doesn't support
filters, but that will be rectified in later patches.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoquery: Add definitions for job fields
Michael Hanselmann [Wed, 28 Mar 2012 12:29:54 +0000 (14:29 +0200)]
query: Add definitions for job fields

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoqlang.MakeFilter: Enable use of different name field
Michael Hanselmann [Wed, 28 Mar 2012 12:25:48 +0000 (14:25 +0200)]
qlang.MakeFilter: Enable use of different name field

Jobs don't have a “name” field, so we must be able to control
the field used for simple filters.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoMerge cli.FormatTimestamp and utils.FormatTime
Michael Hanselmann [Wed, 28 Mar 2012 14:19:55 +0000 (16:19 +0200)]
Merge cli.FormatTimestamp and utils.FormatTime

… to some degree at least. Unittests are included.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoconstants: Don't hardcode priorities for LOCK_ATTEMPTS_TIMEOUT
Michael Hanselmann [Wed, 28 Mar 2012 13:55:21 +0000 (15:55 +0200)]
constants: Don't hardcode priorities for LOCK_ATTEMPTS_TIMEOUT

Also include unittest for LOCK_ATTEMPTS_TIMEOUT.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agojqueue._QueuedOpCode: Change a docstring
Michael Hanselmann [Wed, 28 Mar 2012 13:41:36 +0000 (15:41 +0200)]
jqueue._QueuedOpCode: Change a docstring

There was a typo and it's not necessary to repeat the class name.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agolocking: Remove unused OldStyleQueryLocks
Michael Hanselmann [Wed, 28 Mar 2012 12:32:03 +0000 (14:32 +0200)]
locking: Remove unused OldStyleQueryLocks

No longer used after commit 090377807.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoFix extra whitespace
Iustin Pop [Fri, 30 Mar 2012 10:44:51 +0000 (12:44 +0200)]
Fix extra whitespace

Sorry, didn't catch this before…

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoFix a bug concerning TCP port release
Dimitris Aragiorgis [Tue, 13 Mar 2012 14:48:58 +0000 (16:48 +0200)]
Fix a bug concerning TCP port release

Commit f396ad8 returns the TCP port used by DRBD disk back to the
TCP/UDP port pool using AddTcpUdpPort().

However, AddTcpUdpPort() writes the config on every invocation,
using _WriteConfig(). This causes two problems:

 * it causes critical errors logged by VerifyConfig(), after the DRBD
   disk removal, and until the actual instance removal.
 * if the code following AddTcpUdpPort() fails, the port is already
   returned back the pool, which causes the port to have duplicates
   (inconsistent config).

AddTcpUdpPort() is invoked in three cases:

 * during InstanceRemove() through _RemoveDisks().
 * during InstanceSetParams() in case of disk removal.
 * during InstanceSetParams() through _ConvertDrbdToPlain().

This commit fixes the problem by removing the _WriteConfig() call from
AddTcpUdpPort(), delegate it to Update() via the
TemporaryReservationManager and ensure AddTcpUdpPort() precedes
Update().

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
[iustin@google.com: small comments adjustements]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoganeti.initd: Add “status” action
Michael Hanselmann [Wed, 28 Mar 2012 17:00:49 +0000 (19:00 +0200)]
ganeti.initd: Add “status” action

Eric Rostetter sent a patch adding a “status” action, but unfortunately
his code was apparently specific to Red Hat. I hope this implementation
is more distribution-agnostic; after all “status_of_proc” is part of
LSB. Example output:

$ /etc/init.d/ganeti status
ganeti-noded is not running ... failed!
ganeti-masterd is running.
ganeti-rapi is running.
ganeti-confd is running.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoAdd whitelist for opcodes using BGL
Michael Hanselmann [Wed, 28 Mar 2012 16:11:04 +0000 (18:11 +0200)]
Add whitelist for opcodes using BGL

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoUpdate IP pool management design doc
Dimitris Aragiorgis [Fri, 23 Mar 2012 19:29:55 +0000 (21:29 +0200)]
Update IP pool management design doc

Update IP pool managenent design doc to be consistent
with the implementation.

 * Add new NIC parameter: 'network'
   Can be None for backwards compatibility.
 * Introduce the term 'netparams'
   The NIC inherits netparams (mode, link) as its nicparams
   if assinged to a network. Netparams are defined during
   network connection to a nodegroup.
 * Introduce the term 'Conflicting IPs'
   Ensure IPs uniqueness inside nodegroups.
 * Update 'Hooks' section.
 * Update 'Hook variables' section
 * Update 'Userland interface' to reflect the implementation

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoMerge branch 'stable-2.5' into devel-2.5
Michael Hanselmann [Wed, 28 Mar 2012 16:04:20 +0000 (18:04 +0200)]
Merge branch 'stable-2.5' into devel-2.5

* stable-2.5:
  LUOobCommand: acquire BGL in shared mode

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoLUOobCommand: acquire BGL in shared mode
Bernardo Dal Seno [Wed, 28 Mar 2012 11:42:46 +0000 (13:42 +0200)]
LUOobCommand: acquire BGL in shared mode

Fixed a typo so that now LUOobCommand acquires the BLG in shared mode, as
intended.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoLUNodeAdd: Make the version call only dependend on DNS
René Nussbaumer [Mon, 26 Mar 2012 15:15:55 +0000 (17:15 +0200)]
LUNodeAdd: Make the version call only dependend on DNS

Also move the version check into prereq to abort before alter cluster
state if the version mismatch.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoRPC: Add a new client type for DNS only
René Nussbaumer [Mon, 26 Mar 2012 15:06:02 +0000 (17:06 +0200)]
RPC: Add a new client type for DNS only

This patch moves the “call_version” to a new RPC client definition and
then adds a new runner using the DNS resolver for getting the host
address.

The standard “BootstrapRunner”, where the call was before, tries to
resolve node names using ssconf first, which doesn't work properly when
re-adding a node with a new primary IP address.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoUpdate install document
Iustin Pop [Tue, 27 Mar 2012 09:27:29 +0000 (11:27 +0200)]
Update install document

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoUpdate admin doc
Iustin Pop [Tue, 27 Mar 2012 09:27:22 +0000 (11:27 +0200)]
Update admin doc

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoUpdate walkthrough document
Iustin Pop [Tue, 27 Mar 2012 09:27:09 +0000 (11:27 +0200)]
Update walkthrough document

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoUpdate default instance kernel version
Iustin Pop [Fri, 23 Mar 2012 09:17:56 +0000 (09:17 +0000)]
Update default instance kernel version

We switch from vmlinuz-2.6-… to vmlinuz-3-…. To do this nicely, we
also add a ./configure-time setting for the KVM instance kernel.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoUpdate INSTALL and devnotes documents
Iustin Pop [Fri, 23 Mar 2012 08:58:02 +0000 (08:58 +0000)]
Update INSTALL and devnotes documents

Added the new Haskell library requirements, for both normal and
developer usage.

Furthermore, all commands are now converted to the shell-example
lexer.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix escaping of percent signs in the shell lexer
Iustin Pop [Tue, 27 Mar 2012 09:00:35 +0000 (11:00 +0200)]
Fix escaping of percent signs in the shell lexer

Of course, we do have cases where we want to escape the percent signs,
and our regexes were not fully correct for this case.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAdd a special lexer for sphinx/pygments
Iustin Pop [Mon, 26 Mar 2012 12:57:26 +0000 (14:57 +0200)]
Add a special lexer for sphinx/pygments

This will be used throughout our docs for better formatting example
shell sessions, with custom markup for comments, user fixed input and
user variable input.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoganeti.7: Add more filter examples
Michael Hanselmann [Fri, 23 Mar 2012 14:59:06 +0000 (15:59 +0100)]
ganeti.7: Add more filter examples

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoEnable -Werror by default for htools
Iustin Pop [Sun, 25 Mar 2012 14:32:35 +0000 (16:32 +0200)]
Enable -Werror by default for htools

Since the code base is now "clean" across all supported GHC versions
(6.12-7.4), we can enable -Werror again.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoSwitch to new-style exception handling
Iustin Pop [Sun, 25 Mar 2012 14:26:02 +0000 (16:26 +0200)]
Switch to new-style exception handling

Currently, we're using Prelude.catch to handle I/O errors in
htools. This style of error handling has been deprecated for a while,
but it still used to work without warnings.

However, the GHC release 7.4 has started to emit deprecation warnings
for it, so we change to the Control.Exception module; the code is a
bit less clean since we only care about I/O errors (but
Control.Exception deals with other error types too), so we have to
filter the exceptions.

Note that the new style exception handling is not really "new"; it has
existed since at least GHC 6.12, which is our oldest supported
compiler.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoChange a type computation for compatibility with 6.12
Iustin Pop [Sat, 24 Mar 2012 23:21:15 +0000 (00:21 +0100)]
Change a type computation for compatibility with 6.12

This is the last warning related to TemplateHaskell that was 6.12
specific; for some reason, it doesn't "see" that traw/tname were used.

The patch just replaces the quoting syntax with an explicit type
declaration; while less readable, it also has less warnings.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoFix compatibility with TemplateHaskell from GHC 7.4
Iustin Pop [Sat, 24 Mar 2012 22:34:42 +0000 (23:34 +0100)]
Fix compatibility with TemplateHaskell from GHC 7.4

GHC 7.4 has updated the TemplateHaskell library, and it turns out that
the way we built the JSON instance implementation for showJSON was not
good (probably this is why GHC 6.12 was generating some warnings).

The patch changes the build of showJSON to be the same as readJSON,
which was working fine. As a bonus, this fixes both the 7.4 issue and
the 6.12 one.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAdd trivial tests for gnt-* cli
Iustin Pop [Fri, 23 Mar 2012 16:32:57 +0000 (17:32 +0100)]
Add trivial tests for gnt-* cli

While testing some other stuff, I realised that the gnt-* commands
could be broken (as in, the script fails with syntax errors), but make
check doesn't detect it. Since we have shelltest, we can now add
trivial tests for this case.

One downside is that starting the scripts seems to be much slower
than the htools binaries, so we can't add as many tests.

The other downside is that shelltest is now required for all
development work, but I think this is a small disadvantage compared to
the increased testing possibilities.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix hardcoded Xen kernel path
Iustin Pop [Fri, 23 Mar 2012 09:08:41 +0000 (09:08 +0000)]
Fix hardcoded Xen kernel path

We already have a ./configure-time variable for this, but it seems to
be actually unused.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix docstring bug
Iustin Pop [Thu, 22 Mar 2012 21:00:06 +0000 (21:00 +0000)]
Fix docstring bug

Fix a typo introduced in commit c85b15c1, which breaks epydoc.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoEnable selection between Python and Haskell confd
Iustin Pop [Thu, 22 Mar 2012 23:30:28 +0000 (23:30 +0000)]
Enable selection between Python and Haskell confd

This patch changes configure.ac Makefile.am so that the user can pass:

- --disable-confd (or --enable-confd=no) to disable it completely
- --enable-confd=yes or --enable-confd=python to select the
  traditional implementation (this is the default setting)
- --enable-confd=haskell to select hconfd

The only "not nice" thing is that I've chosen to keep the
hconfd.hs/hconfd name, and we rename it after install via an
install-exec-hook. The other choice is possible too (to rename the
source file/binary).

One additional note is that if we select haskell, the _rule_ for
creating daemons/ganeti-confd dissapears; whereas if we select python,
the rule for htools/hconfd still exists (one can build it explicitly),
it just is not installed. This is due to the different way in which
the rules are declared.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoFix qemu-img configure.ac check
Iustin Pop [Thu, 22 Mar 2012 22:59:00 +0000 (22:59 +0000)]
Fix qemu-img configure.ac check

By accident, commit a002ed7 introduced the qemu-img checks in the
htools block. I found this also by mistake while investigating
another issue :)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoMerge branch 'stable-2.5' into devel-2.5
Guido Trotter [Fri, 23 Mar 2012 12:39:41 +0000 (12:39 +0000)]
Merge branch 'stable-2.5' into devel-2.5

* stable-2.5:
  LUNodeAdd: Verify version in Prereq
  Fix LV status parsing to accept newer LVM
  Bump version for 2.5.0~rc6 release
  Revert "Stop acquiring BGL for LUXI queries"
  LUClusterVerifyConfig: Share BGL, acquire all locks in shared mode
  KVM: don't add -nographic using spice
  Stop acquiring BGL for LUXI queries
  Fix type error in LUInstanceChangeGroup

Conflicts:
lib/hypervisor/hv_kvm.py
  - trivial, keep both changes

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoLUNodeAdd: Verify version in Prereq v2.5.0rc6
René Nussbaumer [Fri, 23 Mar 2012 11:18:15 +0000 (12:18 +0100)]
LUNodeAdd: Verify version in Prereq

There are other ways to leave the cluster in a broken state than just
the version check. However they are not very trivial to fix in 2.5. So
leave it up to 2.6 for a nicer fix.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
(cherry picked from commit e2ea8de1663b9a49219f2ea0709653b424384436)

12 years agoLUNodeAdd: Verify version in Prereq
René Nussbaumer [Fri, 23 Mar 2012 11:18:15 +0000 (12:18 +0100)]
LUNodeAdd: Verify version in Prereq

There are other ways to leave the cluster in a broken state than just
the version check. However they are not very trivial to fix in 2.5. So
leave it up to 2.6 for a nicer fix.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix LV status parsing to accept newer LVM
Iustin Pop [Thu, 22 Mar 2012 19:16:20 +0000 (19:16 +0000)]
Fix LV status parsing to accept newer LVM

LVM version 2.02.93 (or at least, sometimes after .88) has extend the
lv_attr field with two more flag; we only care about the first digit,
so let's change the "!= 6" check to "< 6".

Thanks to Robin H Johnson <robbat2@gentoo.org> for finding this issue.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agognt-instance info: Show node group information
Michael Hanselmann [Thu, 22 Mar 2012 17:23:08 +0000 (18:23 +0100)]
gnt-instance info: Show node group information

This requires acquiring the node group locks in shared mode.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agocmdlib: Factorize checking acquired node group locks
Michael Hanselmann [Thu, 22 Mar 2012 16:56:38 +0000 (17:56 +0100)]
cmdlib: Factorize checking acquired node group locks

The “cur_group_uuid” parameter is optional to prepare for using the
factorized code from LUInstanceQueryData.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoRework exit model
Iustin Pop [Thu, 22 Mar 2012 12:34:53 +0000 (12:34 +0000)]
Rework exit model

While updating the confd code, I realised that we have _lots_ of
duplication in the exit model for the various programs.

So this patch attempts to abstract all the exits via a couple of new
functions; sorry for the somewhat big patch, but I hope the payoff is
worth the change: the actual exit conditions are much clearer.

Note that the patch (also) moves the exitIfBad function to Utils.hs,
since that is more logical.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoBump version for 2.5.0~rc6 release
Michael Hanselmann [Thu, 22 Mar 2012 15:26:02 +0000 (16:26 +0100)]
Bump version for 2.5.0~rc6 release

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoFix out-of-tree builds
Iustin Pop [Thu, 22 Mar 2012 14:55:01 +0000 (14:55 +0000)]
Fix out-of-tree builds

The new shell tests do not succeed out-of-tree, due to static paths
and other issues. This trivial patch fixes these issue, make distcheck
now passes.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agocmdlib: Stop forking in LUClusterQuery
Michael Hanselmann [Thu, 22 Mar 2012 14:13:36 +0000 (15:13 +0100)]
cmdlib: Stop forking in LUClusterQuery

While debugging another issue we realized that LUClusterQuery forks.
This turned out to be the “platform.architecture” function from the
Python library. It uses the “file” command to determine the architecture
of the Python binary.

This patch adds two new functions to the “runtime” module to get this
information once per process instead of doing it every single time
LUClusterQuery is used. Forking is a no-go in a multi-threaded
environment anyway.

A future change will also have to change the terminology in “gnt-cluster
info”: it reports the binary architecture simply as “architecture”, when
it's actually the binaries' architecture. Kernel and userland can be
different.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

12 years agoConvert manual shell tests to shelltestrunner
Iustin Pop [Wed, 21 Mar 2012 01:06:29 +0000 (01:06 +0000)]
Convert manual shell tests to shelltestrunner

This is more of a RFC… Basically most of the shell-based tests are
converted from exec+grep to shelltestrunner.

Things are not all fine and nice though:

- we have dependencies between tests, as some generate some data files
  needed later; this is not nice, and we depend on serial execution in
  testrunner
- we can still fail with no so nice messages in the offline-test
  script (when we generate most of the data)

But overall, I think the tests are much nicer to
define/read/debug:

- each test is standalone, with the only dependency being an optional
  input data file; this is much better than a single monolithic shell
  script
- in case of failures, the failure is clearly shown by shell test,
  both for exit code and stdout/stderr
- shelltest can run in --debug mode, where the exact details are shown
  much better than the alternative of "set -x" for the shell script

Comments welcome!

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoAdd command line option for controlling syslog use
Iustin Pop [Wed, 21 Mar 2012 16:48:07 +0000 (16:48 +0000)]
Add command line option for controlling syslog use

… and enable it in hconfd.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAdd support for syslog logging to Ganeti.Logging
Iustin Pop [Wed, 21 Mar 2012 15:08:28 +0000 (15:08 +0000)]
Add support for syslog logging to Ganeti.Logging

Currently this is initialised to no from Daemon.hs, but will in the
future allow command-line options for controlling it.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agolocking: Notify only once on release
Michael Hanselmann [Wed, 21 Mar 2012 15:21:36 +0000 (16:21 +0100)]
locking: Notify only once on release

Don't notify for every released lock in shared mode. The last one is
enough.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

12 years agolocking: Handle spurious notifications on lock acquire
Michael Hanselmann [Wed, 21 Mar 2012 13:55:22 +0000 (14:55 +0100)]
locking: Handle spurious notifications on lock acquire

This was already a TODO since the implementation of lock priorities in
September 2010. Under certain conditions a waiting acquire can be
notified at a time when it can't actually get the lock. In this case it
would try and fail to acquire the lock and then return to the caller
before the timeout ends.

While this is not bad (nothing breaks), it isn't nice either. A separate
patch will prevent unnecessary notifications when shared locks are
released.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

12 years agolocking: Fix lock deletion with timeout
Michael Hanselmann [Wed, 21 Mar 2012 13:54:39 +0000 (14:54 +0100)]
locking: Fix lock deletion with timeout

While working on another SharedLock fix I realized timeouts on lock
deletion don't work very well if the timeout actually expires. This
patch fixes the issue and adds a new unittest.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

12 years agoMove _TimeoutExpired to utils
Andrea Spadaccini [Wed, 28 Sep 2011 14:56:22 +0000 (15:56 +0100)]
Move _TimeoutExpired to utils

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

(cherry picked from commit f8326fcaac87958241d78526e5868d23d78ac286)

12 years agoRevert "Stop acquiring BGL for LUXI queries"
Michael Hanselmann [Wed, 21 Mar 2012 17:11:48 +0000 (18:11 +0100)]
Revert "Stop acquiring BGL for LUXI queries"

This reverts commit 0fa753bad2cf5a0cf88953347e5da3aebbf21956.

Turns out there are more queries acquiring locks than we'd like. This
patch goes to version 2.6 and a separate patch fixes the immediate
issues in LUClusterVerifyConfig.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

12 years agoLUClusterVerifyConfig: Share BGL, acquire all locks in shared mode
Michael Hanselmann [Wed, 21 Mar 2012 15:59:17 +0000 (16:59 +0100)]
LUClusterVerifyConfig: Share BGL, acquire all locks in shared mode

Instead of acquiring the BGL in exclusive mode (which blocks all other
operations), we acquire all locks for groups, nodes and instances in
shared mode before verifying the configuration.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

12 years agoKVM: don't add -nographic using spice
Guido Trotter [Wed, 21 Mar 2012 14:58:05 +0000 (14:58 +0000)]
KVM: don't add -nographic using spice

This fixes issue 222.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoOnly build hconfd if --enable-confd was passed
Iustin Pop [Wed, 21 Mar 2012 11:45:42 +0000 (11:45 +0000)]
Only build hconfd if --enable-confd was passed

A later, more complete patch, will allow selecting between either the
Python version or the Haskell version. This is just a temporary
solution to help building without all the needed Haskell libraries.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoBuild test helpers that point to hpc-htools
Iustin Pop [Tue, 20 Mar 2012 13:13:11 +0000 (13:13 +0000)]
Build test helpers that point to hpc-htools

Instead of using just shell constructs to run hpc-htools correctly
(i.e. HTOOLS=role htools/hpc-htools …), let's add some shell fragments
that do this for us.

This will ease the running of tests directly.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAllow hail to read data from stdin
Iustin Pop [Tue, 20 Mar 2012 10:48:08 +0000 (11:48 +0100)]
Allow hail to read data from stdin

This patch makes hail treat '-' as denoting stdin, per the usual Unix
convention. This will help with testing.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoUpdate hconfd bind address handling
Iustin Pop [Mon, 19 Mar 2012 17:02:56 +0000 (18:02 +0100)]
Update hconfd bind address handling

Instead of hardcoded IPv4 INADDR_ANY, this patch changes hconfd to use
either the any network for the configured cluster address family
(ipv4/ipv6), or whatever the user passes in via the --bind option.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoAdd the bind-address option
Iustin Pop [Mon, 19 Mar 2012 17:01:52 +0000 (18:01 +0100)]
Add the bind-address option

This implements the same logic as the Python code: if the option is
not used, use the default appropriate for the cluster, otherwise try
to parse and use whatever was passed in.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoAdd two utility functions
Iustin Pop [Tue, 20 Mar 2012 17:57:33 +0000 (17:57 +0000)]
Add two utility functions

These both are work with/on the Result type, so we add them to
BasicTypes. The functions will be used as more generic versions of
some more specialised functions that are right now spread across the
modules.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoAdd skeleton ssconf module
Iustin Pop [Mon, 19 Mar 2012 16:47:45 +0000 (17:47 +0100)]
Add skeleton ssconf module

This currently has only one export function in it, which will be used
for future bind address functionality in daemons.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoStop acquiring BGL for LUXI queries
Michael Hanselmann [Tue, 20 Mar 2012 16:57:12 +0000 (17:57 +0100)]
Stop acquiring BGL for LUXI queries

Short description: This fixes an issue whereby masterd would become
unresponsive on the LUXI socket, leading to client timeouts. While made
worse in 2.5, the underlying issue was already present in 2.4.

Longer description: Until now all LUXI queries would acquire the BGL
(big Ganeti lock) in shared mode. With the exception of OpNodeAdd and
OpNodeRemove, this was also the case for all opcodes before version 2.5.
In 2.5 we split OpClusterVerify into multiple opcodes, one of which
(OpClusterVerifyConfig) now acquires the BGL in exclusive mode. Whether
or not doing so is good is a separate discussion: OpNodeAdd and
OpNodeRemove, as of this writing, still require an exclusive BGL.
OpClusterVerifyConfig is run more often than OpNodeAdd or OpNodeRemove
in normal clusters, which is why we only recognized this issue in 2.5.

What would happen is that once OpClusterVerifyConfig tried to acquire
its exclusive BGL while it was actually held by other opcodes (e.g.
OpInstanceReplaceDisks), the locking code would not grant shared
acquires for the BGL, even when the exclusive acquire is removed from
the queue for a short amount of time after a timeout. This is necessary
to prevent lock starvation.

In this situation further LUXI queries requiring the BGL in shared mode,
e.g. OpClusterQuery, would block and the client eventually time out.
Over time they fill the client request workerpool's queue and at that
point even requests not requiring the BGL stop working. Once the
long-running operation(s) holding the BGL in shared mode finished,
OpClusterVerifyConfig gets it in exclusive mode and everything returns
to normal. LUXI recovers very soon too.

I'd like to thank Bernardo Dal Seno for his contribution to this bugfix.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

12 years agoTypo fix: s/aditional/additional/
Alexander Schreiber [Tue, 20 Mar 2012 11:00:00 +0000 (12:00 +0100)]
Typo fix: s/aditional/additional/

Trivial fix for a typo in message output of LUInstanceSetParams

Signed-off-by: Alexander Schreiber <als@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoFix exported constants
Iustin Pop [Mon, 19 Mar 2012 15:41:22 +0000 (16:41 +0100)]
Fix exported constants

I "forgot" to run the unittests before commit :(

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoExport the AF_INET/AF_INET6 constants
Iustin Pop [Mon, 19 Mar 2012 13:27:08 +0000 (14:27 +0100)]
Export the AF_INET/AF_INET6 constants

These are needed to ensure that htools uses the same numeric values as
Python.

By the way, I'm not sure what's the best option: importing socket into
constants (this patch), or adding custom exports to
autotools/convert-constants.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoRename htools-hpc to hpc-tools to fix laziness
Iustin Pop [Mon, 19 Mar 2012 10:04:56 +0000 (11:04 +0100)]
Rename htools-hpc to hpc-tools to fix laziness

This is a stupid/trivial patch. I didn't realise when adding
htools-hpc that this will "break" tab completion on htools; as in, I
will have to add / manually always when completing files on the
command line.

So to fix my laziness, let's rename htools-hpc to hpc-htools,
eliminating this completion conflict.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoEPO: Pass the no_remember parameter to preserve state
René Nussbaumer [Mon, 19 Mar 2012 07:55:58 +0000 (08:55 +0100)]
EPO: Pass the no_remember parameter to preserve state

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agohtools: fix long version of --port for daemons
Iustin Pop [Mon, 19 Mar 2012 09:55:19 +0000 (10:55 +0100)]
htools: fix long version of --port for daemons

The dashes do not need to be in, if they are then the resulting option
is:

  -p PORT  ----port=PORT     Network port (default: 1814)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAdd htools/rapi test directory to DIRS
Iustin Pop [Mon, 19 Mar 2012 09:45:51 +0000 (10:45 +0100)]
Add htools/rapi test directory to DIRS

Sorry!

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoUpdate gnt-node evacuate man page/help text
Iustin Pop [Mon, 19 Mar 2012 09:17:39 +0000 (10:17 +0100)]
Update gnt-node evacuate man page/help text

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoFix type error in LUInstanceChangeGroup
Iustin Pop [Mon, 19 Mar 2012 09:26:29 +0000 (10:26 +0100)]
Fix type error in LUInstanceChangeGroup

If a specific list of groups has been requested, then the code used
that, without transforming it to a (frozen)set first, which results
in:

 unsupported operand type(s) for &: 'list' and 'frozenset'

Trivial fix is to do that in the 'then' branch.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoFix gnt-group --help display
Iustin Pop [Fri, 16 Mar 2012 10:59:01 +0000 (11:59 +0100)]
Fix gnt-group --help display

Copy-paste mismatch :)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

12 years agohspace: Make use of the spindle_use
René Nussbaumer [Fri, 16 Mar 2012 10:14:48 +0000 (11:14 +0100)]
hspace: Make use of the spindle_use

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agohtools: Fix some compiler warnings
Iustin Pop [Thu, 15 Mar 2012 17:48:47 +0000 (18:48 +0100)]
htools: Fix some compiler warnings

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAdd tests for custom text files
Iustin Pop [Fri, 9 Mar 2012 14:47:04 +0000 (15:47 +0100)]
Add tests for custom text files

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAdd utilisation and instance selection tests
Iustin Pop [Fri, 9 Mar 2012 14:20:39 +0000 (15:20 +0100)]
Add utilisation and instance selection tests

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoEnable pipefail mode for shell tests
Iustin Pop [Fri, 9 Mar 2012 14:03:13 +0000 (15:03 +0100)]
Enable pipefail mode for shell tests

These allow more accurate checks.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAdd RAPI shell-level unittest
Iustin Pop [Fri, 9 Mar 2012 13:09:07 +0000 (15:09 +0200)]
Add RAPI shell-level unittest

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoEnhance the RAPI backend to accept file:// URLs
Iustin Pop [Fri, 9 Mar 2012 11:19:32 +0000 (13:19 +0200)]
Enhance the RAPI backend to accept file:// URLs

This will allow offline testing of this backend (except for the actual
curl part), also in the case where we didn't compile against curl.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoAdd new hail (shell) tests
Iustin Pop [Thu, 8 Mar 2012 21:05:15 +0000 (23:05 +0200)]
Add new hail (shell) tests

Using some hand-crafted files (manually modified from a real cluster
running master branch), we test that hail behaves as we expect:
doesn't load obvious wrong data, can do relocations/allocations, etc.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agohtools: Reflect the rename of spindle_usage to spindle_use
René Nussbaumer [Thu, 15 Mar 2012 13:58:30 +0000 (14:58 +0100)]
htools: Reflect the rename of spindle_usage to spindle_use

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoRename spindle_usage to spindle_use on Ganeti side
René Nussbaumer [Thu, 15 Mar 2012 13:55:55 +0000 (14:55 +0100)]
Rename spindle_usage to spindle_use on Ganeti side

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoAdd a helper function for mirrorType computations
Iustin Pop [Tue, 6 Mar 2012 23:49:52 +0000 (01:49 +0200)]
Add a helper function for mirrorType computations

We most always use `templateMirrorType . diskTemplate`, so let's add a
helper function for this.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoFix TLMigrateInstance use of IAllocator
Iustin Pop [Tue, 6 Mar 2012 23:40:18 +0000 (01:40 +0200)]
Fix TLMigrateInstance use of IAllocator

hail now expects correctly that relocate_from is of equal length with
the number of required nodes (fixme: there's a lot of not well
documented behaviour here… not nice for any other potential
IAllocators). As such, we _need_ to pass just the instance's primary
node.

Additionally, update the iallocator doc to correctly specify what this
list (`relocate_from`) contains.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoEnable all disk templates in unit-tests
Iustin Pop [Tue, 6 Mar 2012 23:29:49 +0000 (01:29 +0200)]
Enable all disk templates in unit-tests

After the many patches implementing the shared storage functionality
in iallocator, balances, etc., and after the patches preparing the
unit-tests to do the right thing for shared storage, we can finally
flip the bits that make instances have "random" disk templates as
opposed to just DRBD. Yes, the unit-tests still pass ☺

We also need to enable all disk templates in the IPolicy (for
allocation/relocation).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>