Statistics
| Branch: | Tag: | Revision:

root / lib @ c5cc3403

# Date Author Comment
c5cc3403 04/02/2008 12:53 pm Guido Trotter

Locking: fix one indentation error (codestyle)

Reviewed-by: imsnah

4e07ec8c 04/02/2008 12:52 pm Guido Trotter

Locking: fix superlong lines (codestyle)

Reviewed-by: imsnah

1d544ba3 04/01/2008 07:52 pm Michael Hanselmann

Check whether path is valid before accessing it

Reviewed-by: ultrotter

ceab32dd 04/01/2008 04:05 pm Iustin Pop

Add submit function to lib/cli.py

This patch adds function that submit jobs or queries over the unix socket
interface to lib/cli.py. The will be used by the scripts instead of the
SubmitOpCode function.

Reviewed-by: ultrotter

498ae1cc 04/01/2008 04:04 pm Iustin Pop

A dumb queue implementation

This patch adds a very dumb in-memory only queue implementation.

Reviewed-by: imsnah

c2a03789 04/01/2008 10:15 am Iustin Pop

Initial implementation of the client unix socket

This patch adds an initial implementation of the client-side of the unix
socket interface. The code is not yet used by other parts of ganeti.

Reviewed-by: imsnah

5f83e263 03/31/2008 05:39 pm Iustin Pop

Change the 'gnt-cluster command' execution order

This patch makes the command execute last on the master (if the master
is selected). The order for the other nodes is unchanged.

The patch also updates the man page with some explanations and an
example.
...

7767bbf5 03/31/2008 03:04 pm Manuel Franceschini

parms->params Refactoring

- Substitute all occurences of name 'parms' with 'params'
- Small codestyle fix

Reviewed-by: ultrotter

0cc05d44 03/31/2008 02:00 pm Manuel Franceschini

Map OpSetClusterParams to correponding LU

Reviewed-by: iustinp

12515db7 03/31/2008 02:00 pm Manuel Franceschini

Add OpSetClusterParams to opcodes

Reviewed-by: iustinp

efa14262 03/31/2008 01:59 pm Manuel Franceschini

Skip HasValidVG when --no-lvm-storage on cluster init

This patch does two things:
- Remove "vg_name" from _OP_REQP due to the introduction of
--no-lvm-storage. Since vg_name option has as default now None and is
only set to the DEFAULT_VG if lvm_storage is enabled, this is needed...

8084f9f6 03/31/2008 01:59 pm Manuel Franceschini

Add LUSetClusterParams to cmdlib

Add LUSetClusterParams, which is the LU to modify cluster options.
This includes checks:
- not to disable lvm storage when it's already disabled
- not to enable lvm storage when it is already enabled
- not to disable lvm when lvm-based instances are present...

89ff8e15 03/31/2008 01:58 pm Manuel Franceschini

Add method SetVGName() to config.py

Reviewed-by: iustinp

eedc99de 03/31/2008 01:57 pm Manuel Franceschini

Add lvm-storage check when creating instances

This adds a check to fail instance creation if lvm-storage is disabled
(cluster-wide). If lvm-storage is disabled (by initializing the cluster
with --no-lvm-storage) only instances with disk template in frozenset...

d63e148a 03/31/2008 01:57 pm Manuel Franceschini

Add DEFAULT_VG and DTS_NOT_LVM to constants.py

DTS_NOT_LVM:
This constant is needed when checking if an instance can be created with
the given disk template if no lvm-storage is available, i.e. the ganeti
cluster does not have a volume group

DEFAULT_VG:...

fe482621 03/30/2008 05:54 pm Iustin Pop

Change the order of config updates in some LUs

In the start and stop instance LUs, the configuration update is done
right at the end. This means that if, for example, the instance shutdown
succeeds, but the drive deactivation fails, the next run of the watcher...

0a80a26f 03/27/2008 04:39 pm Michael Hanselmann

Return first parameter of console command only once

Reviewed-by: iustinp

3f752d97 03/25/2008 07:48 pm Manuel Franceschini

Modify Disk.GetNodes() to support LD_FILE

Reviewed-by: iustinp

04fa07f2 03/25/2008 07:48 pm Manuel Franceschini

Add constants for file-based storage

Reviewed-by: iustinp

f9193417 03/25/2008 06:30 pm Iustin Pop

Remove the option to create md/drbd7 instances

This patch removes the options that allow to create local_raid1 or
remote_raid1 instances. It also modifies the documentation and removes
these disk templates from burnin and from qa.

Reviewed-by: imsnah

249069a1 03/25/2008 06:30 pm Iustin Pop

Remove the add/remove mirror operations

These two operations are related to md/drbd7 code (remote_raid1). Remove
them as part of the md/drbd7 removal.

Reviewed-by: imsnah

2872a949 03/20/2008 05:55 pm Manuel Franceschini

Modify cluster-init to create file-storage-dir

This patch adds three things:
- it normalizes the file storage directory path passed to gnt-cluster init
- if the file-storage-path doesn't exist on the master node, ganeti
tries to create it
- adds additional check if the passed file-storage-dir is not a directory...

39e9e213 03/20/2008 12:51 pm Iustin Pop

Remove some deprecated code in bdev.py

The BlockDev.GetStatus() method and some associated constants were never
used in the rest of the code. This patch removes them.

Reviewed-by: imsnah

df458e0b 03/19/2008 06:55 pm Iustin Pop

Change the opcode hierarchy and implementation

This patch adds a new top-level class (BaseJO) that is used for both
opcodes and a new Job class.

This new class and the related changes to the OpCode abstract class are
used to implement simple to-dict/from-dict transformations, so that we...

871705db 03/19/2008 12:47 pm Manuel Franceschini

Add support for file_storage_dir to LUInitCluster

Author: manuel.franceschini
Reviewed-by: iustinp

1322c697 03/19/2008 12:46 pm Manuel Franceschini

Add file_storage_dir to opcodes.OpInitCluster

Author: manuel.franceschini
Reviewed-by: iustinp

17dfc522 03/19/2008 12:46 pm Manuel Franceschini

Add SS_FILE_STORAGE_DIR to ssconf

Author: manuel.franceschini
Reviewed-by: iustinp

1abbbbe2 03/19/2008 12:45 pm Manuel Franceschini

Add DEFAULT_FILE_STORAGE_DIR to constants

Author: manuel.franceschini
Reviewed-by: iustinp

43eb889f 03/19/2008 12:45 pm Manuel Franceschini

Add FILE_STORAGE_DIR to be in lib/_autoconf.py

Author: manuel.franceschini
Reviewed-by: iustinp

fff33d70 03/18/2008 03:04 pm Michael Hanselmann

Use constants for “ssh” and “scp” binaries instead of magic values

Reviewed-by: ultrotter

f408b346 03/18/2008 03:04 pm Michael Hanselmann

Use new ssh.WriteKnownHostsFile function

This replaces very old code.

Reviewed-by: ultrotter

1ff08570 03/18/2008 03:03 pm Michael Hanselmann

Use new cluster alias in known_hosts file

Reviewed-by: ultrotter

b047857b 03/18/2008 03:03 pm Michael Hanselmann

Use new “tty” parameter on SshRunner.BuildCmd for “gnt-instance console”

Reviewed-by: ultrotter

8f07f831 03/18/2008 03:03 pm Michael Hanselmann

Add “tty” parameter to SshRunner.BuildCmd

This allows callers to allocate a pseudo-TTY easily.

Reviewed-by: ultrotter

bf3d57b8 03/18/2008 03:03 pm Michael Hanselmann

Order SSH options alphabetically

Reviewed-by: ultrotter

c92b310a 03/18/2008 03:02 pm Michael Hanselmann

Move SSH functions into a class

This renames some functions and does some minor codestyle cleanup.

Reviewed-by: ultrotter

75a5f456 03/18/2008 03:02 pm Michael Hanselmann

Add function to write cluster SSH key to known_hosts file

The whole Ganeti cluster has a single SSH key. Its fingerprint is
written to Ganeti's known_hosts file, together with an alias. This
allows us to always use that alias instead of the real hostname,...

21a6c826 03/18/2008 12:09 pm Guido Trotter

Locking: remove an empty space at End Of Line

Reviewed-by: imsnah

4d686df8 03/18/2008 12:08 pm Guido Trotter

Increase SharedLock fairness

Previously if a shared thread was notified, together with the rest, and was not
fast enough in waking up and acquiring the lock, another one could release it,
decide there were no more sharers, and let an exclusive one in instead. With...

411f8ad0 03/11/2008 09:44 am Iustin Pop

Disable cluster init with a reachable IP

Make the cluster init fail if the IP to which the cluster name resolved
is already reachable by the master node. This is not a foolproof
solution, but it allows a cheap method of detecting simple mistakes.

It will also disallow using the master node name as cluster name (which...

b15d625f 03/11/2008 09:44 am Iustin Pop

Modify utils.TcpPing to make source address optional

This patch modifies TcpPing and its callers to make the source address
selection optional. Usually, the kernel will know better what
source address to use, just in some cases we want to enforce a given...

41a57aab 03/05/2008 06:48 pm Michael Hanselmann

Replace custom file writing code with utils.WriteFile

Reviewed-by: ultrotter

7c0d6283 03/05/2008 04:39 pm Michael Hanselmann

Codestyle fixes: adding a few empty lines

Reviewed-by: ultrotter

b2dabfd6 03/04/2008 07:12 pm Guido Trotter

LockSet: handle empty case

A LockSet is mostly useful when it has some locks in it. On the other hand
there are cases in which it must function even when empty. For example if a
cluster has no instances in it there's no reason why locking all of them
shouldn't work anyway. This patch adds test code for that situation and...

ea3f80bf 03/04/2008 07:12 pm Guido Trotter

LockSet: collapse two try/except into one

Reviewed-by: imsnah

9a39f854 03/04/2008 07:11 pm Guido Trotter

SharedLock: remove wrong assertion in code

r644 contained some cleanup code for LockSet. Among other things it removed a
syntax error that allowed an assertion that previously wan't really checked to
trigger. It turns out that even though the spirit of that assertion was correct...

cdb08f44 03/04/2008 04:46 pm Michael Hanselmann

Codestyle updates for locking code

Reviewed-by: ultrotter

3b7ed473 03/04/2008 03:18 pm Guido Trotter

LockSet: make acquire() able to get the whole set

This new functionality makes it possible to acquire a whole set, by passing
"None" to the acquire() function as the list of elements. This will avoid new
additions to the set, and then acquire all the current elements. The list of...

806e20fd 03/04/2008 03:18 pm Guido Trotter

LockSet: encapsulate acquire() in try-except

This patch adds a try/except area around most of the acquire() code (everything
after the intial condition checks). Since the except: clause contains just a
'raise' nothing really changes except the indentation of the code....

0cf257c5 03/04/2008 03:17 pm Guido Trotter

Make LockSet.__names() return a list, not a set

Previously the private version of the __names function returned directly a set.
We'll keep this in the public interface but change the private version to a
list in order to be able to sort() its result and then loop on it, even though...

3f404fc5 03/04/2008 03:17 pm Guido Trotter

LockSet: improve remove() api

Lockset's remove() function used to return a list of locks we failed to remove.
Rather than doing this we'll return a list of removed locks, so it's more
similar to how acquire() behaves. This patch also fixes the relevant unit tests....

0cc00929 03/04/2008 03:17 pm Guido Trotter

LockSet: make acquire() return the set of names

In a LockSet acquire() returned True on success. This code changes that to
return a set containing the names of the elements acquired. This is still a
true value if we acquired any lock but is slightly more useful (because if...

8b68f394 03/04/2008 03:16 pm Guido Trotter

LockSet: invert try/for nesting in acquire()

This patch changes nothing to the functionality of a LockSet. Rather than
trying to do the whole for loop we try each of its steps. This opens the way to
handle differently a single failure.

Reviewed-by: imsnah

7ee7c0c7 03/04/2008 12:09 pm Guido Trotter

Initial GanetiLockManager implementation

Includes some locking-related constants and explanations on how the
LockManager should be used, the class itself and its test cases.

The class includes:
- a basic constructor
- functions to acquire and release lists of locks at the same level...

c9064964 02/29/2008 06:32 pm Iustin Pop

Fix master role stop on cluster destroy

Currently the cluster destroy doesn't remove the master role, which
means that the IP address of the cluster remains assigned to the master
node.

This patch fixes this and also a docstring in backend.StopMaster()....

488b540d 02/29/2008 02:32 pm Iustin Pop

Fix cluster rename operation

This one-liner fixes the cluster rename operation. As a side note, we
should have a QA test for this too.

Reviewed-by: imsnah

e6c200d6 02/28/2008 08:53 pm Guido Trotter

LockSet: make acquire() fail faster on wrong locks

This patch makes acquire() first look up all the locks in the dict and then try
to acquire them later. The advantage is that if a lockname is already wrong
since the beginning we won't need to first queue and acquire other locks to...

aaae9bc0 02/28/2008 05:06 pm Guido Trotter

LockSet implementation and unit tests

A LockSet represents locking for a set of resources of the same type. A thread
can acquire multiple resources at the same time, and release some or all of
them, but cannot acquire more resources incrementally at different times...

7bde3275 02/28/2008 01:20 pm Guido Trotter

Don't allow renaming to an existing instance

Even if the target instance is down or we are not checking for IP conflicts
changing an instance name to a new one which is already in the cluster is
doomed to fail, because in a lot of places (among which figures the mind of...

107711b0 02/27/2008 03:05 pm Michael Hanselmann

Use constants.ETC_HOSTS instead of string for /etc/hosts

Reviewed-by: iustinp

7324ad4c 02/27/2008 02:22 pm Michael Hanselmann

Distribute lib/locking.py

Reviewed-by: ultrotter

3517d9b9 02/25/2008 11:17 am Manuel Franceschini

This patch replaces some hardcoded strings with their corresponding constant in `_GenerateDiskTemplate()`.

Reviewed-by: iustinp

6c8af3d0 02/22/2008 06:12 pm Manuel Franceschini

Small comment fix.

c99a3cc0 02/22/2008 06:12 pm Manuel Franceschini

Fixes small spell mistakes and comments

81010134 02/22/2008 02:39 pm Iustin Pop

Break trunk by removing twisted

This patch switches from the twisted usage for inter-node protocol to
simple BaseHTTPServer/httplib. The patch has more deletions because we
use no authentication, no encryption at all.

As such, this is just for trunk, and only for testing. What it brings is...

a95fd5d7 02/19/2008 03:50 pm Guido Trotter

Add the delete() operation to SharedLock

This new operation lets a lock be cleanly deleted. The lock will be exclusively
held before deletion, and after it pending and future acquires will raise an
exception. Other SharedLock operations are modify to deal with delete() and to...

d6646186 02/18/2008 06:58 pm Guido Trotter

Fix a couple of SharedLock docstrings

Use the actual class name rather than a spaced version of it.

Reviewed-by: iustinp

515207af 02/16/2008 03:06 pm Guido Trotter

Fix gnt-instance info i1 i2 ...

Due to an indentation error only the last instance queried got returned by
LUQueryInstanceData. Moving the append() call inside the for cycle to fix this
issue.

This is a one-liner targeted at 1.2.3

Reviewed-by: iustinp

ef756965 02/15/2008 11:53 am Iustin Pop

Further fixes for the 'export MAC in hooks' change

QA suite which tests gnt-instance modify has uncovered another issue related to
mac export.

Reviewed-by: imsnah

40a03283 02/14/2008 05:54 pm Iustin Pop

Alter the device activation code

This tiny patch fixes the breakage that the previous patch about
activation did by removing the Close() call after activation.

The initial reason for that call was that if the device is already
active and open, but we need it closed, we close it automatically....

d8052456 02/14/2008 05:53 pm Iustin Pop

Modify the default output of gnt-instance list

This patch adds a new field available for selection in gnt-instance list
names "status" which represents the combined value of "admin_state" and
"oper_state". Since this is much easier to parse (e.g. gnt-instance list...

c3f9340c 02/12/2008 07:06 pm Guido Trotter

Parse double protocol version in drbd8.2

DRBD 8.2 uses a double integer field ad protocol version, rather than a single
one. This patch fixes the ganeti parsing code, allowing both the old and the
new version type. In order to do so the internal _GetVersion function is...

eeb3a5f9 02/10/2008 02:10 pm Iustin Pop

Fix a wrong OP_ID added in r261

Reviewed-by: ultrotter

162c1c1f 02/08/2008 01:23 pm Guido Trotter

Shared Lock implementation and unit tests.

Adding a locking.py file for the ganeti locking library. Its first component is
the implementation of a non-recursive blocking shared lock complete with a
testing library.

Reviewed-by: imsnah, iustinp

06009e27 02/05/2008 04:12 pm Iustin Pop

Add a test opcode that sleeps for a given duration

This can be used for testing purposes.

Reviewed-by: ultrotter,imsnah

fdbd668d 02/05/2008 03:33 pm Iustin Pop

Reduce the chance of DRBD errors with stale primaries

This patch is a first step in reducing the chance of causing DRBD
activation failures when the primary node has not-perfect data.

This issue is more seen with DRBD8, which has an 'outdate' state (in
which it can get more often). But it can (and before this patch, usually...

b08d5a87 02/04/2008 04:33 pm Iustin Pop

Fix some indendation issues

Reviewed-by: imsnah

c7b27e9e 02/04/2008 04:28 pm Iustin Pop

Fix incomplete mac address export to hooks

This patch completes the change introduced in r566 (trunk) and r568
(branch-1.2).

Reviewed-by: imsnah

53e4e875 01/31/2008 03:22 pm Guido Trotter

Give mac information to instance hooks

Currently just the bridge and ip address are passed. Add an environment
variable for the mac address.

Reviewed-by: iustinp

cdeef2ca 01/31/2008 02:38 pm Alexander Schreiber

Make the mouse more usable in VNC for HVM.

Reviewed-by: imsnah

1cafd236 01/30/2008 01:14 pm Guido Trotter

Export bridge information too

gnt-backup export used to export the ip and mac of each nic, but not which
bridge it was connected to. Adding this information.

Reviewed-by: iustinp

d8a4b51d 01/28/2008 04:32 pm Iustin Pop

Improve the documentation of query output fields

The gnt-node and gnt-instance list commands have a customizable list of
output fields, but the list is not up to date (in the man page) and not
easily understandable from the ‘--help’ output.

This patch updates the man pages and adds the available fields and...

d6d415e8 01/28/2008 01:51 pm Iustin Pop

Add option for the number of VCPUs in instance listing

Reviewed-by: ultrotter

2bc22872 01/28/2008 11:03 am Iustin Pop

Fix "gnt-instance modify --initrd"

The new QA tests for instance modify uncovered a bug in the modify
initrd operation when setting the initrd to none.

Reviewed-by: imsnah

70a35b6f 01/25/2008 05:36 pm Guido Trotter

Add a missing parenthesis

It was wrongly deleted when converting

if a in dict.keys():
to
if a in dict:

Reviewed-by: imsnah

de47cf8f 01/21/2008 06:28 pm Guido Trotter

Add support for command aliases

Passing a new aliases dict to generic main we can easily support aliases for
compatibility reasons or simply useability.

Reviewed-by: iustinp

d87ae7d2 01/21/2008 04:33 pm Iustin Pop

Fix VG listing broken by r510

LVM code sometimes adds an extra separator at the end of the field list.
Make the code strip it if exists.

Reviewed-by: imsnah

f4d377e7 01/21/2008 12:13 am Iustin Pop

Make backend._GetVGInfo check the validity of 'vgs'

Currently, the function backend._GetVGInfo only checks for errors via
the exit code of the 'vgs' command. However, there are other ways of
failure so we need to also check for valid output before parsing....

8d75db10 01/21/2008 12:12 am Iustin Pop

Fix checking of node free disk in CreateInstance

This patch does two things:
- checks that the result values from call_node_info are valid integer
values and aborts otherwise
- skips disk space computation for the DT_DISKLESS case

The most important point of the patch is the verification of results...

d4f16fd9 01/21/2008 12:12 am Iustin Pop

Abstract node memory checking into a separate function

The checking of a node's free memory (via rpc.call_node_info) is done in
both start instance an failover. This patch abstracts this call,
together with the appropriate error handling, into a separate function...

97628462 01/21/2008 12:09 am Iustin Pop

Change a hardcoded path into its proper constant

The function backend.UploadFile still uses "/etc/hosts" directly instead
of the existing constant; this patch fixes this.

Reviewed-by: ultrotter

1ed70996 01/21/2008 12:02 am Iustin Pop

Fix run directory for the fake hypervisor

Currently the fake hypervisor has hardcoded ‘/var/run’ as a base
directory for its store. This patch adds a constant RUN_DIR that is used
for both the fake hypervisor and for BDEV_CACHE_DIR.

Reviewed-by: ultrotter

8ae6bb54 01/16/2008 06:01 pm Iustin Pop

Show the HVM boot order in instance info

This is a merge from the 1.2 branch

Reviewed-by: imsnah

147af04d 01/16/2008 06:01 pm Iustin Pop

Two small style fixes

This is a merge from the 1.2 branch

Reviewed-by: imsnah

ba4b62cf 01/14/2008 05:10 pm Iustin Pop

Fix some misspellings

This patch fixes two name typos and a style issue (which makes pylint
complain).

Reviewed-by: ultrotter

40ed12dd 01/14/2008 04:19 pm Guido Trotter

Fix CreateInstance new optional parameters

Some new paramenters of the CreateInstance opcode are optional (namely
kernel_path, initrd_path and hvm_boot_order) but their absence makes the code
crash. Fix this by initializing them to a default value if they're not present....

25c5878d 01/11/2008 02:13 pm Alexander Schreiber

Support selecting the boot device order for HVM.

This patch adds support for specifying and changing the boot device order for
HVM instances. The boot device order specification is ignored for non HVM
instances.

Reviewed-by: iustinp

0d9c53bc 01/09/2008 03:02 pm Alexander Schreiber

Add boot_order entry to Instance object.

First step to support custom boot device order for HVM instances, add a
location to actually store that information for the instance.

Reviewed-by: iustinp

8cafeb26 01/08/2008 06:16 pm Iustin Pop

Fix gnt-instance modify breakage introduced in r462

Reviewed-by: schreiberal

03abdbe8 01/08/2008 01:04 pm Iustin Pop

Change the Xen PVM to use the new kernel options

This patch changes the hypervisor to use the new kernel and initrd
instance attributes. They kernel is handled as expected (use the custom
or the default one), but the initrd is treated a little bit special, in...