Statistics
| Branch: | Tag: | Revision:

root / lib / cmdlib.py @ 595149d5

History | View | Annotate | Download (600.3 kB)

# Date Author Comment
1cce2c47 01/30/2013 07:26 pm Helga Velroyen

If _UnlockedLookupNetwork() fails raise error

Make _UnlockedLookupNetwork() raise OpPrereqError (instead of returning
None) in case it does not find the requested network. Remove useless and
duplicate code such as:

if net_uuid is None:
raise...

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

6bb939a2 01/30/2013 07:26 pm Helga Velroyen

Force conflicts check in LUNetworkDisconnect

Until now if one disconnects a network with --no-conflicts-check
and then remove it, there is a possibility to leave instances with NICs
referencing non-existing networks. This causes network queries,
instance removal and modification to fail....

8bb2df7d 01/23/2013 06:34 pm Bernardo Dal Seno

_VerifyErrors()._Error() and _ErrorIf() are now consistent

_Error() didn't contain the logic for demoting errors to warnings and for
marking an operation as failed. Now _ErrorIf() is just a minimal wrapper
for _Error().

Unit tests included.

Signed-off-by: Bernardo Dal Seno <>...

525f0f98 01/18/2013 05:12 pm Christos Stavrakakis

Fix type of 'node_whitelist' request parameter

If opportunistic_locking is used, then 'node_whitelist' parameter passed
to the allocator is set to the LU's owned node locks. However, LU owned_locks
has type of 'set' while IReqInstanceAlloc expects type of...

d38bef8e 01/18/2013 12:13 pm Constantinos Venetsanopoulos

Run pre-migrate hooks on primary node too

Signed-off-by: Constantinos Venetsanopoulos <>
Reviewed-by: Guido Trotter <>

e32e1fb9 01/16/2013 07:09 pm Bernardo Dal Seno

Verify that templates are compatible with exclusive storage

cluster-verify reports instances with disk templates not compatible with
exclusive storage but that are running on nodes with the exclusive storage
flag set.

Signed-off-by: Bernardo Dal Seno <>...

525939d9 01/16/2013 07:09 pm Bernardo Dal Seno

cluster-verify checks uniformity of PV sizes

When exclusive_storage is set, cluster-verify complains if the size of PVs
is not uniform across a node group.

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

58bc6241 01/16/2013 07:09 pm Bernardo Dal Seno

add-node checks PVs

add-node now performs a few checks on LVM before adding a node to the
cluster.

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

39eb39dc 01/16/2013 07:09 pm Bernardo Dal Seno

Moved checks within LUClusterVerifyGroup

Almost all instance-specific checks have been moved from the Exec method to
the _VerifyInstance method. This cleans up Exec, which was becoming too big
even for pylint…

Signed-off-by: Bernardo Dal Seno <>...

d5a690cb 01/16/2013 07:09 pm Bernardo Dal Seno

cluster-verify checks that PVs are not shared

When exclusive_storage is set, cluster-verify complains if PVs are shared
among unrelated LVs.

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

22d9752a 01/16/2013 07:09 pm Bernardo Dal Seno

cluster-verify checks uniformity of exclusive_storage flag

The value of the flag should be the same for nodes within the same group.

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

60a7335b 01/11/2013 06:16 pm Dimitris Aragiorgis

Add locking to _NetworkQuery

Make use of _GetNames() to get the final network UUIDs.
Get networks info after having aquired the locks. Refactor
the code to use new local variables:

- "network_uuids" returned from _GetNames()
- "all_networks" that are the latest network info...
8d459129 01/07/2013 07:00 pm Michael Hanselmann

Add "use_locking" parameter to network query opcode

This was extracted from a patch by Dimitris Aragiorgis with the subject
“Add locking to _NetworkQuery”. The rest of the patch did no longer
apply and will require more work.

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

8775e62a 12/27/2012 03:33 pm Iustin Pop

Fix LUInstanceRecreateDisks with iallocator

Recent iallocator changes (commit fb60bc6a, “iallocator: Add node
whitelist”) broke the parameter validation for LUInstanceRecreateDisks
(the other LUs were manually fixed already):

$ gnt-instance recreate-disks -I hail --dry-run instance3...
b954f097 12/22/2012 11:47 am Constantinos Venetsanopoulos

Add the gnt-storage client

Add a new client called 'gnt-storage'.
The client interacts with the ExtStorage interface, similarly to
the way gnt-os interacts with the OS interface.

For now, only two commands are supported: 'info' and 'diagnose'.

'diagnose' calculates the node status of each provider on each node,...

108c0a3e 12/21/2012 10:26 pm Iustin Pop

Merge branch 'devel-2.6'

  • devel-2.6:
    Final update of NEWS file for 2.6.2 and version bump
    Fix job completion with big job queues
    confd: reduce noise during normal config reload
    Change hbal handling of !auto_balance instances
    Small corrections in man pages...
478a3308 12/21/2012 08:42 pm Iustin Pop

Merge branch 'stable-2.6' into devel-2.6

No conflicts, really trivial.

  • stable-2.6:
    Final update of NEWS file for 2.6.2 and version bump
    Fix job completion with big job queues
    confd: reduce noise during normal config reload
    Change hbal handling of !auto_balance instances...
6ebfef42 12/21/2012 07:06 pm Bernardo Dal Seno

LUs raise an error if they cannot handle exclusive_storage

This happens when the exclusive_storage flag is set, and the requested
operation is incompatible with the flag or not yet supported.

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

2a196443 12/21/2012 07:06 pm Bernardo Dal Seno

Refactor checks for a new template in LUInstanceSetParams

All the checks have been moved to a private method, so as to make
CheckPrereq() smaller and more readable (pylint was complaining about it).

Signed-off-by: Bernardo Dal Seno <>...

319322a7 12/21/2012 06:45 pm Bernardo Dal Seno

Call node_info RPCs with the exclusive_storage flag

The flag is read from the configuration and passed to the RPC.

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

1a3c5d4e 12/21/2012 06:45 pm Bernardo Dal Seno

Add exclusive_storage parameter to node_info RPC

The flag is passed to the low-level functions that need it, but it's not
yet used. Also, RPCs get just a default value for now.

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

5e2e45b7 12/21/2012 04:06 pm Michael Hanselmann

Improve assertion message in LUClusterVerifyGroup

In issue 240 this assertion fails. While reproducing was not possible
with the master branch, having a more verbose message can't hurt.

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

d4724b14 12/21/2012 01:40 pm Bernardo Dal Seno

Call blockdev_create RPCs with the exclusive_storage flag

The flag is read from the configuration and passed to the RPC.

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

ee1478e5 12/21/2012 01:40 pm Bernardo Dal Seno

Add exclusive_storage parameter to blockdev_create RPC

The flag is passed to the low-level functions that need it, but it's not
yet used.

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

59726e15 12/21/2012 01:40 pm Bernardo Dal Seno

Added class to contain information about a PV

This makes the code more readable and easier to upgrade.
bdev.LogicalVolume.GetPVInfo and the code that depends on it have been
refactored to use the new class.

utils.CheckVolumeGroupSize() has been moved to lib/utils/lvm.py, where more...

f2212a5d 12/21/2012 11:29 am Michael Hanselmann

Improve network query algorithm

Similar to commit 572a277. Directly iterate over “self.wanted” instead
of iterating through all networks and checking if they're wanted.

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

070b780d 12/21/2012 11:29 am Michael Hanselmann

Change network error text

This error is thrown if a network name already exists, not if the
network itself (e.g. “1.2.3.0/24”) is defined.

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

503574ec 12/21/2012 11:27 am Michael Hanselmann

Format network field "group_list" in client

The field is now a list of tuples containing the group name, mode and
link.

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

aa6c1bb1 12/20/2012 05:06 pm Constantinos Venetsanopoulos

Adjust LUInstanceSetParams wrt the `ext' template

Initial support for the `ext' template in gnt-instance modify.
Take care of all needed checks in CheckArguments and CheckPrereqs
wrt ExtStorage Providers and ext-params.

ExtStorage disk addition and specification of arbitrary ext-params...

938adc87 12/20/2012 05:06 pm Constantinos Venetsanopoulos

Multiple ExtStorage Providers and ext-params

Add support for passing parameters to the ext template (ext-params).
Take advantage of disk-params, that don't seem to make much sense in
this template (ExtStorage Providers are not predefined and we don't
know their needs) and use them to pass the ext-params dynamically to...

376631d1 12/20/2012 05:06 pm Constantinos Venetsanopoulos

Implement the External Storage Interface

With this commit we introduce the External Storage Interface
to Ganeti, abbreviated: ExtStorage Interface.

The ExtStorage Interface provides Ganeti with the ability to interact
with externally connected shared storage pools, visible by all...

044fff06 12/20/2012 11:57 am Michael Hanselmann

More style updates for network-related code

Error message formatting, else/if merging to elif, docstrings.

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

cfa79a23 12/20/2012 11:57 am Michael Hanselmann

cmdlib: Additional opportunistic locking check

If opportunistic locking is requested in the opcode, but no iallocator
is used (not specified or no default), an error will be raised.

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

ff0c9604 12/19/2012 07:26 pm Guido Trotter

One more offline+shutdown fix

Currently gnt-instance shutdown --force of an offline instance
resets the offline status. Which of course is bad and completely
unintended. Fix. (caught by the new qa tests)

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

13659147 12/19/2012 07:15 pm Iustin Pop

Fix network LUs use of error code in OpPrereqError

Currently, most network LUs simply use EINVAL instead of correct error
codes; this patch tries to adjust the obvious cases.

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

572a277b 12/19/2012 06:55 pm Michael Hanselmann

_NetworkQuery: Simplify statistics computation

The code can loop directly over “self.wanted”, saving a lookup. An
explicit loop is also replaced with a generator.

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

892b5258 12/19/2012 06:55 pm Michael Hanselmann

cmdlib: Factorize network conflict detection

LUNetworkConnect and LUNetworkDisconnect had very similar code to detect
conflicts between instance's network interfaces and networks. This code
factorizes the common part and does some cleanup:

- Remove single-letter variable for lambda (“l”)...

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

cmdlib: Replace period with colon in error message

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

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

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

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

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

8e8092cc 12/12/2012 03:21 pm Michael Hanselmann

Fix TypeError when unsetting OS parameters

When all OS parameters should be unset (“gnt-os modify -H -xen-pvm
foo”), a TypeError was raised. This fixes issue 311.

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

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

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

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

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

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

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

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

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

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

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

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

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

2b5b0fe9 11/23/2012 04:24 pm Iustin Pop

Replace dict() with {}

The network patches and an existing test added function-call based
dict construction as opposed to literal sintax.

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

12f647fb 11/22/2012 03:13 pm Guido Trotter

cmdlib.py: don't use GetHypervisor

In cmdlib we must only use the hypervisor class, and never instantiate
it. As such we have to call GetHypervisorClass instead, to avoid
getting an instance of it.

This fixes Issue 316, because init is not called from masterd...

2abb9ea8 11/22/2012 01:40 pm Helga Velroyen

Make ipolicy violations a warning

So far, when running 'gnt-cluster verify' on a cluster which
has instances that violate the instance policy, those
violations were shown as an error. This patch makes them a
warning.

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

2556424d 11/21/2012 05:54 pm Iustin Pop

Small style fixes (' vs ") in network code

This is just trivial fixes; I think I caught all of them.

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

74434d27 11/21/2012 03:40 pm Michael Hanselmann

Remove delayed iallocator call in TLReplaceDisks

By setting the “delay_iallocator” parameter one could delay the call to
the instance allocator. This was not used for some time now, but the
code was still there.

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

de0417fa 11/21/2012 03:40 pm Michael Hanselmann

cmdlib: Merge duplicated code for TLMigrateInstance

LUInstanceFailover and LUInstanceMigrate use TLMigrateInstance and had
the essentially same code for expanding names and declaring locks. In
LUInstanceMigrate.ExpandNames there was a mistake which led to node...

f3196d68 11/21/2012 12:53 pm Helga Velroyen

Fix lint error about too many variables

Lint complains about too many variables in the CheckPrereq
method. While I think that this method/class would need
some refactoring in general, at least this patch makes lint
shut up for now.

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

7309e7b6 11/21/2012 11:21 am Helga Velroyen

Check ispecs against ipolicy on instance modify

When modifying an instance, so far the specs were not checked against
the ipolicy. This patch fixes this issue.

Note that for backend parameters which have a minimum and a maximum
value (currently only memory), it checks both limits against the...

538427e6 11/20/2012 07:51 pm Dimitris Aragiorgis

Fix _ComputeNics to include network slot

This bug was introduced after rebasing master branch.

Signed-off-by: Dimitris Aragiorgis <>
Reviewed-by: Iustin Pop <>

1fa2c40b 11/20/2012 07:51 pm Dimitris Aragiorgis

Fixes to pass py-apidoc (make commit-check)

Signed-off-by: Dimitris Aragiorgis <>
Reviewed-by: Iustin Pop <>