Statistics
| Branch: | Tag: | Revision:

root / lib @ 6ef37395

# Date Author Comment
6ef37395 12/19/2012 06:54 pm Michael Hanselmann

OpNetworkConnect: Check for network mode

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

0b3f2215 12/19/2012 06:54 pm Michael Hanselmann

Improve descriptions of network query fields

They should be in the same style as other descriptions.

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

b8028dcf 12/19/2012 06:29 pm Michael Hanselmann

Replace frozenset with compat.UniqueFrozenset

This is not a trivial s/frozenset/compat.UniqueFrozenset/, but rather
only replaces “frozenset” where appropriate. Most of the places are
“static” information that doesn't change after the module has been
loaded....

d45a824b 12/19/2012 03:45 pm Iustin Pop

Enable job queries via confd in gnt-node and RAPI

This patch is enabling split queries for jobs for gnt-node and rapi
access (only for job listing, not job waiting).

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

45317e3a 12/19/2012 03:45 pm Iustin Pop

Remove some unused Python code

This patch removes code which is no longer used due to refactoring:

- http.InitSsl, last usage removed in commit 33231500 (“Convert RPC
client to PycURL”)
- rapi.baserlib.MakeParamsDict, last usage remove in commit 4e5a68f8...

0ea11dcb 12/19/2012 03:14 pm Bernardo Dal Seno

Add exclusive_storage node parameter

Unit tests updated and expanded with an inheritance check.

The flag has no effect yet.

Signed-off-by: Bernardo Dal Seno <>
Reviewed-by: Iustin Pop <>

0d57ce24 12/19/2012 01:02 pm Guido Trotter

Allow shutting down offline instance

If an instance is offline we definitely shouldn't start it up.
But shutting it down, should it be up by mistake is not "that" bad.
Still, we only allow it with --force, as it still performs an action on
an instance we shouldn't touch. This should make everybody happy....

eec7840a 12/19/2012 01:01 pm Guido Trotter

Allow running instances to be put online

If an instance is running (eg. ERROR_up) and at the same time offline,
there's no way to either shut it down or reonline it. This allows
onlining it. Offlining is still disabled for running instances.

Signed-off-by: Guido Trotter <>...

05325a35 12/18/2012 04:09 pm Bernardo Dal Seno

Fixes and improvements to comments

Some fixes, added more information in a few points, removed a stale (5+
year old) TODO comment.

Signed-off-by: Bernardo Dal Seno <>
Reviewed-by: Guido Trotter <>

daa49d6f 12/18/2012 03:06 pm Michael Hanselmann

Fix error during cluster initialization due to hv_kvm

Commit 141d148 was a bit too enthusiastic. The three parameters added to
the list of parameters to be checked default to a value not evaluating
to false, leading to a failure on cluster initialization....

114e8500 12/18/2012 02:07 pm Dimitris Aragiorgis

Make LUNetworkAdd pass _VerifyLocks()

LEVEL_NODE_ALLOC should be aquired too if LEVEL_NODE is ALL_SET.

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

141d1489 12/17/2012 06:24 pm Michael Hanselmann

Add test for SPICE parameter list, add missing ones

“_SPICE_ADDITIONAL_PARAMS” is supposed to be the full list of
SPICE-related KVM hypervisor parameters with the exception of
“HV_KVM_SPICE_BIND”. The new test checks if all parameters starting with
“HV_KVM_SPICE_*” are included. Three previously missing parameters are...

07788a0b 12/17/2012 06:24 pm Michael Hanselmann

hv_kvm: List of SPICE parameters should be module-global

This list is static at runtime and doesn't need to be recreated every
time.

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

af797be5 12/17/2012 06:16 pm Michael Hanselmann

_DeclareLocksForMigration: Fix non-DRBD locking issue

When non-DRBD disks are used for an instance,
“lu.needed_locks[locking.LEVEL_NODE]” is set to “locking.ALL_SET” (which
is None). The assertion will then fail as None evaluates to False.

Reported by Constantinos Venetsanopoulos....

d4e4b2fd 12/17/2012 05:44 pm Michael Hanselmann

LUOobCommand: Always declare NAL in shared mode

Doing so avoids triggering an assertion in mcpu which cross-checks the
node lock and node allocation lock acquisition mode.

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

1d645825 12/17/2012 01:38 pm Iustin Pop

Fix two logging messages in TLReplaceDisks

Commit f0f8d060 (“Show old primary/secondary node on disk
replacement”) added two wrong uses of feedback_fn, which results in
log entries such like these:

"log": [
[
7, [1351258326, 466214], "message", "Replacing disk(s) 0 for instance 'instance1.example.com'"...
8bc17ebb 12/17/2012 01:29 pm Iustin Pop

Add optional formatting for OP_DSC_FIELD

For some opcodes, the output is not "stable", and depends on the exact
input values; this makes it harder to check consistency against
Haskell code.

To compensate for this, we add a way to override the formatting of the...

5448799c 12/14/2012 04:55 pm Iustin Pop

Fix an small but quite nasty typo

Introduced in commit d4752785.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

57fb6fcb 12/14/2012 04:28 pm Guido Trotter

Very very very basic openvswitch support

This is a "better than nothing" support, just for kvm and just joining
the machine to the opevswitch bridge with the right command.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>...

e21c2eec 12/13/2012 07:16 pm Constantinos Venetsanopoulos

Pass check_ip and not hostname.ip to _ComputeNics

This should be done because in the case of --no-name-check there
is no 'hostname.ip' attribute, causing an execution error.
'check_ip' is always set (in CheckArguments) even if --no-name-check
is passed in the command line....

ec5af888 12/13/2012 01:29 pm Michael Hanselmann

Read watcher pause using RPC, not directly

The master daemon should not directly read files written by the node
daemon. This patch adds a new RPC to read the watcher pause file and
changes the master code to use it.

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

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....