Statistics
| Branch: | Tag: | Revision:

root / lib @ 7c4bd156

# Date Author Comment
7c4bd156 12/13/2012 01:29 pm Michael Hanselmann

Set watcher pause on all nodes

Instead of just setting the watcher pause file, which isn't replicated,
RPC is used to set it on all nodes (where possible). This means that
after an outage of the master node and a following master-failover, the
watcher will still be paused....

99e222b1 12/13/2012 01:29 pm Michael Hanselmann

Add RPC for setting watcher pause

The watcher pause file should be set/unset on all nodes at once, not
only the master node. For that a new RPC is needed.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

383477e9 12/13/2012 01:27 pm Michael Hanselmann

jqueue: Improve inotify error reporting

This addresses issue 218. When the number of inotify watches is
exhausted, for example by being set too low from the beginning or by
other programs, waiting for a job to change would just report a lost job
(e.g. “Error checking job status: Job with id 7817 lost”)....

e37f47d3 12/13/2012 01:27 pm Michael Hanselmann

Improve test for tools.ensure_dirs

- Add more checks, some of them are deliberately redundant
- Descriptive error messages
- Add comment describing order to “tools.ensure_dirs”
- Avoid copying a list in an assertion in “tools.ensure_dirs”

Signed-off-by: Michael Hanselmann <>...

23f1bf29 12/12/2012 03:25 pm Michael Hanselmann

uidpool: Remove roman number support

Doing so simplifies to code a bit and never had a practical use.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

3e3ddbf0 12/12/2012 03:18 pm Constantinos Venetsanopoulos

Remove checks wrt IDISK_PARAMS from OpCode level

Change the "--disks" option validation, to just check the format
of the dict and do not check whether the keys are included in the
IDISK_PARAMS constant at OpCode level. This allows the passing of
arbitrary parameters at the CLI, which will then be logically...

61e062dd 12/12/2012 02:08 pm Michele Tartara

Move the path of the DRBD status file to the Constants file

It will be needed by the DRBD data collector, that will be added shortly.

Signed-off-by: Michele Tartara <>
Reviewed-by: Iustin Pop <>

9eac61f8 12/11/2012 04:53 pm Michael Hanselmann

Fix ordering of entries in tools.ensure_dirs

Commit ebd437a added two new entries to tools.ensure_dirs, but did so in
the wrong order. Patch forthcoming to improve the unittest's error
message.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

ebd437a4 12/11/2012 04:31 pm Michael Hanselmann

Set owner on watcher pause and queue drain files

If the files were created by a user different, e.g. due to a switch from
running masterd as root to running it as a dedicated user, they couldn't
be modified/removed anymore.

Signed-off-by: Michael Hanselmann <>...

af8f2fbf 12/11/2012 04:31 pm Michael Hanselmann

lib/tools/ensure_dirs.py: Code formatting

Wrap lines in a consistent manner (uid/gid on the second line) if
wrapping is necessary at all. “git diff --color-words” shows no
difference at all as only whitespace changed.

Signed-off-by: Michael Hanselmann <>...

be6c403e 12/11/2012 03:37 pm Michael Hanselmann

Replicate queue drain flag across all master candidates

Until now, the flag was unset on a master failover unless the
“$localstatedir/lib/ganeti/queue/drain” file existed.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

4a3dd52d 12/11/2012 01:01 pm Michael Hanselmann

Add utility function to create frozenset with unique values

When used instead of a plain call to “frozenset”, this would have
avoided the issue fixed in commit e2dd6ec. The new function is located
in the “compat” module as it will be used at module load time in most...

af54b7d7 12/11/2012 01:01 pm Michael Hanselmann

constants: Remove duplicate DRBD barrier option

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

e2dd6ece 12/10/2012 06:03 pm Michael Hanselmann

Change value for ECODE_TEMP_NORES

Unfortunately there was a bug in commit 518a45e whereby ECODE_TEMP_NORES
had the same value as ECODE_NORES, leading to failures in a Haskell
test. Of course this would also have affected other users of the constant.

Signed-off-by: Michael Hanselmann <>...

78fcfd43 12/10/2012 04:47 pm Michael Hanselmann

masterd: Remove duplicate code

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

7fb5ac7c 12/10/2012 04:23 pm Michael Hanselmann

Improve error message for when adding inotify watcher fails

Explicitely mention the fs.inotify.max_user_watches sysctl value.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

518a45e5 12/07/2012 02:47 pm Michael Hanselmann

Add error code for temporary lack of resources

When an instance creation uses opportunistic locks, the iallocator might
not be able to find an allocation solution if not enough node locks (or
a suboptimal subset thereof) were acquired. As per the design document...

bc826292 12/07/2012 02:47 pm Michael Hanselmann

Export error codes from RAPI client module

Until now the error codes were not available from the RAPI client
module. A newly added unit test ensures all error codes are contained in
“ECODE_ALL”, as well as ensuring consistency between the RAPI client and...

78bfb560 12/07/2012 02:45 pm Michael Hanselmann

cmdlib: Use locked nodes as node whitelist

Also actually start using opportunistic locks (if requested).

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

1f1188c3 12/07/2012 02:36 pm Michael Hanselmann

cmdlib: Opportunistic locking on instance creation

Adds a new parameter to “OpInstanceCreate” and “OpInstanceMultiAlloc” to
use opportunistic locks.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

b3c728dc 12/07/2012 02:36 pm Michael Hanselmann

cmdlib: Node whitelist support for allocation request

Forward the node whitelist to the iallocator plugin.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

e9a81214 12/07/2012 02:35 pm Michael Hanselmann

mcpu: Verify node allocation lock mode

Add verification code to mcpu to check an LU's locks. Two whitelists are
provided to exclude LUs from the two tests.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>

ba6eda59 12/07/2012 02:35 pm Michael Hanselmann

_ExportQuery: Use node allocation lock

Block instance allocations when all node locks will be acquired.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

38446261 12/07/2012 02:35 pm Michael Hanselmann

LUBackupExport: Use node allocation lock

Block instance allocations when all node locks will be acquired.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

dc7d923e 12/07/2012 02:35 pm Michael Hanselmann

LUBackupRemove: Use node allocation lock

Block instance allocations when all node locks will be acquired.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

5df1c9aa 12/07/2012 02:32 pm Michael Hanselmann

LUInstanceMultiAlloc: Use node allocation lock

Avoid conflicts between instance allocations.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

32bea623 12/07/2012 02:32 pm Michael Hanselmann

LUInstanceRecreateDisks: Use node allocation lock

Block instance allocations when all node locks will be acquired.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

48126102 12/07/2012 02:32 pm Michael Hanselmann

LUNodeSetParams: Use node allocation lock

Block instance allocations when all node locks will be acquired.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

7254c0a9 12/07/2012 02:32 pm Michael Hanselmann

LUNodeQueryvols: Use node allocation lock

Block instance allocations when all node locks will be acquired.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

cfae7671 12/07/2012 02:32 pm Michael Hanselmann

LUOobCommand: Use node allocation lock

If no node names are given, all node locks are acquired.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

d5fe5fa9 12/06/2012 05:07 pm Michael Hanselmann

Add tool to clean up node

Sometimes a node is not removed properly from a cluster (especially
during development). This new tool stops all daemons and removes (after
making copies) the most critical files.

Signed-off-by: Michael Hanselmann <>...

69e5fefc 12/06/2012 04:07 pm Michael Hanselmann

Add tool to configure node daemon

The design for this is in “doc/design-node-add.rst”. The tool receives a
JSON data structure on stdin and configures the node's daemon after
verifying the received values.

Signed-off-by: Michael Hanselmann <>...

7b8ba235 12/06/2012 04:07 pm Michael Hanselmann

Switch from scp/ssh to node daemon setup utility

This patch does away with many calls to scp and by means of using
“tools/node-daemon-setup”, verifies most of the values before writing
them to files.

Signed-off-by: Michael Hanselmann <>...

f22433c0 12/06/2012 01:37 pm Dimitris Aragiorgis

Locking related fixes for networks

Use GetNetwork() only when having already aquired the lock,
i.e. in CheckPrereq().

In LUNetworkConnect/Disconnect do not include Network info in Hooks
environment, so that network locking can be avoided if conflicts
are not checked....

3c631ea2 12/05/2012 05:35 pm Michael Hanselmann

jqueue: Don't modify input opcode when changing priority

Commit 4679547 implemented the ability to change job's priority after it
was submitted. The code contained a bug whereby it would modify the
input data for an opcode, something the job queue shouldn't do (logical...

ca519248 12/05/2012 05:04 pm Dimitris Aragiorgis

Use new util function for mac_prefix validation

Use new NormalizeAndValidateThreeOctetMacPrefix() util function in
LUNetworkAdd/LUNetworkSetParams to validate network's MAC prefix.
Additionally, move the check in CheckArguments() in the case of
LUNetworkAdd....

26e88cde 12/05/2012 01:00 pm Michael Hanselmann

LUClusterRedistConf: Use node allocation lock

All node locks are acquired.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

9cbfc69a 12/05/2012 01:00 pm Michael Hanselmann

LUClusterRepairDiskSizes: Use node allocation lock

This opcode acquires all node resource locks, which conflicts with
instance allocations.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

51305499 12/05/2012 01:00 pm Michael Hanselmann

LUGroupVerifyDisks: Use node allocation lock

See comment in code.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

9fa08c84 12/05/2012 01:00 pm Michael Hanselmann

LUClusterVerifyGroup: Use node allocation lock

See comment in code.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

ec272bab 12/05/2012 01:00 pm Michael Hanselmann

LUInstanceReplaceDisks: Acquire node allocation lock

If the lock was acquired in the first place (only when an iallocator is
used), it is released as soon as possible.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

de5967da 12/05/2012 12:46 pm Michael Hanselmann

LUInstanceChangeGroup: Acquire node allocation lock

Changing instances' groups shouldn't conflict with instance allocations.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

a0150c51 12/05/2012 12:44 pm Michael Hanselmann

Acquire node allocation lock during node query

If locking is used (usually by ganeti-watcher), node allocations must be
temporarily blocked.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

fb60bc6a 12/04/2012 07:54 pm Michael Hanselmann

iallocator: Add node whitelist

In the future instance creations might have a lock on all nodes as was
the case until the implementation of opportunistic locking. Nodes for
which the lock is not held will be shown to the iallocator plugin as if
they were marked offline....

d5b031dc 12/04/2012 07:32 pm Michael Hanselmann

Allow ignoring successful commands in "gnt-cluster command"

In some cases it is useful to ignore the output of and avoid mentioning
successful commands. One would be when looking for a certain string in
a file:

$ gnt-cluster command egrep -q '^testing$' /etc/......
402ff455 12/04/2012 05:24 pm Michael Hanselmann

errors: Show error descriptions in API documentation

Comments with a colon after the hash sign (“#:”) show up in the
epydoc output.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

ef66500f 12/04/2012 04:26 pm Michael Hanselmann

Fix locking mistake introduced in commit 5cc1f88

The node resource locks were not set correctly on instance import.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

dd076c21 12/04/2012 01:44 pm Iustin Pop

Add safety check on job dependency/TIsLength

If TIsLength is applied to a non-container item, it will fail (type
error) due to invalid application of len(). Since this can happen on
user-supplied data, we add an explicit TList/TTuple check (the TTuple
test is a new one)....

dbd1264a 12/04/2012 12:57 pm Michael Hanselmann

LUClusterSetParams: Use node allocation lock

All resources are acquired and opportunistic instance creations would
fail. Also add a TODO.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

5cc1f887 12/04/2012 12:56 pm Michael Hanselmann

LUInstanceCreate: Acquire node allocation lock

Opportunistic locks are not yet used. This patch changes
LUInstanceCreate to acquire the node allocation lock to avoid conflicts
with other opcodes acquiring many node locks.

Signed-off-by: Michael Hanselmann <>...

2cb3181a 12/04/2012 12:56 pm Michael Hanselmann

Acquire node allocation lock for failover/migration

See code for an explanatory comment. The lock is released as soon as
possible.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

1dacbb06 12/04/2012 12:47 pm Dimitris Aragiorgis

Use GetMultiInstanceInfo in LUNetwork* opcodes

LUNetworkConnect/Disconnect looks up a nodegroup's instances for
conflicting IPs. To do so, use GetNodeGroupInstances() and
GetMulitInstanceInfo().

Additionally, check if the correct locks were acquired.

Signed-off-by: Dimitris Aragiorgis <>...

d242923c 12/04/2012 11:22 am Michael Hanselmann

utils.text: Function to verify MAC address prefix

The network management code needs to verify a MAC address prefix.
Instead of (ab)using NormalizeAndValidateMac, clean code should be used.
Unit tests for NormalizeAndValidateMac are updated and new ones for...

0602cef3 12/03/2012 04:33 pm Michael Hanselmann

Factorize code for checking node daemon certificate

This code is going to be used by a new utility for setting up the node
daemon. Unit tests are updated/added.

Additionally, the certificate and key stored in “server.pem” are
verified, too.

Signed-off-by: Michael Hanselmann <>...

686d24f0 12/03/2012 03:56 pm Michael Hanselmann

Support opportunistic locks in mcpu/LUs

Similar to “share_locks”, a new dictionary containing booleans for each
locking level is added to “cmdlib.LogicalUnit”. Logical units wanting to
make use of opportunistic locks will be able to configure this
dictionary accordingly....

07db7ed2 12/03/2012 03:56 pm Michael Hanselmann

Add opportunistic locking to GanetiLockManager

Just forwarding the parameter, nothing more.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

a95c53ea 12/03/2012 03:56 pm Michael Hanselmann

locking: Implement opportunistic locking in LockSet

This patch adds a new parameter to “LockSet.acquire” named
“opportunistic”. When enabled the lockset will try to acquire as many
locks as possible, but it won't wait for them (with the exception of the
lockset-internal lock in case the whole set is acquired). This is...

9b4329e9 12/03/2012 03:04 pm Michael Hanselmann

Add ssconf function to read all files

Configuring a node daemon on a newly added node will need all ssconf
values.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

e1874aa7 12/03/2012 03:04 pm Michael Hanselmann

bootstrap.RunNodeSetupCmd: Add IPv6 support

Commit 224ff0f modified the node SSH setup to use the system's SSH
client. Before that Paramiko was used. It's not entirely clear whehter
the latter ever supported IPv6 properly, but with this patch
“bootstrap.RunNodeSetupCmd” is changed to use it if configured. The code...

a698cdbb 12/03/2012 03:04 pm Michael Hanselmann

Factorize running node setup command

Part of the code used for running “prepare-node-join” can be re-used for
running a tool to configure the node daemon.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

cc7f5bfc 12/03/2012 03:03 pm Michael Hanselmann

ssconf: Add dry-run support for writing files

A new utility for configuring the node daemon will support a dry-run
mode. This patch adds the necessary functionality to
“ssconf.SimpleStore” and provides comprehensive tests for
“SimpleStore.WriteFiles”. To enable the latter, a testing-only parameter...

29a32ce5 12/03/2012 03:03 pm Michael Hanselmann

ssconf: Add function to verify keys

The new utility for configuring the node daemon will have to check
whether it received valid ssconf names.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

00457f03 12/03/2012 01:21 pm Dimitris Aragiorgis

LUNetworkAdd: Log warning when needed

In case conflicts are checked, log warnings if nodes' IPs cannot
be reserved.

Signed-off-by: Dimitris Aragiorgis <>
Signed-off-by: Michael Hanselmann <>
Reviewed-by: Michael Hanselmann <>

efb8848f 12/03/2012 01:17 pm Dimitris Aragiorgis

Use constants.IP4_VERSION in LUNetworkAdd

Signed-off-by: Dimitris Aragiorgis <>
Reviewed-by: Michael Hanselmann <>

213076fe 12/03/2012 01:04 pm Dimitris Aragiorgis

Fix locking in networks

Ensure that locks are held only if needed.

Add conflicts_check in OpNetworkAdd. This is needed if we want to
check whether nodes/master IPs are included in network.

Depending on conflicts_check value, we have to hold node/instance locks...

55b7e783 11/30/2012 03:54 pm Iustin Pop

Rename OpTestAllocator.allocator to iallocator

This makes the OpCode more consistent with the other opcodes. The
downside is incompatibility when upgrading from 2.6, but since this is
a test opcode it shouldn't be problematic.

Signed-off-by: Iustin Pop <>...

89514061 11/30/2012 03:54 pm Iustin Pop

Add a helper for the "iallocator" opcode field

This field is used with just changed description in about 10 opcodes,
so unifying it makes things simpler for future potential changes to
the field type.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

398e9066 11/30/2012 03:54 pm Iustin Pop

Add Group, OS and Backup opcodes

This also corrects a docstring in OpBackupExport on the Python side.

Signed-off-by: Iustin Pop <>
Reviewed-by: Helga Velroyen <>

4c405df7 11/30/2012 03:54 pm Iustin Pop

Fix empty list as default value in OpInstanceMultiAlloc

Commit 12e62af5 (“Adding the new opcode for multi-allocation”)
introduced a "bad" default value; while porting this to Haskell, I
realised this is wrong.

Signed-off-by: Iustin Pop <>...

86b9a385 11/30/2012 11:44 am Michael Hanselmann

Fix breakage introduced in commit a8b3b09

The order of the calls to “ctx.use_privatekey” and “ctx.use_certificate”
was wrong, leading to an exception being thrown.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

a8b3b09d 11/30/2012 10:51 am Michael Hanselmann

Factorize SSL context setup for certificate check

This code will also be used by the node daemon setup utility.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

e055a2ab 11/30/2012 10:14 am Dimitris Aragiorgis

Introduce ht.TMaybeValueNone and ht.TValueNone

TValueNone checks if a value is "none" and TMaybeValueNone is a wrapper
of TOr(TValueNone, x). This is used by OpNetworkSetParam in order to
reset a network value (e.g. mac_prefix, gateway, etc.)

Signed-off-by: Dimitris Aragiorgis <>...

5dff65da 11/30/2012 07:10 am Michael Hanselmann

opcodes: Replace manual loop with map

Also remove a superfluous empty line in test file.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

16091a6e 11/29/2012 01:33 pm Michael Hanselmann

Fix type descriptions in RAPI documentation

This patch adds descriptors to the “_CheckCIDR*” functions in opcodes
and improves the descriptions generated by “ht.TInstanceOf”, thereby
indirectly fixing bad type descriptions in the RAPI documentation.

Before this patch:...

853c570b 11/29/2012 01:26 pm Helga Velroyen

Fixing crash when removing disks

This bug was introduced by my commit "Check ispecs against ipolicy on
instance modify", because I did not filter for the 'add' action. Thus it
would try to read the size parameter also when removing disks.

Signed-off-by: Helga Velroyen <>...

48aaca91 11/29/2012 12:46 pm Michael Hanselmann

locking: Change locking order, move NAL after instances

Some opcodes, for example LUInstanceFailover and LUInstanceMigrate,
can't know whether they need to acquire all nodes until they have a lock
on the instance. In turn they would have to acquire the node allocation...

c9f79949 11/29/2012 10:01 am Michael Hanselmann

Add constant for node certificate mode

A new utility for configuring the node daemon will have to write the
node certificate as well. To not split information about the certificate
file even more, the constant is added to “pathutils”.

Signed-off-by: Michael Hanselmann <>...

dffa96d6 11/28/2012 01:48 pm Michael Hanselmann

Move cluster verification out of prepare-node-join

A new tool for configuring the node daemon will also have to verify the
cluster name, so it's better to have this function in a central place.
In the process of moving it to ssconf it is also changed to use...

911dfc49 11/28/2012 01:48 pm Michael Hanselmann

ssconf: Verify file size when reading, add some tests

Until now ssconf would limit the amount read from files to 128 KiB and
silently ignored files larger than that. With this patch a check is
added by using fstat(2) on the file descriptor while it's being read....

965a542a 11/28/2012 10:30 am Michael Hanselmann

Fix pylint error introduced in commit 9675661

Missing spaces around operator.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Michele Tartara <>

fb486969 11/28/2012 09:45 am Michael Hanselmann

ssconf: Move class-level constants to module

There is no good reason why these two constants should be inside the
class. This patch moves them to the module so they can be used without
“self”.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

f35111c0 11/28/2012 09:45 am Michael Hanselmann

Remove ssconf.SimpleConfigReader

Commit b0dcdc1 removed the last user of this class.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

c5ac51bb 11/28/2012 09:45 am Michael Hanselmann

ssconf: Small error message fixes

- Include filename in error message
- s/ip/IP/
- Stop using superfluous variable

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

83a14695 11/27/2012 07:57 pm Helga Velroyen

Fix network query for extra stats fields

Extend _GetNetworkStatsField() to accept 4 arguments.
This fixes Issue 323.

Signed-off-by: Dimitris Aragiorgis <>
Reviewed-by: Helga Velroyen <>

9675661c 11/27/2012 03:03 pm Dimitris Aragiorgis

Export UUID and serial no in network queries

Add uuid and serial_no to _NETWORK_SIMPLE_FIELDS in order to export
them in network queries. Modify gnt-network to list them too.

Signed-off-by: Dimitris Aragiorgis <>
Reviewed-by: Michael Hanselmann <>

1ea0e8a8 11/27/2012 02:12 pm Michael Hanselmann

ssconf: Remove unused regular expression

RE_VALID_SSCONF_NAME is not used anywhere.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Michele Tartara <>

0ee383bf 11/27/2012 01:27 pm Michael Hanselmann

Fix build after commit 9b7e05a

Commit 9b7e05a didn't quite work as expected: glm.is_owned expects a
locking level, not a lock name.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

5d630c22 11/27/2012 12:54 pm Michael Hanselmann

Factorize code to load and verify JSON

A new tool to configure the node daemon will also have to load and
verify JSON data.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

796b5152 11/27/2012 12:54 pm Michael Hanselmann

Factorize logging setup in tools

Most tools had their own “SetupLogging” function, but they were all
essentially the same. This patch adds a generic version to “utils.log”
and provides unit tests.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

81cfd8e5 11/27/2012 11:44 am Michael Hanselmann

LUNodeQueryStorage: Use node allocation lock

Block instance allocations when all node locks will be acquired.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Michele Tartara <>

e58009da 11/27/2012 10:26 am Michael Hanselmann

cmdlib: Don't pass processor to _ComputeNics

The execution context ID can be passed right away.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

9b7e05a6 11/27/2012 10:26 am Michael Hanselmann

cmdlib.LUInstanceRename: Another assertion for BGL

Check whether the BGL is actually held instead of just testing
“REQ_BGL”.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

4a4c0092 11/27/2012 10:26 am Michael Hanselmann

cmdlib: Stop using proc.Log*

The Log* functions are re-exported through the LU. Inline use of string
formatting (“%”) was converted to additional arguments to Log* (unlike
“feedback_fn”, these functions support it). Some punctuation has been
removed from messages, as well as some small re-wordings....

b1ad19c5 11/27/2012 10:22 am Michael Hanselmann

cmdlib: Use CommaJoin where appropriate

Don't use inline versions of CommaJoin.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

21faa3ad 11/27/2012 10:14 am Michael Hanselmann

LUNetwork*: Build dictionaries right away

… instead of constructing an object, only to fill it separately.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Michele Tartara <>

8c811986 11/26/2012 01:26 pm Michael Hanselmann

locking: Method to check if LockSet is fully acquired

A new method is added to check whether the LockSet-internal lock is
held. This is the case after LockSet.acquire was called with
locking.ALL_SET.

Unit tests are updated, including one where the list of names must be...

46cde471 11/26/2012 12:00 pm Michael Hanselmann

mcpu: Start locking at correct level

Commit 8716b1d added a new lock level, LEVEL_NODE_ALLOC. It is ahead of
LEVEL_INSTANCE. The latter was hardcoded in mcpu to be locked right
after the BGL, effectively ignoring LEVEL_NODE_ALLOC.

Signed-off-by: Michael Hanselmann <>...

8716b1db 11/23/2012 06:19 pm Michael Hanselmann

Add new lock level for node allocations

The new lock is similar to the BGL in the sense that it has its own
level and there is only one. It is called “node allocation lock”.
Logical units will use it to synchronize with instance creations, which
in turn will start using opportunistic locks on nodes....

e1494c96 11/23/2012 04:24 pm Iustin Pop

Fix network opcode parameters

Commit 32e3d8b1 (“opcodes: Network parameter improvements and fixes”)
changed a few parameters in the network add, connect and set params
opcodes, but some of the changes are buggy. The patch changed the type
to TMaybe(), whereas the default should have been changed from None to...

fd9f58fd 11/23/2012 04:24 pm Iustin Pop

Introduce a TMaybe combinator

We have many cases in the code where we write TOr(TNone, a), so let's
introduce a combinator that simplifies this case.

Beside replacing the above with TMaybe(a), I did a few other parameter
fixes:

- noop change TOr(TNone, TDict) to TMaybeDict...