Statistics
| Branch: | Tag: | Revision:

root / lib @ 58b22b6e

# Date Author Comment
58b22b6e 12/18/2008 06:23 pm Michael Hanselmann

Use subdirectories for job queue archive

As it turned out, having many files in a single directory can be
very painful. With this patch, only 10'000 files are stored in a
directory for the job queue archive. With 10'000 directries, this
allows for up to 100 million jobs be archived without having large...

6e797216 12/18/2008 06:23 pm Michael Hanselmann

Add rename function automatically creating directories if needed

Unfortunately, os.makedirs in Python 2.4 is not safe against multiple
processes creating the same directory tree at the same time. This is
only fixed in Python 2.5 and up. Adding more checks in our code doesn't...

aea0ed67 12/18/2008 06:21 pm Michael Hanselmann

ganeti.http: Don't pass poller object around

They're cheap to instantiate and doing this changes makes the code
a bit simpler.

Reviewed-by: ultrotter

79589f25 12/18/2008 03:45 pm Michael Hanselmann

Rename http.HttpInternalError to HttpInternalServerError

All other exceptions are named after the error name in RFC2616 (HTTP/1.1).

Reviewed-by: amishchenko

b3660886 12/18/2008 03:45 pm Michael Hanselmann

ganeti.http: Add more constants and errors

Reviewed-by: amishchenko

45eac583 12/18/2008 03:45 pm Michael Hanselmann

ganeti.http: Ignore ENOTCONN when shutting down the connection

Reviewed-by: amishchenko

a8e01e9f 12/18/2008 03:44 pm Michael Hanselmann

Implement support for additional headers with HTTP errors

Reviewed-by: amishchenko

f30ca1e6 12/17/2008 04:30 pm Michael Hanselmann

Add simple unittests for ganeti.http

More complex unittests will need some refactoring in the HTTP code.

Reviewed-by: amishchenko

e38220e4 12/17/2008 04:09 pm Michael Hanselmann

ganeti.bootstrap: Whitespace fix

Reviewed-by: iustinp

f87b405e 12/17/2008 03:18 pm Michael Hanselmann

Add job queue size limit

A job queue with too many jobs can increase memory usage and/or make
the master daemon slow. The current limit is just an arbitrary number.
A "soft" limit for automatic job archival is prepared.

Reviewed-by: iustinp

7167159a 12/17/2008 01:24 pm Michael Hanselmann

utils.KillProcess: Use waitpid() to wait for child processes

Sometimes the proc filesystem doesn't reflect the current status of
a process. By calling waitpid(), we make sure to get the current
information, at least for child processes. The timeout is still...

513e896d 12/16/2008 06:24 pm Guido Trotter

LUConnectConsole: fix primary_node online check

The primary node is part of the instance, not of the opcode.

Reviewed-by: iustinp

bf988c29 12/16/2008 06:24 pm Guido Trotter

_RunCmdPipe: handle EINTR in poller.poll()

poll() can be interrupted. rather than failing we retry until it
returns.

Reviewed-by: iustinp

14aa53cb 12/16/2008 06:24 pm Guido Trotter

KVM: improve socat interface

Call socat with a full path specified at configure time, rather than
just by its name, and check for the binary to exist at hypervisor
verify.

Reviewed-by: iustinp

dd71f05b 12/16/2008 06:23 pm Guido Trotter

KVM: use a different default kernel path

It makes sense for the default kvm kernel not to be called "xenU".

Reviewed-by: iustinp

f088165d 12/15/2008 12:06 pm Michael Hanselmann

ganeti.http: Add three TODOs for improvements

Reviewed-by: iustinp

f2e13d55 12/15/2008 11:48 am Michael Hanselmann

ganeti.http: Explicitly initiate handshake

Otherwise it would be done on the first read/write operation, making
error handling more difficult (such as EOF during handshake).

Reviewed-by: iustinp

d7fa9982 12/15/2008 11:40 am Michael Hanselmann

ganeti.http: Implement handshake socket operation

Reviewed-by: iustinp

39cfc25b 12/15/2008 11:40 am Michael Hanselmann

ganeti.http: Handle SSL_ERROR_ZERO_RETURN

Also add a comment next to the place where the SSL connection is shut
down.

Reviewed-by: iustinp

3c7f6c44 12/14/2008 02:05 pm Iustin Pop

cleanup: ConfigWriter, initialize all attributes

We should initialized the _last_cluster_serial in the constructor too (just to
be consistent).

Reviewed-by: amishchenko

f6f91001 12/14/2008 02:05 pm Iustin Pop

cleanup: rapi v2 instance tags wrong attribute

This was changed in the past, but it seems this class was forgotten.

Reviewed-by: amishchenko

3f3dfc15 12/14/2008 02:05 pm Iustin Pop

cleanup: http server, line too long

Reviewed-by: amishchenko

5a9c3f46 12/14/2008 02:05 pm Iustin Pop

cleanup: http client, line too long

Reviewed-by: amishchenko

5661b908 12/14/2008 02:04 pm Iustin Pop

cleanup: xen hypervisor

Wrong indentation and uniformize one method signature.

Reviewed-by: amishchenko

08137f9e 12/14/2008 02:04 pm Iustin Pop

cleanup: kvm code likes to redefine names

Reviewed-by: amishchenko

9c034cbe 12/14/2008 02:04 pm Iustin Pop

lib/ssh.py: import the logging module

This only means most of our error paths in this module were not working
(and generating exceptions).

Reviewed-by: amishchenko

bf75f132 12/14/2008 02:04 pm Iustin Pop

SshRunner: add docstring for _BuildSshOptions

Reviewed-by: amishchenko

ad1bf20c 12/14/2008 02:04 pm Iustin Pop

cleanup: use _ for unused loop counter

Reviewed-by: amishchenko

805f0c07 12/14/2008 02:04 pm Iustin Pop

cleanup: WorkerPool, wrong variable name

Quoting Michael: "why is this even working?"

Reviewed-by: imsnah,amishchenko

0b5ad33e 12/14/2008 02:03 pm Iustin Pop

cleanup: TcpPing, wrong variable name

The default value of 'False' wasn't initialized properly. It doesn't
require initialization, but it's cleaner this way.

Reviewed-by: amishchenko

cd34e7bf 12/14/2008 02:03 pm Iustin Pop

cleanup: SetEtcHostsEntry unused var

Reviewed-by: amishchenko

a0add446 12/14/2008 02:03 pm Iustin Pop

cleanup: fix IAllocator hypervisor usage

Two problems: the iallocator.hypervisor wasn't initialized to None in
the constructor, so pylint doesn't realize it's initialized later with
setattr.

Second, 'hypervisor' is a module, so we shouldn't use it as a variable....

4504c3d6 12/14/2008 02:03 pm Iustin Pop

cleanup: LUReplaceDisks unused vars

And a small whitespace fix.

Reviewed-by: amishchenko

9ca87a96 12/14/2008 02:03 pm Iustin Pop

cleanup: do not hide upper-scope name

hypervisor is a module, so we shouldn't use it as an argument.

Reviewed-by: amishchenko

43017d26 12/14/2008 02:03 pm Iustin Pop

cleanup: fix use of _CheckNodeOnline

A few cases of wrong variable name.

Reviewed-by: amishchenko

8153e7e3 12/14/2008 02:03 pm Iustin Pop

cleanup: LUAddNode, LUSetNodeParams unused variable

This is a leftover from the abstraction of AdjustCandidatePool, and it
also requires the config lock, so it's better to remove it.

Reviewed-by: amishchenko

d1dc3548 12/14/2008 02:02 pm Iustin Pop

cleanup: LURenameCluster wrong variable name

Reviewed-by: amishchenko

95268cc3 12/14/2008 02:02 pm Iustin Pop

cleanup: fix export NIC count the same way as disk

For safety, we use the same algorithm as in disk count.

Reviewed-by: amishchenko

bca2e7f4 12/14/2008 02:02 pm Iustin Pop

cleanup: fix backend._RecursiveFindBD

_RecursiveFindBD takes a parameter that isn't used; moreover, nowhere in
the SVN history can I find a case that it has been used.

As such, remove this parameter and fix its callers.

Reviewed-by: amishchenko

9a4e6f41 12/14/2008 02:02 pm Iustin Pop

cleanup: more unused vars

Reviewed-by: amishchenko

3bc6be5c 12/14/2008 02:02 pm Iustin Pop

cleanup: sanitize a default parameter

Instead of relying that the usage of the parameter is ok with mutable
default parameters, let's just make it safer..

Reviewed-by: amishchenko

9728ae5d 12/14/2008 02:02 pm Iustin Pop

cleanup: exceptions should derive from Exception

Reviewed-by: amishchenko

7bc9e58f 12/14/2008 02:02 pm Iustin Pop

cleanup: fix GatherMasterVotes

Remove unused vars

Reviewed-by: amishchenko

531baf8e 12/14/2008 02:01 pm Iustin Pop

cleanup: _InitSSHSetup doesn't need its argument

Reviewed-by: imsnah

fab1e3a4 12/14/2008 02:01 pm Iustin Pop

cleanup: fix 'variable unused' warning

In the iteration we don't care about the node names, so we change the
for loop to be over the values (and not itervalues).

Reviewed-by: amishchenko

22692e48 12/12/2008 06:50 pm Michael Hanselmann

ganeti.http: Rename HttpBase._using_ssl to HttpBase.using_ssl

It'll be queried from other classes.

Reviewed-by: iustinp

f4322a1e 12/12/2008 06:50 pm Michael Hanselmann

ganeti.http: Rename HttpSocketBase to HttpBase

It's more appropriate.

Reviewed-by: iustinp

c41eea6e 12/11/2008 07:13 pm Iustin Pop

Fix epydoc format warnings

This patch should fix all outstanding epydoc parsing errors; as such, we
switch epydoc into verbose mode so that any new errors will be visible.

Reviewed-by: imsnah

52e2f66e 12/10/2008 02:11 pm Michael Hanselmann

ganeti.backend: Improve compression check

Reviewed-by: iustinp

358a8811 12/10/2008 02:06 pm Michael Hanselmann

ganeti.http: Docstring updates

Reviewed-by: iustinp

13b63666 12/09/2008 08:42 pm Michael Hanselmann

ganeti.http: Remove _HttpClientError

This is a leftover from old code.

Reviewed-by: iustinp

59305197 12/09/2008 07:35 pm Michael Hanselmann

ganeti.http.server: Increase connection backlog to 1024

This solves a problem with many concurrent requests. By default, 1024
is the maximum backlog on Linux kernels. We limit the number of clients
through MAX_CHILDREN, too. The idea of just increasing the backlog is...

12bce260 12/09/2008 03:24 pm Michael Hanselmann

RPC: Compress file upload data

Adding compression to larger amounts of data is more efficient than
transferring it (len(nodes) - 1) times over the network without
compression. We were able to compress a 800KB config file to about
30 KB, which is about 40 KB with Base64 encoding (required due to...

832261fd 12/09/2008 11:33 am Iustin Pop

Warn for instances living on offline nodes

The patch also changes the result to error for non-reachable secondary nodes
(as for primary nodes).

Reviewed-by: ultrotter

ee513a66 12/08/2008 07:45 pm Iustin Pop

Fix _AdjustCandidatePool

Currently the ConfigWriter.MaintainCandidatePool returns node names, and
_AdjustCandidatePool uses them as such, but then it passes these to
context.ReaddNode which in turn passes them to jqueue.JobQueue.AddNode which
uses them as objects.Node instances....

3a5ba66a 12/08/2008 01:46 pm Iustin Pop

gnt-node modify: add the offline attribute

This patch changes gnt-node modify and the associated opcode/lu to allow
modification of the node offline attribute.

Setting a node into offline mode automatically demotes it from the
master role.

Reviewed-by: ultrotter

ed83f5cc 12/08/2008 11:10 am Iustin Pop

RPC: do not make calls to offline nodes

This patch changes the _MultNodeCall and _SingleNodeCall helpers to not
actually make calls to offline nodes, but instead generate fake
responses which have a parameter caller 'offline' set so that callers
can check for this value if they want (otherwise, it's just a failed RPC...

0a66c968 12/05/2008 01:41 pm Iustin Pop

Make cluster verify understand offline nodes

This patch changes cluster verify to not alert on offline nodes, but
instead just show a note at the end with the number of such nodes.

It also removes warnings in verify-disks and hooks about failures to
make rpc calls to such nodes....

7527a8a4 12/05/2008 01:32 pm Iustin Pop

cmdlib: check node stats in prereqs

This patch adds checks for offline nodes in most instance LUs so that we
can work with offline secondaries, but not with offline primaries. Some
cases (like grow disk, which needs both sides up) are not allowing
offline nodes at all....

a5961235 12/05/2008 01:20 pm Iustin Pop

Add two utility functions to cmdlib

These will be used for parameter checking and node status checking.

Reviewed-by: ultrotter

ec0292f1 12/05/2008 01:14 pm Iustin Pop

Add function to compute the master candidates

Since some nodes can be offline, we can't just take the length of the
node list as the maximum possible number of master candidates.

The patch adds an utility function to correctly compute this value and
replaces hardcoded computations with the use of this function. It then...

b18dd019 12/05/2008 12:12 pm Iustin Pop

http: use slicing instead of string modification

The combination of the current buffer splitting method and (4KB) buffer
size is very inefficient when writing big amounts of data. Just walking
over a 16 megabyte string using a 4K buffer takes (on a random computer)...

a3316e4a 12/05/2008 12:12 pm Iustin Pop

Add the offline node list to ssconf

The patch also changes the various node list generation to be more
consistent.

Reviewed-by: imsnah

56aa9fd5 12/05/2008 05:01 am Iustin Pop

Cleanup the config file on demotion from candidate

This patch adds a simple rpc which makes a backup of the config file and
then removes it. This is done so that cluster verify doesn't complain
immediately after demoting a node.

Reviewed-by: imsnah

cbfc4681 12/05/2008 04:58 am Iustin Pop

watcher: handle offline nodes better

This patch changes the LUQueryInstances to show a different state for
offline nodes and also modifies the watcher to understand the offline
state in its checks.

Reviewed-by: ultrotter

9ddb5e45 12/05/2008 04:53 am Iustin Pop

node list: add the offline field

Reviewed-by: ultrotter

fc0fe88c 12/05/2008 04:53 am Iustin Pop

Add a new node parameter 'offline'

This patch adds a new node parameter called offline that will be used to
mark nodes which should be touched by commands.

We also add this flag at cluster init, node add, and export it to
iallocator scripts.

Reviewed-by: ultrotter

02b31f32 12/05/2008 04:42 am Iustin Pop

ssconf: empty files should not add a newline

Currently we add a newline in the ssconf writeout process, even if the
file is empty. We chage this case so that lists of values (e.g. offline
nodes) are correct (not a list of one empty element).

Reviewed-by: imsnah

99b5ef90 12/04/2008 05:25 pm Michael Hanselmann

ganeti.http: Add constant for DELETE

Reviewed-by: amishchenko

9501323b 12/04/2008 05:25 pm Michael Hanselmann

Remove old HTTP code

Reviewed-by: amishchenko

ae88ef45 12/04/2008 05:24 pm Michael Hanselmann

ganeti.rpc: Convert to new HTTP server

Reviewed-by: amishchenko

02cab3e7 12/04/2008 05:23 pm Michael Hanselmann

ganeti.http: Split HTTP server and client into separate files

This includes a large rewrite of the HTTP server code. The handling of
OpenSSL errors had some problems that were hard to fix with its
structure. When preparing all of this, I realized that actually HTTP...

84f2756e 12/04/2008 05:23 pm Michael Hanselmann

Rename all HTTP classes to camel case

It should be consistent.

Reviewed-by: amishchenko

c9d0fa8a 12/04/2008 05:22 pm Michael Hanselmann

ganeti.http: Remove underline from two classes

This is a preparation step for splitting the HTTP client and server code
into two separate modules.

Reviewed-by: amishchenko

ff9efc03 12/04/2008 05:22 pm Michael Hanselmann

Move HTTP code to subpackage

This is a preparation step for splitting the HTTP client and server code
into two separate modules.

Reviewed-by: amishchenko

eb1742d5 12/04/2008 04:52 pm Guido Trotter

LURemoveNode, promote nodes to master candidates

If after the remove node there are not enough master candidates, we'll
try to promote them.

Reviewed-by: imsnah

b04285f2 12/03/2008 07:23 pm Guido Trotter

LUQueryExports: fix rpcresult handling

call_export_list is a multi node call, so we need to go through the
results, extrapolate the good ones, and return a failure value for the
bad ones.

Reviewed-by: imsnah

0fff97e9 12/03/2008 07:23 pm Guido Trotter

LUAddNode: Auto-make master candidates

When a node is added, if there are not enough master candidates, we'll
automatically promote it.

Reviewed-by: imsnah

f08ce603 12/03/2008 07:22 pm Guido Trotter

LUAddNode: Check the correct result

This is a typo in the conversion to RpcResult

Reviewed-by: imsnah

4ce6007f 12/03/2008 06:09 pm Michael Hanselmann

ganeti.http: Fix copyright header

Reviewed-by: ultrotter

6192c9b7 12/03/2008 06:09 pm Michael Hanselmann

ganeti.http: Remove unused attribute "should_fork"

This is a leftover from removed code.

Reviewed-by: ultrotter

b1d979cf 12/03/2008 06:09 pm Michael Hanselmann

ganeti.http: Move request handling logic from server to handler class

Reviewed-by: ultrotter

73a59d9e 12/03/2008 06:09 pm Michael Hanselmann

ganeti.http: Move _SocketOperation to module-level function

This is a preparation step to move the HTTP server class to the
same model as the HTTP client (polling, non-blocking I/O, better
OpenSSL error handling).

Reviewed-by: ultrotter

f22c1cea 12/03/2008 06:08 pm Michael Hanselmann

ganeti.http: Move _WaitForCondition into module-level function

Reviewed-by: ultrotter

e820685c 12/03/2008 06:08 pm Michael Hanselmann

ganeti.http: Remove ApacheLogfile class

We don't need it anymore and it wouldn't work as it is, anyway.

Reviewed-by: ultrotter

05cc153f 12/03/2008 01:12 pm Guido Trotter

InitCluster force a config file update

After the cluster is ready we'll load the ConfigWriter and force a
writeout of all config files.

Reviewed-by: imsnah

c044f32c 12/03/2008 01:12 pm Guido Trotter

Make sure the initial node is a master candidate

Reviewed-by: imsnah

ce735215 12/03/2008 01:12 pm Guido Trotter

gnt-cluster init, handle candidate_pool_size

- Add a new command line option, defaulting to the constant value
- Pass the value to bootstrap.InitCluster
- Use it to init the new Cluster object

Reviewed-by: imsnah

c3e618cc 12/03/2008 01:12 pm Guido Trotter

Add the MASTER_POOL_SIZE_DEFAULT constant

This constant will be used at cluster init time.

Reviewed-by: imsnah

90eb468c 12/03/2008 01:12 pm Guido Trotter

CheckBEParams handle a bool BE_AUTO_BALANCE

This only happens at cluster init, if the value is not user-specified.

Reviewed-by: imsnah

3a26773f 12/03/2008 11:57 am Iustin Pop

A few fixes related to master candidates

This patch:
- fixes cluster verify when all nodes are master candidates, but the
candidate_pool_size is higher
- warn when the master node is not marked as candidate
- disable setting master node to regular node...

ec85e3d5 12/03/2008 11:55 am Iustin Pop

Fix cluster rename and known_hosts

This patch rewrites and distributes ganeti's known_hosts file in case of
a cluster rename.

We also fix a problem in the node add (from where I copied the
known_hosts file distribution).

Reviewed-by: ultrotter

25361b9a 12/02/2008 04:35 pm Iustin Pop

Fix gnt-cluster verify w.r.t. rpc changes

This partially reorganizes the cluster verify LU:
- introduce constants for the node verify rpc call
- move from additional rpc calls to a single rpc call, the
call_node_info, which gaters all data needed...

55cf7d83 12/02/2008 02:58 pm Iustin Pop

Fix cluster rename

With the recent configwriter/ssconf changes, cluster rename becomes
trivial. This patch gets rids of the code and just updates the cluster
object.

Reviewed-by: imsnah

781de953 12/02/2008 02:58 pm Iustin Pop

Convert rpc results to a custom type

For a long time we had the problem that both RPC-layer errors and
results from the remote node share the same "valuespace". This is
because we shouldn't raise an exception when only one node failed
(and lose the results from the other nodes)....

00f91f29 12/02/2008 02:58 pm Iustin Pop

burnin: add instance reinstall and reboot

These two operations were missing from burnin. The reboot is done with
all valid modes (a new constant is added), and the reinstall is done
both with and without specifying the OS (to account for the two code
paths in the LU)....

8a74a9b9 12/02/2008 12:54 pm Guido Trotter

KVMHypervisor add two missing 'constants.'

Some calls to the HV parameters were missing them.

Reviewed-by: imsnah

47387b1e 12/02/2008 12:54 pm Guido Trotter

KVMHypervisor fix to case misspellings

Reviewed-by: imsnah

d4b72030 12/02/2008 12:53 pm Guido Trotter

Use the new utils.CheckBEParams function

Where we used/forgot to validate beparams we now use the new common function.

Reviewed-by: imsnah

42ce2e13 12/02/2008 12:53 pm Guido Trotter

Add utils.CheckBEParams

This function will be used in LUCreateInstance, LUSetInstanceParams,
LUSetClusterParams and InitCluster to check the backend parameters
validity and convert the relevant values to integer, without duplicating
code. It lives in utils as bootstrap.py is calling it too....