Statistics
| Branch: | Tag: | Revision:

root / lib @ 711b5124

# Date Author Comment
711b5124 11/26/2008 06:16 pm Michael Hanselmann

jqueue: Log progress and load jobs one by one

By logging more information, a user can see how far it is in inspecting
the queue. This can be useful with a large number of jobs. Also, instead
of loading all jobs in one go, load only the list of job IDs and then...

16714921 11/26/2008 06:15 pm Michael Hanselmann

jqueue: Shutdown workerpool in case of a problem

Reviewed-by: ultrotter

21f04e5e 11/26/2008 01:25 pm Oleksiy Mishchenko

RAPI: Make calls safier

Reviewed-by: imsnah

160e2921 11/26/2008 03:23 am Iustin Pop

Reduce duplication of work in rpc.Client

This patch removes the duplicate serialization and calls to
utils.GetNodeDaemonPort in rpc.Client, and instead moves them to calling
functions (the _*NodeCall ones recently introduced).

Reviewed-by: ultrotter

227647ac 11/25/2008 07:11 pm Guido Trotter

Move the MASTER_SOCKET to SOCKET_DIR

Before it was in the abstract linux namespace, where unfortunately we
couldn't easily check from python the credentials of the connecting
clients. Now we also have to remove the file on exit and when starting.

Reviewed-by: imsnah

5ecb7e48 11/25/2008 07:10 pm Guido Trotter

Add SOCKET_DIR_MODE constant

We want the socket dir to have a restricted permission.

Reviewed-by: imsnah

b4442fd9 11/25/2008 07:10 pm Guido Trotter

Add SOCKET_DIR constant

This new directory under /var/run will be used for file based unix
sockets.

Reviewed-by: imsnah

24991749 11/25/2008 02:57 pm Iustin Pop

Implement support for multi devices changes

This big patch adds support for:
- changing NIC/disks in the multi-device model
- adding/removing NICs
- adding/removing disks

The patch is big and not very nice; the error checking paths are not
very clear....

4be4691d 11/25/2008 02:57 pm Iustin Pop

Slight change to the LU initialization code

This patch adds support for a separate LU.CheckArguments() method which
should do syntactic checks without holding locks and without polluting
the ExpandNames which is a lock-related function. See for example the...

b637ae4d 11/25/2008 02:51 pm Iustin Pop

Fix a bug in LUSetInstanceParams

The wrong names were reused in a copy-paste.

Reviewed-by: imsnah

b6fdf8b8 11/25/2008 02:50 pm Iustin Pop

Show disk access mode in gnt-instance info

The mode parameter needs to be exported and shown in the info output.

Reviewed-by: imsnah

e2a65344 11/25/2008 02:50 pm Iustin Pop

Change _GenerateDiskTemplate iv_name generation

Currently the _GenerateDiskTemplate assumes it does initial creation of
disks (i.e. it starts with index 0).

For dynamic disk adds, we need to pass an additional offset. This patch
adds this offset and modifies its sole current caller....

03d1dba2 11/25/2008 02:37 pm Michael Hanselmann

Pass ssconf values from master to node

Instead of parsing the configuration on the node, we pass the ssconf
values from the master.

Reviewed-by: iustinp

65c6b8e0 11/25/2008 01:18 pm Michael Hanselmann

ganeti.http: Don't reuse key and cert objects

Reusing the private key and certificate objects gave us problems. This
patch changes the code to only cache the PEM data, but the objects
themselves. For every socket, the private key and certificate objects
are created again....

d9a855f1 11/24/2008 05:39 pm Michael Hanselmann

Fix unittests broken by rev 2015

Ssconf files shouldn't be updated when running unittests.

Reviewed-by: ultrotter

d57ae7f7 11/24/2008 03:38 pm Michael Hanselmann

ganeti.rpc: Read SSL certificate and key only once per request

There's no need to read the SSL certificate and key for every node
in a request. Also add a TODO for better error reporting.

Reviewed-by: amishchenko

8dca23a3 11/24/2008 01:01 pm Iustin Pop

Documentation updates for mcpu.py

This is the only change needed to make mcpu epydoc-compliant.

Reviewed-by: ultrotter

b4364a6b 11/24/2008 11:48 am Guido Trotter

LUCreateInstance: Fix import mac AUTO mode

Previously on import LUCreateInstance used to recycle the mac if the instance
name was the same than the one used at export time. Now we do the same, but
apply the setting separately for each nic.

Reviewed-by: iustinp

e36e96b4 11/24/2008 11:47 am Guido Trotter

LUCreateInstance unlock all nodes mid-way

When creating a new instance, after saving the instance data to the config file
and creating the disks, but before waiting for sync and installing the OS, we
release the node locks, to allow for more instance creations to proceed in...

18640d69 11/24/2008 11:47 am Guido Trotter

IAllocator: subtract down instances from free mem

Currently free_memory just reports the amount of free ram, as seen by the
hypervisor. We adjust this amount by subtracting the memory for any instance
which is down, and the difference for any instance which is configured to have...

955db481 11/24/2008 11:46 am Guido Trotter

Correct GetAllInstancesInfo rtype

GetAllInstancesInfo, in the backend, returns just a dict, not a dict of dicts.

Reviewed-by: iustinp

8cc7e742 11/24/2008 11:46 am Guido Trotter

IAllocator: use the right hypervisor

Since the hypervisor is instance dependent we'll get one on instance creation,
and use the one in the instance config on relocation.

Reviewed-by: iustinp

b57e9819 11/24/2008 11:46 am Guido Trotter

IAllocator: fill i_list in a more proper way

- reuse the previously called cluster_info, rather than calling it again
- get all the instances from the config atomically, to prevent race conditions
- use a list comprehension, for simplicity

Reviewed-by: iustinp

90a7547a 11/24/2008 11:45 am Guido Trotter

Parallelize instance operations on the same node

With static minors we don't have a race condition anymore when
starting/stopping/rebooting/reinstalling more than one instance on the same
node, so we'll drop node locking altogether.

Reviewed-by: iustinp

dafc7302 11/24/2008 11:44 am Guido Trotter

Convert iallocator to the new _ComputeDiskSize

_ComputeDiskSize's API was changed for multidisk support in r2010, but
iallocator's call to it were not fixed. Converting them now.

Reviewed-by: iustinp

e4376078 11/23/2008 05:35 pm Iustin Pop

Documentation updates for cmdlib.py

This makes cmdlib.py not throw epydoc errors anymore.

Reviewed-by: ultrotter

0779e3aa 11/23/2008 05:35 pm Iustin Pop

Only update ssconf on cluster serial change

There is no need to update ssconf if the cluster serial number has not
changed.

Reviewed-by: ultrotter

9fbfbb7b 11/23/2008 05:34 pm Iustin Pop

Enable auto-unit formatting in script output

This patch enables by default the old 'human-readable' option, but in a
slightly different model.

The option is now called "units" and takes either:
- 'h' for automatic formatting
- 'm', 'g' or 't' for mebi/gibi/tebibytes...

c7f5f338 11/21/2008 05:55 pm Oleksiy Mishchenko

RAPI: Cancel a job

Reviewed-by: imsnah

00430f8e 11/21/2008 05:36 pm Iustin Pop

Make cli.py use FieldSet for matching fields

This changes cli.py to FieldSet usage so that gnt-instance list will
format nicely the disk.size/*, and the count of disks/nics.

Reviewed-by: ultrotter

a2d2e1a7 11/21/2008 05:35 pm Iustin Pop

Move FieldSet class to utils.py

Since we can use the FieldSet class in cli.py to nicely format disk
sizes and such, we move it to utils.py and also move its associated
unittest. I didn't remove the cmdlib.py unittest file as that's not the
good direction :)...

3e0cea06 11/21/2008 05:35 pm Iustin Pop

Change disk index validation to FindDisk

This patch replaces the hand validation of the disk index with the
instance.FindDisk method (actually reverting to previous method, before
the multi-disk, but now with indexes).

Reviewed-by: ultrotter

ad24e046 11/21/2008 05:34 pm Iustin Pop

Change GrowDisk to work with multi-disk

This patch changes the instance.FindDisk method to take index arguments
(instead of iv_names), and changes GrowDisk and list instances
accordingly.

Reviewed-by: ultrotter

eafd8762 11/21/2008 12:47 pm Michael Hanselmann

Use SSL for master/node RPC

This patch enables SSL between masterd and noded.

Reviewed-by: iustinp

ec17d09c 11/21/2008 12:46 pm Michael Hanselmann

Get rid of node daemon password

With the new SSL client certificate stuff it's no longer needed.

Reviewed-by: iustinp

f20cbea2 11/21/2008 12:46 pm Michael Hanselmann

ganeti.http: Add another class to contain SSL key and certificate

Otherwise we would read them for every request the HTTP client
makes against a server and this is not needed.

Reviewed-by: iustinp

4331f6cd 11/21/2008 12:45 pm Michael Hanselmann

Reuse HTTP client pool for RPC

ganeti-masterd: Add initialization and shutdown of RPC pool. It needs
to be shutdown before forking.

ganeti.cli: Add decorator function to initialize and shutdown RPC pool.

ganeti.rpc: Add functions to initialize and shutdown RPC pool. Throw...

54d1a06e 11/21/2008 12:42 pm Michael Hanselmann

Write ssconf files when updating configuration

Reviewed-by: ultrotter

6ddc95ec 11/21/2008 12:42 pm Michael Hanselmann

Add RPC call to update ssconf files

Reviewed-by: iustinp

d418ebfb 11/21/2008 08:22 am Iustin Pop

Change replace secondary to work with multi-disk

Also fix an error in the CheckPrereq.

Reviewed-by: imsnah

0c223ea9 11/20/2008 02:50 pm Michael Hanselmann

ganeti.ssconf: Add function to write ssconf files

This function will be used to write ssconf files from the node daemon.
By creating a lock file, we synchronize different child processes of
ganeti-noded to not overwrite each other's changes. Also, external...

54155f52 11/20/2008 08:22 am Iustin Pop

Convert replace-disks (same nodes) to multi-disk

This patch changes the drbd8 replace disk only (no secondary change) to
work in with multi-disk. This mode of replaces works correctly with
replacing only a subset of disks.

Reviewed-by: imsnah

08db7c5c 11/20/2008 08:22 am Iustin Pop

Initial multi-disk/multi-nic support

This patch adds support for mult-disk/multi-nic in:
- instance add
- burnin

The start/stop/failover/cluster verify work as expected. Replace disk
and grow disk are TODO.

There's also a change gnt-job to allow dictionaries to be listed in...

41a776da 11/20/2008 08:19 am Iustin Pop

Add more disk/nic listing options in gnt-instance

This adds some more listing cases (useful for scripting/rapi):
- disk.sizes for a list of all sizes
- nic.(ips|macs|bridges)

Reviewed-by: imsnah

2864f2d9 11/20/2008 08:18 am Iustin Pop

Change Xen hypervisor to not use iv_name

Currently the iv_name is very linux-specific, and will break with the
multi-disk changes.

The patch changes this to generate sdX names based on the disk index in
the disks structure, instead of relying on the iv_name....

9a525d83 11/19/2008 03:18 pm Michael Hanselmann

ganeti.rpc: Use central functions for actual RPC calls

Before we had lots, lots and lots of code duplication. This patch
changes the code to use four central functions.

Reviewed-by: iustinp

33bbdbec 11/19/2008 03:18 pm Michael Hanselmann

Make HttpClientManager threadsafe

This allows a single HttpClientManager to be used from more than one
thread at the same time. We discussed having one HttpClientManager
per job queue thread. Assuming there should be one HTTP thread per
node, this would mean quadratic growth with the number of nodes. By...

7c46aafd 11/19/2008 02:59 pm Oleksiy Mishchenko

HTTP server: Do not decode empty entity body

Reviewed-by: imsnah

d50b3059 11/19/2008 01:09 pm Oleksiy Mishchenko

RAPI: Instance modify.

Split parameters filter to the separate function and reuse it in instance creation.

71c1af58 11/18/2008 12:06 pm Iustin Pop

Allow querying of variable number of parameters

This patch adds support for querying in gnt-instance list of:
- disk.count
- nic.count
- disk.size/$N
- nic.(ip|mac|bridge)/$N

The patch also disables the exception raised when the header description...

31bf511f 11/18/2008 12:04 pm Iustin Pop

Convert cmdlib.py to _FieldSet

This patch converts the current usage of _CheckOutputFields to the
FieldSet class, but it doesn't start to use its variable matching
features.

Reviewed-by: ultrotter

6de7c41d 11/18/2008 12:00 pm Iustin Pop

Add a FieldSet class for variable parameter sets

This patch adds a _FieldSet class that can be used for the new variable
parameter sets: e.g. the sda_size will change to disk/0.size (or
similar) and we need to both check validity and extract the index of the...

0c55c24b 11/14/2008 06:59 pm Oleksiy Mishchenko

RAPI: Instance startup/shutdown resources

Reviewed-by: imsnah

2276aa29 11/14/2008 12:34 pm Oleksiy Mishchenko

RAPI: Implement an instance reboot

Reviewed-by: imsnah

8049a1d7 11/12/2008 02:52 pm Michael Hanselmann

Use utils.ReadFile to read SSL certificate

Reviewed-by: iustinp

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