Statistics
| Branch: | Tag: | Revision:

root / lib @ 94285814

# Date Author Comment
94285814 04/15/2008 02:54 pm Guido Trotter

SharedLock: restrict assertion condition

When we release a shared lock if there are no exclusive waiter then the number
of shared waiters must be exactly equal to the ones scheduled to pass.

Reviewed-by: iustinp

e54c4c5e 04/10/2008 08:04 pm Guido Trotter

Verify: make skipping checks possible

Add a general way to skip some checks at cluster-verify time and make the N+1
memory redundancy check optional.

Reviewed-by: iustinp

2b3b6ddd 04/10/2008 08:04 pm Guido Trotter

Verify: add N+1 Memory redundancy verification

For every node we check that we can host all the instances it's currently
secondary for belonging to the same primary. This ensures that if a node fails
all its instances can fit on their secondary node. The code only works when...

26b6af5e 04/10/2008 08:03 pm Guido Trotter

Verify: save instance config

Save the instance config after we queried it in an instance_cfg dict. This can
be used later by any function that wants it, without reloading it from the
configuration module. It will be used for N+1 memory resilience checking....

36e7da50 04/10/2008 08:03 pm Guido Trotter

Verify: add more instance information to node_info

The sisnt-by-pnode field contains all secondary instances of a node, grouped by
their primary node. This information allows us to see quickly if when a node
dies some of its instances cannot be started on their secondary node....

93e4c50b 04/10/2008 08:03 pm Guido Trotter

Verify: add instance information to node_info

With this patch node_info is changed to store information about which primary
and secondary instances are configured on a node. This information is useful to
check memory and disk allocation. A list of non-redundant instances is also...

9c9c7d30 04/10/2008 08:03 pm Guido Trotter

Verify: Add and populate node_info dict

During information gathering we collect information from call_node_info, and
then when we cycle trough the nodes add it into a node_info dict containing a
node's free memory and disk. This will be useful later to verify that the...

1f9430d6 04/10/2008 07:38 pm Iustin Pop

Rework the results of OpDiagnoseOS opcode

Currently, the opcode DiagnoseOS is the only opcode that return a
structure of objects.OS (which is a custom class, and not a simple
python object) and furthermore all the processing of OS validity across
nodes is left to the clients of this opcode....

b77acb3e 04/10/2008 06:46 pm Iustin Pop

Change client protocol to raise exception on failures

Currently the luxi.client.SubmitJob and Query methods return the unserialized
result without processing it at all. This patch changes this by adding a
'RequestException' error that is raised if the query itself or the...

35049ff2 04/10/2008 06:36 pm Iustin Pop

Add per-opcode results to job processing

This patch changes the definition of a job and introduces per-opcode
results.

First, the result and status fields of a job are condensed into a single
'status' attribute. Then, we introduce an opcode status and one result...

57c177af 04/10/2008 04:41 pm Iustin Pop

Move the OS search code into an abstract function

Based on the previous OS search code changes, we can now move the OS
search code into a generic look-for-file function in utils.py. This
means that the allocator code can use the same function.

Reviewed-by: ultrotter

c34c0cfd 04/10/2008 04:40 pm Iustin Pop

Change backend._OSSearch return values

Currently, the function backend._OSSearch() returns the (first) base dir
in which this OS can be found. Thereafter the full actual path to the OS
dir is built in the backend.OSFromDisk() function.

This patch changes this so that _OSSearch() always returns the full path...

ceb76b36 04/10/2008 01:18 pm Guido Trotter

Verify: remove useless check in _VerifyInstance

The list of instances passed to _VerifyInstance is the one coming from
self.cfg.GetInstanceList(). So there's no point, inside that function, in
checking whether the current instance is a member of that list. Moreover...

c5705f58 04/10/2008 01:18 pm Guido Trotter

Verify: instance verification cleanup

The instance configuration is grabbed both in the _VerifyInstance function and
in the loop that calls it. Clean this up by passing the configuration as a
parameter.

Reviewed-by: imsnah

a872dae6 04/10/2008 01:18 pm Guido Trotter

Verify: fix crash when a node is down

Currently if ganeti-noded doesn't respond on a node gnt-cluster verify will die
when verifying primary instances for that node. Fix this by just emitting an
error message if no information about running instances is returned from the...

c840ae6f 04/10/2008 01:18 pm Guido Trotter

Verify: fix ERROR message indentation

All ERROR messages in cluster verify are indented by four spaces, this one is
indented by two. Fixing this skew.

Reviewed-by: imsnah, iustinp

2f6eebee 04/10/2008 01:18 pm Guido Trotter

Fix spelling mistake in constants.py

Of course instance creation don't have any modem, and the comment was just
talking about modes. Sorry to everybody expecting whistles.

Reviewed-by: imsnah

16687b98 04/10/2008 12:12 pm Manuel Franceschini

Small code style fix

Reviewed-by: imsnah

2c313123 04/09/2008 08:45 pm Manuel Franceschini

Bugfix instance create when file-storage-dir None

os.path.join does not like None as argument and fails with
AttributeError: 'NoneType' object has no attribute 'startswith'.

This patch makes sure the passed argument is a string in any case.

Reviewed-by: iustinp

1c6e3627 04/08/2008 07:28 pm Manuel Franceschini

Two small code style fixes

Reviewed-by: imsnah

dc936b49 04/08/2008 07:01 pm Manuel Franceschini

Add file_storage_dir,file_driver to OpCreateInstance

Reviewed-by: ultrotter, iustinp

b23c4333 04/08/2008 07:00 pm Manuel Franceschini

Modify LURenameInstance to support file backend

This patch does two things:
- Modify LURenameInstance.Exec to rename directory
when a file-based instance is renamed
- Modify config.RenameInstance() to replace the directory name in
config.data for file devices...

0f1a06e3 04/08/2008 07:00 pm Manuel Franceschini

Modify LUCreateInstance to support file backend

- Modfiy _GenerateDiskTemplate to support file-based disk template
- Modify _CreateDisks to create directory needed for file-based
instances before creating the actual files
- Modify _RemoveDisks to delete directory for file-based instances...

d5fd92ed 04/08/2008 06:04 pm Michael Hanselmann

Provide more flexible version numbers to the code

Having the individual parts in the code allows us to build version
numbers like "1.2" while leaving "3" out in a clean fashion, that is
without regular expressions or the like. This might be used together...

e994fcba 04/08/2008 05:04 pm Manuel Franceschini

Modify hypervisor to support file backend

The driver in the xen config file needs to be changed when dealing with
files rather then bdevs.

This patch does two things:
- Add _GetConfigFileDiskData to XenHypervisor which returns the correct
disk xen config line. This function checks the logical disk type of...

283439c9 04/07/2008 02:18 pm Iustin Pop

Implement selective job query

This patch implements query-ing of only selected jobs instead of all.

Reviewed-by: ultrotter

a14a17fc 04/07/2008 02:15 pm Iustin Pop

Move some checks from cli.py to luxi.py

The idea of cli.py and luxi.py is that all protocol checks should be in
luxi, and cli.py should just offer some helpful shortcuts for the
command line scripts.

This patch removes the result checks from cli and adds some other checks...

00abdc96 04/07/2008 02:12 pm Iustin Pop

A small capitalization change (OpCode.LoadOpcode)

This small patch fixed the opcodes.OpCode.LoadOpcode capitalization to
what was intented to be (as the comment says): LoadOpCode.

Reviewed-by: ultrotter

c1f2901b 04/05/2008 06:29 pm Iustin Pop

Implement forking/master role checking in masterd

This patch adds checks for the master role and daemonize support to
ganeti-masterd.

The patch modifies the startup/shutdown of the server because:
- we want bind()/listen() to the master socket to occur before forking...

6f695a2e 04/05/2008 03:47 pm Manuel Franceschini

Add FileStorage class

This is the representation of file VBDs on the backend. It's the first
implementation an supports only raw files.

Reviewed-by: iustinp

5e04ed8b 04/05/2008 03:45 pm Manuel Franceschini

rpc directory functions for file backend

Reviewed-by: ultrotter

778b75bb 04/05/2008 03:07 pm Manuel Franceschini

Backend directory functions for file backend

Add _[Create,Remove,Rename]FileStorageDir function which are needed for
file-based instance management. These function check whether the given
directory to operate on is under the cluster-wide defined default file...

2d4011cd 04/04/2008 07:53 pm Manuel Franceschini

Fix SetVGName() to access object not dict

Reviewed-by: imsnah

8ff612c2 04/04/2008 06:29 pm Iustin Pop

Allow utils.Daemonize() to not close some fds

This patch implements an optional parameter to utils.Daemonize() which
allows that function to not close some file descriptors.

This will allow the master daemon to open the listening socket before
fork - in order to be able to notify errors and return a meaningful exit...

7a1ecaed 04/04/2008 03:44 pm Iustin Pop

Add a simple gnt-job script

This patch adds a very basic gnt-job script that allows job querying.
This goes on top of the previous master daemon patches.

Currently, because of the not-changed cmd lock, you can't query the jobs
as long as a job is running - you have to rm the cmd lock and then you...

8f765069 04/04/2008 03:02 pm Iustin Pop

Move the daemonize function to utils.py

Currently, in ganeti-noded we have the createDaemon function. Since
we'll need the same in other daemons, we move this function to utils.py

With the move, a few changes were also done:
- change the name to Daemonize()...

aa9d0c32 04/02/2008 09:32 pm Guido Trotter

Improve disk consistency error message again

This new version includes all the possible failure options.

Reviewed-by: iustinp

ad6d3f7d 04/02/2008 09:06 pm Guido Trotter

Fix misleading error message when checking disks

_CheckDiskConsistency outputs "Can't get any data from node NODE" when no drbd
is found on the target node. This causes a misleading error message to be
output for example on failover (when the primary node is down, or the instance...

a0aaa0d0 04/02/2008 09:05 pm Guido Trotter

Handle better failing over non-running instances

Right now if you try to failover an instance which is not marked as up the
operation will fail unless you pass the --ignore-consistency flag because the
disks won't be considered to be consistent. Allow them to be if we know the...

fb300fb7 04/02/2008 09:05 pm Guido Trotter

Improve export and fix export-on-norun bug

Currently gnt-backup export chains the ShutdownInstance and StartupInstance
opcodes to itself. This works but (a) it's suboptimal, because there's no need
to deactivate the instance's disks as we are about to restart it anyway, and...

2d3e73c4 04/02/2008 05:15 pm Michael Hanselmann

Forcibly convert export data to str object

ConfigParser.SafeConfigParser doesn't support unicode string objects.
Unicode string objects are returned by simplejson.

Reviewed-by: iustinp

12a0cfbe 04/02/2008 01:01 pm Guido Trotter

failover: only start instance if we should

gnt-instance failover on an instance marked as down will mistakenly bring it
up. The watcher will then shut it down again, but it's a lot better (and safer)
not to start it at all.

Reviewed-by: imsnah

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