Statistics
| Branch: | Tag: | Revision:

root / lib @ dffa96d6

# Date Author Comment
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 <>

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

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

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

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

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

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

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

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

7a476bb5 11/23/2012 04:23 pm Dimitris Aragiorgis

Export network in FinalizeExport()

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

829cfbc5 11/23/2012 04:23 pm Dimitris Aragiorgis

Fix bug in OpNetworkQuery result check

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

55f70aef 11/23/2012 04:22 pm Dimitris Aragiorgis

Fix bug in network module

Signed-off-by: Dimitris Aragiorgis <>
Signed-off-by: Iustin Pop <>
[: slightly improved code flow]
Reviewed-by: Iustin Pop <>

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

405bffe2 11/21/2012 03:43 pm Michael Hanselmann

Rename leftovers from remote to restricted commands

As per Iustin Pop's suggestion in <> on
<>.

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

42bd26e8 11/21/2012 03:43 pm Michael Hanselmann

backend: Rename RunRemoteCommand to RunRestrictedCmd

As per Iustin Pop's suggestion in <> on
<>.

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

878c42ae 11/21/2012 03:43 pm Michael Hanselmann

Rename constants and directory for restricted commands

As per Iustin Pop's suggestion in <> on
<>.

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

1fdeb284 11/21/2012 03:43 pm Michael Hanselmann

Rename configure option for restricted commands

It is no longer “--enable-remote-commands”, but rather
“--enable-restricted-commands”.

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

6d846d0e 11/21/2012 03:43 pm Michael Hanselmann

Add command line interface for running commands remotely

This patch adds a new command, “gnt-node restricted-command”. Since the
semantics are different from “gnt-cluster command”, the same subcommand
shouldn't be re-used.

The included man page update also includes a small description of how to...

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

621b43ed 11/21/2012 08:37 am Michael Hanselmann

locking.LockSet: Replace boolean parameter with constants

Upcoming changes will add opportunistic locking to “locking.LockSet”.
Doing so will require additional code in “LockSet.__acquire_inner”, at
which point the existing “want_all” parameter does not always apply....

5b34cc22 11/21/2012 08:21 am Michael Hanselmann

network: Style updates

- Quote characters
- Docstrings

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

a138ead7 11/21/2012 08:21 am Michael Hanselmann

ht: Complain if TNone isn't listed first for TOr/TAnd

Some type descriptions are rather long. If "None" is listed at the end
or somewhere in between it is easily missed. Therefore it should be at
the beginning, e.g. "None or (long description)".

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

32e3d8b1 11/21/2012 08:20 am Michael Hanselmann

opcodes: Network parameter improvements and fixes

- Use variables for checks for IP addresses (makes them more consistent,
too)
- Fix checks to accept default values
- Small description improvements (e.g. s/IP/IP address/)

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

1f84cca8 11/21/2012 08:18 am Michael Hanselmann

Merge branch 'devel-2.6'

  • devel-2.6:
    Fix opcode validation for OpOobCommand.command
    Fix typo in manpage for gnt-os
    gnt-instance.8: Add index to disk and nic removal

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

6cbf6d9a 11/21/2012 07:51 am Michael Hanselmann

Merge branch 'stable-2.6' into devel-2.6

  • stable-2.6:
    Fix opcode validation for OpOobCommand.command
    Fix typo in manpage for gnt-os
    gnt-instance.8: Add index to disk and nic removal

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

a13d34a6 11/21/2012 03:44 am Michael Hanselmann

locking: Use frozenset instead of utils.UniqueSequence

In this case “frozenset” is good enough as the result's order doesn't
matter--it is the input to “sorted” (“utils.UniqueSequence” preserves
the order). “frozenset” is ca. 25% faster for this use-case....

8df21834 11/20/2012 07:51 pm Dimitris Aragiorgis

Move _BuildNetworkEnv() at top-level

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

861a92b4 11/20/2012 07:51 pm Dimitris Aragiorgis

Use bitarray 0.8 interface

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

cfcea7ef 11/20/2012 07:51 pm Dimitris Aragiorgis

Minor fix in query.py

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

08ed6998 11/20/2012 07:51 pm Dimitris Aragiorgis

Minor fix in ovf

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

6a94d553 11/20/2012 07:51 pm Dimitris Aragiorgis

Fix a few docstrings

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

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

Simplify GenerateFree in network module

GenerateFree now returns the first available IP in the network
or raises AddressPoolError if it is full.

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

e81eef56 11/20/2012 07:51 pm Dimitris Aragiorgis

Replace string values with proper constants

_UnlockedCommitIp is used either for releasing or reserving an
IP inside a network. New constants RELEASE_ACTION/RESERVE_ACTION
are used to decide which is the case.

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

7f033fb3 11/20/2012 07:51 pm Dimitris Aragiorgis

Add docstring to the GetECReserved config method

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

032a7d71 11/20/2012 07:51 pm Dimitris Aragiorgis

Simplify mac generation funtions

Introduce new config method _UnlockedGetNetworkMACPrefix and refactor
original _GenerateOneMAC so that it takes prefix as an optional
argument and returns a function that actually generates a MAC. If
prefix is not given or None it uses the cluster level default....

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

3c286190 11/20/2012 07:51 pm Dimitris Aragiorgis

Fixes to pass pep8 (make lint)

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

beb81ea5 11/20/2012 07:51 pm Dimitris Aragiorgis

Fixes to pass pylint (make lint)

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

6e8091f9 11/20/2012 07:51 pm Dimitris Aragiorgis

Fixes to pass unittests (make check)

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

77aab207 11/20/2012 07:51 pm Dimitris Aragiorgis

Check for existing networks/groups in Network LUs

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

8140e24f 11/20/2012 07:51 pm Dimitris Aragiorgis

Add tags in network objects

Support:
- gnt-network add --tags.
- gnt-network list-tags/add-tags/remove-tags/.
- gnt-network list -o +tags

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

d5ed7dce 11/20/2012 07:51 pm Dimitris Aragiorgis

Change default fields for network listing

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

09a3d21f 11/20/2012 07:51 pm Dimitris Aragiorgis

Pass detailed network info in hooks

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

cbe4a0a5 11/20/2012 07:51 pm Dimitris Aragiorgis

Pass netinfo in rpcs

If a nic has a network field then encapsulate a network object in
netinfo slot for every rpc. This is needed to pass network info to
scripts managing nics (kvm-vif-bridge).

Introduce _BuildNetworkEnv().

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

a0af6c80 11/20/2012 07:51 pm Dimitris Aragiorgis

Use network's mac prefix

Modify existing GenerateMAC so that it takes network as an argument.

Substitute _GenerateOneMAC with a decorator _GenerateMACPrefix that
chooses the prefix (network's or cluster's) and wraps
_GenerateMACSuffix that generates the three remaining bytes....

4588b4bd 11/20/2012 07:51 pm Dimitris Aragiorgis

Rapi support for networks

Support:
- GetNetwork(s)
- CreateNetwork
- ConnectNetwork
- DisconnectNetwork
- RemoveNetwork

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

f2bd89b3 11/20/2012 07:51 pm Apollon Oikonomopoulos

ss_conf support for networks

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

9c784fb3 11/20/2012 07:51 pm Dimitris Aragiorgis

Introduce client support for networks

gnt-network is used to manipulate and handle networks that currently
provides the following operations:

  • Add a new network:
    gnt-network add --network=1.2.3.0/28 --gateway=1.2.3.1
    --add-reserved-ips=1.2.3.4,1.2.3.5 testnet...
d4117a72 11/20/2012 07:51 pm Apollon Oikonomopoulos

Modify instance client to support networks

Add --no-conflicts-check option.
Modify instance query methods to return nic's network info.

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

a5ad5e58 11/20/2012 07:51 pm Apollon Oikonomopoulos

Peripheral changes for networks

Specifically: * export a new environment variable for the gnt-os-interface * export a new environment variable for KVM specific scripts * ovf support for networks

Signed-off-by: Apollon Oikonomopoulos <>...

d1547283 11/20/2012 07:51 pm Dimitris Aragiorgis

Modify LUInstanceSetParams() to support networks

Keep backwards compatibility just like LUInstanceCreate() and support
network parameter for NIC object.

Add ec_id argument in Update() to be able to commit temporary IPs that
were previously reserved.

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

ced51149 11/20/2012 07:51 pm Dimitris Aragiorgis

Modify RemoveInstance() to support networks

Release any IPs held the instance before actually removing.

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

e8e079f3 11/20/2012 07:51 pm Dimitris Aragiorgis

Modify LUInstanceCreate to support networks

Implement backend support, to export the IP pool management
functionality to the clients. When the new NIC parameter 'network' is
given, the ippool management system is triggered. If a NIC belongs to
a network, it inherits the netparams (mode, link) as its nicparams. If...

ad4a9ae7 11/20/2012 07:51 pm Dimitris Aragiorgis

Config methods for reserving/releasing IPs

Use TemporaryReservationManager for IP handling to ensure config data
consistency.

Implement:
- methods for reserving/releasing IPs
- _UnlockedCommitTemporaryIps()
- CheckIPInNodeGroup() used for conflicting IPs...

0fbd466b 11/20/2012 07:50 pm Dimitris Aragiorgis

Implement network/nodegroup mappings

LUNetworkConnect() connects a network to a nodegroup and defines
its netparams (mode and link). Specifically: * Check if network already exists * Check if netparams are valid * Check if already connected to the same nodegroup...

1e0d3321 11/20/2012 07:50 pm Dimitris Aragiorgis

Implement LUNetworkSetParams

Support modifying all network parameters except for network (ip
range). Cannot modify gateway and reserved ips at the same time.

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

306bed0e 11/20/2012 07:50 pm Apollon Oikonomopoulos

Implement LUNetworkQuery

Summarily list all existing networks
Supply detailed info for every existing network
- List used/free IPs
- List instances with NICs assigned to the corresponding network
- List NIC index and IP for the above instances

Implement complementary config methods for retrieving networks....

6c0a75db 11/20/2012 07:50 pm Dimitris Aragiorgis

Basic IP pool management logic

Implement LUs for corresponding opcodes: * LUNetworkAdd:
- Check for IP validity
- Reserves all necessary IPs
- Create new Network config object * LUNetworkRemove:
- Checks if connected to any nodegroup
- Remove a Network config object...

1de1cf25 11/20/2012 07:50 pm Apollon Oikonomopoulos

Introduce new module for IP pool management

Add new library module lib/network.py.
Introduce new class: AddressPool.

AddressPool implements all operations needed for managing IPs inside
the IP pool.

Given a Network config object (nobj), the class:

  • initializes the corresponding IP pool object via...
eaa4c57c 11/20/2012 07:50 pm Dimitris Aragiorgis

IP pool related objects, opcodes and constants

Config objects: * Introduce L{Network} with
- IPv4 network field (mandatory)
- IPv4 gateway, IPv6 (network/gateway), mac prefix, type (optional) * Modify existing config objects to support networks:
- Add new slot 'network' to L{NIC} config object...

e1ebbfcf 11/20/2012 11:25 am Iustin Pop

Improve error message for wrong opcode parameter values

When given an empty string as value to a parameter that doesn't accept
empty strings, the error message was confusing, since it was showing
just as a double space.

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

2c9fa1ff 11/20/2012 11:16 am Iustin Pop

Cleanup ht's use of positive/strictpositive

Currently, ht.py uses a bad terminology for positive/non-negative
numbers. Per http://en.wikipedia.org/wiki/Positive_number, this is the
correct terminology:

- A number is positive if it is greater than zero.
- A number is negative if it is less than zero....

dc6296ff 11/19/2012 09:34 pm Michael Hanselmann

locking: Simplify condition

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

70296981 11/19/2012 03:17 pm Iustin Pop

Fix opcode validation for OpOobCommand.command

The 'command' attribute of the OpOobCommand command is defined with a
default value of None, but its validation requires a member of
constants.OOB_COMMANDS, which doesn't accept None. This result in the
following error when submitting an opcode without the command:...

e4d745a7 11/19/2012 03:12 pm Michael Hanselmann

Add opcode for running commands remotely

The opcode doesn't pay attention to the build-time flag to enable or
disable restricted commands. In a cluster different nodes could have
different settings.

Node locks are acquired in shared mode by default, but the use of an...

db2203e0 11/19/2012 03:12 pm Michael Hanselmann

Add RPC for restricted commands

Expose the functionality to run restricted commands remotely via RPC.

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

03c5291c 11/19/2012 03:10 pm Michael Hanselmann

locking: Don't schedule pending acq. for short timeout

Scheduling a pending acquisition is relatively expensive and lot of code
is involved. Unless there is already one, a new pipe needs to be opened.
Data structures need to be updated as well, only to be undone shortly...

1a2eb2dc 11/16/2012 04:10 pm Michael Hanselmann

backend: Implement remote commands

As per design document (doc/design-remote-commands.rst), a number of
rather strict tests is applied to any incoming request, a delay is
inserted upon errors and returned error messages are very generic
(unless it's the actual command that failed). There are unit tests for...

9108958f 11/16/2012 04:09 pm Michael Hanselmann

configure: Add option to enable remote commands

By default remote commands are disabled and need to be explicitely
enabled at build time.

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

5e12acfe 11/16/2012 03:57 pm Michael Hanselmann

rapi: Add new user option for querying

This was requested in issue 301. Before this patch, requests to
“/2/query/*” and “/2/instances/*/console” would require authentication
with a user with write access. Since that is not strictly necessary, a
new user option named “read” is added....

f92ed8ab 11/15/2012 02:30 pm Michael Hanselmann

Move gnt_cluster.SHOW_MACHINE_OPT to cli

This allows the option to be re-used in other places.

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

bfbd12f7 11/14/2012 12:07 pm Michael Hanselmann

Warn on invalid lines in HTTP user files

Without this change, invalid lines or values would be silently ignored.

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

df99f3a9 11/14/2012 10:16 am Michael Hanselmann

pathutils: Add directory for remote commands

Also add tests to ensure it's never allowed as a file storage path. A
constant for the lock file is also added.

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

2f18052f 11/14/2012 10:16 am Michael Hanselmann

utils.process.RunResult: Always set "fail_reason" attribute

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

e9e07c9c 11/13/2012 09:28 pm Michael Hanselmann

Add “gnt-job change-priority” sub-command

This can be used to change the priority of a pending or running job (the
latter only if there are unprocessed opcodes).

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

f63ffb37 11/13/2012 09:28 pm Michael Hanselmann

Expose changing job priority via LUXI

A new LUXI request is added, in both Python and Haskell.

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

4679547e 11/13/2012 09:20 pm Michael Hanselmann

jqueue: Allow changing of job priority

This is due to a feature request. Sometimes one wants to change the
priority of a job after it has been submitted, e.g. after submitting an
important job only to later notice many other pending jobs which will be
processed first. Priority changes only take effect at the next lock...

99fb250b 11/13/2012 09:20 pm Michael Hanselmann

jqueue: Set task ID for jobs added to workerpool

The job ID is re-used as the task ID, as job IDs are unique.

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

bba69414 11/13/2012 09:20 pm Michael Hanselmann

workerpool: Preserve task number when deferring

When a task is deferred it should receive the same task ID upon being
returned to the pool.

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

9a2564e7 11/13/2012 09:20 pm Michael Hanselmann

workerpool: Add method to change task's priority

Using the task ID a pending task's priority can be changed. This will be
used to change the priority of jobs in the workerpool.

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