Statistics
| Branch: | Tag: | Revision:

root / lib @ 4c7c81d7

# Date Author Comment
4c7c81d7 11/12/2008 02:52 pm Michael Hanselmann

ganeti.rpc: Use utils.ReadFile instead of reading file directly

Reviewed-by: iustinp

6346a9e5 11/12/2008 02:51 pm Michael Hanselmann

utils.SetupLogging: Remove previously setup handlers

If a logging function is called before the logging module is setup
using utils.SetupLogging, it calls logging.basicConfig, which adds
a StreamHandler, on its own. If we leave it in, all log output will...

a3811745 11/12/2008 02:51 pm Michael Hanselmann

jqueue: Always use rpc.RpcRunner

"from ganeti.rpc import RpcRunner" does not conform to the style guide.

Reviewed-by: iustinp

fda5f19f 11/12/2008 02:51 pm Michael Hanselmann

bootstrap: Always use rpc.RpcRunner

"from ganeti.rpc import RpcRunner" does not conform to the style guide.

Reviewed-by: iustinp

7c28c575 11/12/2008 02:50 pm Michael Hanselmann

ganeti.rpc: Convert to ganeti.serializer

This is one of the last places where the simplejson module is
used directly.

Reviewed-by: iustinp

ecfe9491 11/12/2008 02:50 pm Michael Hanselmann

Convert RPC module to new HTTP client

Currently, HttpClientManager is instantiated for every RPC call. This
will be changed with another patch, as will the use of SSL. The “Run”
method is no longer needed.

Reviewed-by: iustinp

e1bd0072 11/12/2008 05:43 am Iustin Pop

Fix utils.KillProcess

Rev 1978 introduced a breakage on the SIGKILL finall signal to the
process, due to mistyped variable.

Reviewed-by: francis.perron

438a366a 11/11/2008 06:16 pm Michael Hanselmann

ganeti.http: Implement SSL for HTTP client

Implementing SSL for the HTTP client required more work than I expected.
For correct error handling, quite a lot of code is needed. To avoid
code duplication, I moved a lot of the socket handling code into a
single function named _SocketOperation. It takes care of the polling...

b11c9e5c 11/11/2008 01:02 pm Michael Hanselmann

ganeti.daemon: Add timers to Mainloop

This is a fallout from my work on the HTTP client class. Repeating
timers are prepared, but not yet implemented.

Reviewed-by: iustinp

d868edb4 11/11/2008 12:58 pm Iustin Pop

Convert trunk to posix-compatibility

We change two functions to use RunCmd without shell, and the other
(which needs a ssh command line) is changed to the '>... 2>&1' syntax.

Reviewed-by: imsnah

44bf25ff 11/11/2008 12:58 pm Iustin Pop

Remove zombie special case from IsProcessAlive

Based on the discussion on the mailing list, we remove the special
casing of zombie processes.

Note we don't use kill -0 since that has a different meaning than "check
process is alive", so this function is still linux-specific....

ff5251bc 11/11/2008 12:58 pm Iustin Pop

Add cleanup of processes to utils.KillProcess

In case the process we want to signal is our own process, and the signal
we send is a deadly one, we should also cleanup after the process.

This patch adds a new parameter waitpid to this function that does this,...

cb4e8387 11/11/2008 12:58 pm Iustin Pop

Fix instance rename

As can be seen from the patch, we remove from the locking manager
inst.name. However, we do this right after cfg.RenameInstance, which
changes inst.name to the new name. So we need to remove old_name not
the new name.

The real question is why does the glm allow me to remove a not-existing...

bb2ee932 11/11/2008 05:12 am Iustin Pop

Fix gnt-instance reinstall

Commit 1881 changed a rpc call but didn't fix all its users. This should
fix it (but I can't test as HTTP is broken).

Reviewed-by: imsnah

8797df43 11/11/2008 05:12 am Iustin Pop

Implement working directory for utils.RunCmd

In order to replace usage of the shell just for 'cd %s; ...' we need to
be able to specify the working directory for childs.

The patch also changes the default working directory (when not
specified) to "/", as opposed to the current dir; since the daemos run...

b14f759e 11/10/2008 02:38 pm Michael Hanselmann

ganeti.http: Move SSL socket creation into base class

The same code will be used by the HTTP client.

Reviewed-by: iustinp

b14b975f 11/10/2008 02:37 pm Michael Hanselmann

ganeti.daemon: Make Mainloop more flexible

While working on the HTTP client class, I wanted to use Mainloop
before deciding to use threads instead.

- Add docstrings
- Rename "quit" to "running", move it to a local variable
- Support adding and removing I/O listeners while running...

d7bace1b 11/10/2008 12:14 pm Michael Hanselmann

ganeti.http: Add constant for "Unexpected EOF"

This is an expected error message and will be used in two places.

Reviewed-by: iustinp

8a0b06d2 11/06/2008 01:25 pm Michael Hanselmann

Add new HTTP client class

It is based on the WorkerPool class which is already used for the job
queue and master daemon. Each request must be encapsulated in an
instance of HttpClientRequest, which will then be passed to
HttpClientManager for processing. Upon completion, the request object...

64357ed8 11/06/2008 01:24 pm Michael Hanselmann

ganeti.http: Use 411 Length Required in server code

Reviewed-by: iustinp

cd4d138f 11/05/2008 06:37 pm Guido Trotter

Update LUGrowDisk _WaitForSync call

The _WaitForSync call changed in r1794 but the GrowDisk call wasn't updated
then. This makes GrowDisk work in trunk.

Reviewed-by: iustinp

8a9f9060 11/05/2008 04:04 pm Michael Hanselmann

ganeti.http: Add more constants

As a preparation for the new HTTP client class, add more constants
to ganeti.http.

Reviewed-by: iustinp

116db7c7 10/28/2008 01:21 am Iustin Pop

Small documentation updates for workerpool.py

Reviewed-by: imsnah

ea03467c 10/28/2008 01:21 am Iustin Pop

Documentation updates for jqueue.py

Reviewed-by: imsnah

63712a09 10/28/2008 01:20 am Iustin Pop

Yet another bug found while reviewing docs

The newer_than variable can be either None or an int, and we normalize
it to an integer previously and save it in the 'serial' variable, which
should be used instead.

Reviewed-by: imsnah

58885d79 10/28/2008 01:20 am Iustin Pop

Documentation updates for utils.py

Reviewed-by: imsnah

10c2650b 10/25/2008 03:37 am Iustin Pop

Update backend.py docstrings

This patch converts all of backend.py to epydoc formatting.

Reviewed-by: imsnah

3f5bd234 10/25/2008 03:37 am Iustin Pop

Fix another error handling case

The return from this error path is a dict, but the actual return value
(on the non-error handling) is a list of dicts. Change accordingly.

Reviewed-by: imsnah

0a70a72a 10/24/2008 07:14 pm Iustin Pop

Fix an error handling case

Found while reviewing documentation.

Reviewed-by: ultrotter

2e3d1946 10/24/2008 06:23 pm Guido Trotter

OSFromDisk remove superfluous empty line

Reviewed-by: iustinp

b1206984 10/24/2008 05:44 pm Iustin Pop

Some documentation updates

This fixes a few doc issues and converts a few docstrings to epydoc.

Reviewed-by: imsnah

36117c2b 10/24/2008 05:43 pm Iustin Pop

Modify utils.RunCmd to write output to file

Currently we launch processes via the shell in a few places only to
redirect standard output and error to a log file ("&> $file"). It is
better to do such redirection from within RunCmd itself.

This patch splits RunCmd in two parts, the setup and the execution part,...

f2a6fc9e 10/24/2008 02:49 pm Michael Hanselmann

ganeti.http: Implement SSL certificates

Reviewed-by: killerfoxi

23e46494 10/24/2008 02:31 pm Michael Hanselmann

Document HttpServer.__init__

At the same time, simplify the interface a bit by not using a tuple.

Reviewed-by: killerfoxi, ultrotter

d8353c3a 10/23/2008 05:19 pm Iustin Pop

Fix gnt-* command with --submit

Currently we don't catch the JobSubmittedException (although the code to
format it nicely is there). The patch adds the exception name to the
catch list and makes --submit work.

Reviewed-by: imsnah

74c47259 10/23/2008 05:19 pm Iustin Pop

Export the disk index in the import/export scripts

We want to export the disk index as some OSes will only want to export
the first disk (or the second one, etc.), even if we have multiple
disks.

The patch also updates the backend.ExportSnapshot docstring....

64272529 10/23/2008 05:18 pm Iustin Pop

Fix leftover of hypervisor attribute rename

Reviewed-by: imsnah

6526ddcd 10/23/2008 02:58 pm Michael Hanselmann

http library: Always fork before reading request

It turned out that clients not sending a full request will stop
us from responding to further requests. This patch leverages the
situation a bit by always forking before handling the request,
but we still have DoS situations....

54cf6599 10/23/2008 02:58 pm Michael Hanselmann

daemon.py: Don't wake up every second

We don't have timers yet, hence waking up is not needed at all.

Reviewed-by: ultrotter

1a05d855 10/23/2008 01:41 am Oleksiy Mishchenko

RAPI: Export beparams as dict. The patch also enables LUQueryInstances to accept beparams as valid field.

Reviewed-by: iustinp

212fa3a7 10/22/2008 11:54 pm Oleksiy Mishchenko

RAPI: Forgoten in r1923 instance add change.

Reviewed-by: iustinp

09acf207 10/22/2008 05:09 pm Guido Trotter

LUCreateInstance: import multiple disks

Previously we used to handle only one disk. Now we'll import all the
ones present in the export, in order, on the instance's disks. Any disk
which was present on the original instance but wasn't exported is just
skipped in the target instance....

6c0af70e 10/22/2008 05:09 pm Guido Trotter

Convert ImportOSIntoInstance to OS API 10

- Change ImportOSIntoInstance not to get any "os_disk" and "swap_disk"
arguments but to accept multiple target images to import, and to
return a list of booleans with the result of each import
- Change the relevant rpc call and the only caller to conform...

0607699d 10/22/2008 05:09 pm Guido Trotter

Convert ExportSnapshot to OS API 10

We pass the data via the environment rather than on the command line, as
API 10 says. All the rest remains the same, and we export just one disk,
as the master calls this function for every snapshotted disk.

Reviewed-by: iustinp

19d7f90a 10/22/2008 05:08 pm Guido Trotter

LUExportInstance: snapshot all disks

Rather than just snapshotting the "sda" disk, we'll snapshot all of the
instance disks. If we can't snapshot a disk for any reason we'll log an
error and proceed anyway: in this case the resulting export will miss a
disk. This also changes all the warning messages to self.LogWarning()....

e9e9263d 10/22/2008 05:08 pm Guido Trotter

Convert SnapshotBlockDevice's docstring to epydoc

Reviewed-by: iustinp

7a8f64da 10/21/2008 11:32 pm Oleksiy Mishchenko

Pass request headers in to RAPI handlers.

Reviewed-by: iustinp

86d9d3bb 10/21/2008 08:54 pm Iustin Pop

Move some LU logging to use proc.Log*

We change some messages which are obviously intended for the user to use
the proc.Log* functions instead of (only) the logging ones.

We also fix some wrong uses of feedback_fn.

Reviewed-by: imsnah

c0088fb9 10/21/2008 06:45 pm Iustin Pop

Improve the mcpu.Processor logging routines

As discussed previously, many of the routinges in cmdlib.py are using
logging functions as a carry-over from 1.2 (when these also showed the
message on stderr/to the user), instead of actually warning the user....

16653425 10/21/2008 04:02 pm Iustin Pop

Fix whitespace-at-EOL

Please configure your editors to strip it, or enable your git hooks...

Reviewed-by: ultrotter

02691904 10/20/2008 07:38 pm Alexander Schreiber

Set default hypervisor at cluster init

During cluster init, set the default hypervisor to be used for instances.
Ensure that the default hypervisor belongs to the set enabled hypervisors
for this cluster. Also fix a small bug with setting the default enabled...

99aabbed 10/20/2008 05:47 pm Iustin Pop

Convert the job queue rpcs to address-based

The two main multi-node job queue RPC calls (jobqueue_update,
jobqueue_rename) are converted to address-based calls, in order to speed
up queue changes. For this, we need to change the _nodes attribute on
the jobqueue to be a dict {name: ip}, instead of a set....

6b294c53 10/20/2008 05:47 pm Iustin Pop

Convert rpc.call_upload_file to use addresses

This patch allows rpc.call_upload_file to use addresses (if passed), and
also converts the ConfigWriter._DistributeConfig to pass them, since
this is an often-done operation.

Reviewed-by: imsnah

25348212 10/20/2008 05:47 pm Iustin Pop

Convert non-static rpc calls to use addresses

This patch converts all non-staticmethods rpc calls to pass addresses to
the Client calls.

This is done via two new small helpers. These functions also deal with
nodes that are not (yet) in the configuration file, and pass None for...

bdf7d8c0 10/20/2008 05:46 pm Iustin Pop

Add infrastructure for using addresses in rpc.py

The patch adds support for passing node addresses to NodeController
objects, which should speed up the connect sequence.

The patch also adds another very small optimization of computing the
content-length header value in the parent Client class instead of each...

3ef3c771 10/20/2008 05:46 pm Iustin Pop

Improve conformance with the style guide for rpc.py

This patch renames some internal function to camel case, for compliance
with the style guide.

It also fixes the module docstring (how old was that?).

Reviewed-by: imsnah

6fde8221 10/20/2008 04:44 pm Guido Trotter

Use constants.VALUE_AUTO for ip comparison too

Forward-port-of: r1889, Reviewed-by: imsnah

Reviewed-by: imsnah

bc89efc3 10/20/2008 04:44 pm Guido Trotter

LUCreateInstance: reuse mac address on import

When importing an instance with the same name as the exported one if the
mac address is "auto" we try to reuse the previous mac address. One can
still force generation of a new one with mac="generate".

Forward-port-of: r1887, Reviewed-by: iustinp...

c78995f0 10/20/2008 04:44 pm Guido Trotter

LUCreateInstance: accept mac = VALUE_GENERATE

VALUE_GENERATE is handled exactly the same as VALUE_AUTO and the mac
address is generated randomly.

Forward-port-of: r1886, Reviewed-by: iustinp

Reviewed-by: imsnah

4c566ede 10/20/2008 04:43 pm Guido Trotter

Add VALUE_AUTO and VALUE_GENERATE constants

'auto' is used in multiple place in the code with a meaning similar to
'default', 'generate' will be used to force generation of mac addresses
when the default would be to reuse an old one.

Forward-port-of: r1884, Reviewed-by: iustinp...

82d9caef 10/20/2008 03:50 pm Iustin Pop

Remove the logger.py module

Since now we use only one function from the logger module
(SetupLogging), we move it to utils.py (which is already imported by all
users of this function), and we remove the module.

Reviewed-by: imsnah

263ab7cf 10/20/2008 03:50 pm Iustin Pop

Convert http.py to use the logging module

Reviewed-by: imsnah

9a4f63d1 10/20/2008 03:50 pm Iustin Pop

Convert cmdlib.py to use the logging module

Note that many uses of logger.Error were used in 1.2 for their
side-effect of logging to stderr, where the user will see the messages,
and not for having the entry in the log. As such, we need to go over and
review every use of logging.* and decide if it should use feedback_fn...

b48909c8 10/20/2008 03:50 pm Iustin Pop

Convert hv_xen.py to use the logging module

Reviewed-by: imsnah

a5eb7789 10/20/2008 03:50 pm Iustin Pop

Convert mcpu.py to use the logging module

Reviewed-by: imsnah

23828f1c 10/20/2008 03:50 pm Iustin Pop

Convert ssh.py to use the logging module

Reviewed-by: imsnah

58b311ca 10/20/2008 03:49 pm Iustin Pop

Convert rpc.py to use the logging module

Reviewed-by: imsnah

46fbdd04 10/20/2008 03:33 pm Iustin Pop

Convert cli.py to logging

We also add two function for printing messages, so that scripts won't
have to import logger to get these. They are a simple extension over the
logger ones, as they accept the call style from logging:
ToStdout("Message: %s", msg)...

61be6ba4 10/20/2008 03:16 pm Iustin Pop

Fix gnt-instance modify with beparams

The gnt-instance modify didn't work correctly w.r.t the be parameters.
There was also a typo in the corresponding LU.

Reviewed-by: imsnah

fa10bdc5 10/20/2008 02:04 pm Michael Hanselmann

Remove old HTTP server code

All users of this code have been migrated to the new and shiny HttpServer
class.

It also fixes a typo in the ApacheLogfile unittests. It has not yet been
decided whether we should keep ApacheLogfile or not, hence leaving it in....

4342e89b 10/20/2008 01:47 pm Alexander Schreiber

Remove --hypervisor-type from gnt-cluster.

We no longer use a single, cluster-wide hypervisor, but configure the
actual to be used hypervisor on the instance level.

Reviewed-by: imsnah

ea3a925f 10/19/2008 01:27 am Alexander Schreiber

Fix gnt-cluster init to set cluster defaults.

Reviewed-by: iustinp

7888a614 10/19/2008 01:26 am Alexander Schreiber

Add constants for cluster defaults

Reviewed-by: iustinp

d15a9ad3 10/17/2008 05:37 pm Guido Trotter

Cleanup os_add/rename rpc for OS API 10

- remove now unused osdev and swapdev arguments from backend, noded,
rpc, cmdlib
- convert docstrings to epydoc

Reviewed-by: iustinp

d324e3fc 10/17/2008 05:36 pm Guido Trotter

Temporarily explicitely break import/export

Since they're not converted to API 10 yet, we temporarily disable the
import/export functions.

Reviewed-by: iustinp

58f6e5ca 10/17/2008 05:36 pm Guido Trotter

AddOSToInstance: convert to api10

Reviewed-by: iustinp

ff38b6c0 10/17/2008 05:36 pm Guido Trotter

RunRenameInstance: convert to api10

Reviewed-by: iustinp

2266edb2 10/17/2008 05:36 pm Guido Trotter

Add new OSEnvironment function

This function calculates the basic environment for OS scripts in API
version 10.

Reviewed-by: iustinp

4dd69592 10/17/2008 05:35 pm Guido Trotter

Bump up the OS API version

Reviewed-by: iustinp

62dbbe7e 10/17/2008 05:35 pm Guido Trotter

OSFromDisk: use script names from constants

Reviewed-by: iustinp

8ee4dc80 10/17/2008 05:35 pm Guido Trotter

Change OSFromDisk's docstring to epydoc

Plus update it with the real variable name

Reviewed-by: iustinp

464736ae 10/17/2008 05:35 pm Guido Trotter

Add LDS_BLOCK for block device backed dev types

Reviewed-by: iustinp

ded1c679 10/17/2008 05:35 pm Guido Trotter

Create constants to replace os scripts names

Reviewed-by: iustinp

713faea6 10/17/2008 04:06 pm Oleksiy Mishchenko

ETag passing support.

Reviewed-by: imsnah

a570e2a8 10/17/2008 02:08 pm Guido Trotter

Mainloop: handle sigterm

This fixes removals of the pid files and clean exit in the init script

Reviewed-by: iustinp

07fc5289 10/17/2008 02:07 pm Guido Trotter

Mainloop: init sigchld_handler as None

There is no point in initializing sigchld_handler as an empty dict, when
it will be overwritten by an instance of utils.SignalHandler
immediately after.

Reviewed-by: iustinp

779c15bb 10/16/2008 11:39 pm Iustin Pop

Enable gnt-cluster modify to hv/beparams

This patch enables the cluster modify to change:
- enabled hypervisor list
- hvparams (per hypervisor)
- beparams (only the default group)

Syntax:
gnt-cluster modify -B vcpus=3 -H xen-pvm:no_initrd_path

Validation for parameters is somewhat missing - the individual...

16a8967d 10/16/2008 07:54 pm Michael Hanselmann

rapi: Convert to new HTTP server class

Requests are no longer logged to a separate file.

Reviewed-by: amishchenko

469f88e1 10/16/2008 07:26 pm Iustin Pop

Show the cluster parametrs in gnt-cluster info

This is just a raw update without any special formatting.

Reviewed-by: imsnah

2f7635f4 10/16/2008 05:40 pm Oleksiy Mishchenko

RAPI: Instance add/delete implementation.

Reviewed-by: iustinp

94ed59a5 10/16/2008 03:08 pm Iustin Pop

Fix job queue behaviour when loading jobs

Currently, if loading a job fails, the job queue code raises an
exception and prevents the proper processing of the jobs in the queue.
We change this so that unparseable jobs are instead archived (if not
already)....

d5927e48 10/16/2008 02:36 pm Iustin Pop

Prevent master failover if we have wrong data

If we don't actually know the current master (as determined via voting),
we prevent the failover.

The patch also changes some messages (capitalization, typos).

Reviewed-by: ultrotter

d7cdb55d 10/16/2008 02:36 pm Iustin Pop

Improvements to the master startup checks

In order to account for future improvements to master failover, we move
the actual data gathering capabilities from ganeti-masterd into
bootstrap.py, and we leave only the verification into masterd.

The verification procedure is then changed to retry multiple times (up...

3ccafd0e 10/16/2008 11:37 am Iustin Pop

Add an interface for the drain flag changes/query

This adds the set/reset in the jqueue and luxi modules, and a way to
query it in OpQueryConfigValues, and also the comand line interface for
it:
$ gnt-cluster queue info
The drain flag is unset
$ gnt-cluster queue drain...

5d672980 10/15/2008 04:13 pm Iustin Pop

Add a rpc call for changing the drain flag

A new multi-node call is added that sets/resets the drain flag.

Reviewed-by: imsnah

686d7433 10/15/2008 01:52 pm Iustin Pop

Implement the job queue drain flag

We add a (per-node) queue drain flag that blocks new job submission.
There is not yet an interface to add/remove the flag (will come in next
patches).

Reviewed-by: imsnah

6797ec29 10/15/2008 01:51 pm Iustin Pop

Implement transport of ganeti errors across luxi

This patch adds a generic method to identify the ganeti error given its
class name, and implements this across the luxi protocol.

Reviewed-by: imsnah

d11bda8d 10/15/2008 01:51 pm Iustin Pop

Change the JobQueueError parent class

Currently this is not derived from GenericError, but there's no reason
for it to be so.

Reviewed-by: imsnah

966405b7 10/15/2008 01:13 pm Michael Hanselmann

rapi: Don't throw class as an exception

Reviewed-by: ultrotter

a2f92677 10/15/2008 11:22 am Michael Hanselmann

rapi: Whitespace fixes

Reviewed-by: ultrotter