Statistics
| Branch: | Tag: | Revision:

root / lib @ eedbda4b

# Date Author Comment
eedbda4b 10/08/2007 11:59 am Michael Hanselmann

Add function to list files in a directory, excluding those beginning with a
dot.

Reviewed-by: iustinp

0ee60a28 10/04/2007 06:49 pm Guido Trotter

Remove redundant check.

This isdir() check leads to a broken error message. Even fixing it creates some
cases in which the error message is nebulous and unclear while removing it
makes this situation be dealt with a lot better by the _OSOndiskVersion checks....

305a7297 10/04/2007 02:51 pm Guido Trotter

Ship (and display) path for InvalidOS errors too.

- Document the expected change to errors.InvalidOS
- Always pass the additional argument
- Modify DiagnoseOS output to show the path

Reviewed-by: iustinp, imsnah

319856a9 10/04/2007 02:33 pm Michael Hanselmann

Change configuration storage format from Pickle to JSON.

- Add NEWS file with major changes between versions.
- Bump RPC version number
- No longer serialize in RPC, but just convert to dict

Old Pickle based configuration files can be converted using the cfgupgrade...

56bcd3f4 10/03/2007 05:11 pm Guido Trotter

Second part of the OS search path cleanup

Abstract the _OSSearch function, to look for an OS in the search path
Make OSFromDisk accept an optional base_dir, rather than the os_dir itself

Reviewed-by: iustinp

c26dabd7 10/03/2007 02:21 pm Guido Trotter

Make parameter os_dir mandatory for _OSOndiskversion.

First part of the OS search path cleanup. _OSOndiskversion is only ever called
once, and with that argument set, so let's make it mandatory.

Reviewed-by: iustinp

7c3d51d4 09/28/2007 12:39 pm Guido Trotter

Change constants.OS_DIR with constants.OS_SEARCH_PATH which includes all the
directories which can contain OS scripts.

The list defaults to the current one but can be changed at configure time.

Reviewed-by: imsnah

68dccc07 09/27/2007 07:02 pm Guido Trotter

Make the default export path configurable.

This is needed to improve FHS compliance for distribution integration.
The need was discussed on the alioth pkg-ganeti project.

Reviewed-by: imsnah

081b1e69 09/27/2007 04:03 pm Michael Hanselmann

Prevent race condition in CreateBackup().

Reviewed-by: ultrotter

f491c3a8 09/25/2007 04:04 pm Michael Hanselmann

Rename constants for SSH init script by Iustin's request.

Reviewed-by: iustinp

c6b8baba 09/25/2007 02:41 pm Michael Hanselmann

Add configure option for init.d/ssh script. This is useful for distributions
with the script named differently than Debian.

Reviewed-by: ultrotter

ff9c047c 09/24/2007 11:41 am Iustin Pop

Implement to/from dict conversion for ConfigObject(s)

This change allows instances of ConfigObject and its children to be
converted to and from standard python types. This will allow easier
upgrade of the configuration and use of any serialization protocol (not...

ec29fe40 09/21/2007 05:59 pm Iustin Pop

Change class hierarchy in objects.py

It makes sense to make the TaggableObject a child of the ConfigObject,
since in this case we can derive the Instance, Node and Cluster objects
only from the TaggableObject and have a cleaner hierarchy.

For consistency child classes will have to declare their slots by adding...

89e1fc26 09/21/2007 04:37 pm Iustin Pop

Remove requirement that host names are FQDN

We currently require that hostnames are FQDN not short names
(node1.example.com instead of node1). We can allow short names as long
as:
- we always resolve the names as returned by socket.gethostname()
- we rely on having a working resolver...

619fdc8e 09/21/2007 04:36 pm Iustin Pop

Move a constant from ganeti-master to constants.py

The EXIT_NODESETUP_ERROR is a useful constant and ganeti-watcher could
use it too. This patch moves it to constants.py and modifed the
ganeti-master script to use it from there.

Reviewed-by: imsnah

2057f6c7 09/21/2007 03:23 pm Iustin Pop

Add slots on TaggableObject

Unless we use slots on all parents, we don't get the benefits that
slots bring. This patch adds this attribute to the TaggableObject so
that Instances, Nodes and the Clusters behave as intended.

Reviewed-by: schreiberal,imsnah

47988778 09/19/2007 05:24 pm Iustin Pop

Improve the cli.AskUser() function

This patch improves the AskUser function by allowing it to:
- choose from multiple choices (instead of only y/n)
- give help to the user
- preserve line breaks and whitespace formatting in the message

With this patch, an instance removal looks like this:...

bdd55f71 09/19/2007 04:52 pm Iustin Pop

Allow 'add instance' to not start the new instance

This patch allows 'gnt-instance add' to not start the newly-created
instance. It also allow 'gnt-instance add' and 'gnt-backup import' to
not check for IP conflicts (only when not starting the instance)....

bcf043c9 09/19/2007 09:56 am Iustin Pop

Change resolved hostname from dict to a class

The current result of utils.LookupHostname() is a dict, but this does
not allow static checkers to check the correctness of the code. This
patch introduces a new class names HostInfo and changes LookupHostname...

07bd8a51 09/18/2007 03:42 pm Iustin Pop

Implement cluster rename operation

This patch adds a new OpCode (and corresponding LU) that implements the
cluster rename functionality.

This is done by shutting down the master role, making the needed sstore
modifications and distributing the changed files to all nodes, and then...

4ca1b175 09/17/2007 05:04 pm Alexander Schreiber

Cleanup up selective imports for utils and utils unit test.

Reviewed-by: iustinp, imsnah

9716fdce 09/17/2007 02:53 pm Iustin Pop

A few minor fixes in backend.py

This uses the recently-added Instance.FindDisk() method instead of
hard coded find-disk code.

It also renames one parameter to AddNode from ssh to sshkey in order not
to shadow the ganeti.ssh module.

Reviewed-by: imsnah

decd5f45 09/17/2007 02:52 pm Iustin Pop

Implement instance rename operation

This patch adds support for instance rename operation at all remaining
layers: RPC, OpCode/LU and CLI.

Reviewed-by: imsnah

2c30e9d7 09/17/2007 02:18 pm Alexander Schreiber

Added TcpPing to do ping-alike via TCP connect(2) with defined source address.
To be used to replace the currently fping(8) based reachability test.

Reviewed-by: imsnah

386b57af 09/17/2007 01:52 pm Iustin Pop

Add support for rename operation in the OS API

This patch adds support for renaming at OS level. Because of this, we
need to bump up the version of the OS api from 4 to 5.

The patch also documents the new script interface in the
ganeti-os-interface(7) man page and adds a section on upgrading the OS...

fc95f88f 09/17/2007 12:10 pm Iustin Pop

Add rename instance support to ConfigWriter

This patch adds support for renaming instances to the ConfigWriter
class. It's needed in here in order to guarantee that we don't lose the
instance during the rename (the instance will be there, either with the...

246e180a 09/14/2007 12:54 pm Iustin Pop

Change OpQueryNodes nodes attribute to names

Change this to have the exact same parameters as OpQueryInstances.

Also fix burnin which is broken since r146.

Reviewed-by: imsnah

069dcc86 09/14/2007 12:54 pm Iustin Pop

Enable LUQueryInstances to work with a given list of instances

As per the changes to LUQueryNodes, the QueryInstances LU is modified to
accept a list of instances for which to compute and return information.

Reviewed-by: imsnah

4a72cc75 09/14/2007 12:03 pm Iustin Pop

Remove OpQueryNodeData and LUQueryNodeData

Now that LUQueryNodes supports all the functionality of LUQueryNodeData,
let's migrate gnt-node.ShowNodeConfig to use it and remove all traces of
OpQueryNodeData and LUQueryNodeData.

Reviewed-by: imsnah

ec223efb 09/14/2007 12:02 pm Iustin Pop

Change LUQueryNodes to return raw values and support selective listing

LUQueryNodes it's very similar to LUQueryNodeData, but it lacks two
features:
- instance list (it has count though), both primary and secondary
- selective node listing

In order to support these features, we change it to return raw values...

a7ba5e53 09/14/2007 12:02 pm Iustin Pop

Change _GetWanted* to return names instead of objects

On closer look, all except one of the current users of _GetWantedNodes are
using only the name of the nodes and throw away the other attributes. It makes
sense to make this function return only the name list (as in the future this...

8a23d2d3 09/13/2007 02:49 pm Iustin Pop

Move string formatting out of LUQueryInstances

Currently, LUQueryInstances will provide strings for its results. This makes it
hard for other consumers than "gnt-instance list" to use the OpQueryInstances
opcode for whatever they wish to.

The change moves the formatting in five of the six cases where this happens to...

72f0f7fd 09/13/2007 02:31 pm Iustin Pop

Fix the ssh change which breaks remote ssh commands

Explanation: since we use lists and not a string, every argument we give
is passed unchanged to the remote shell. So, for example, passing
'/etc/init.d/ganeti restart' to the remote shell, it will try to run the...

23f41a3e 09/12/2007 03:02 pm Michael Hanselmann

Change the way how locales are overridden:
- Set only LC_ALL, it overrides any other variable
- Restore environment after unittest

Reviewed-by: iustinp

3312b702 09/12/2007 02:58 pm Iustin Pop

Clone cmdlib._GetWantedNodes into _GetWantedInstances

This duplicates _GetWantedNodes to _GetWantedInstances, after doing some
changes to it:
- fix an indentation error that should result in only the last node
name passed being chosen
- change the function to have a single return statement...

fdc267f4 09/12/2007 01:32 pm Iustin Pop

Fix docstrings of many opcodes

Reviewed-by: imsnah

f6441c7c 09/11/2007 03:18 pm Iustin Pop

Filters out LANG and LC_* on RunCmd

This filters out the LANG and LC_ variables from the environment of programs
executed by RunCmd, in order to get consistent output of execute programs like
lvs, etc.

Reviewed-by: imsnah

8e587e52 09/11/2007 11:45 am Michael Hanselmann

- Don't build .tar.bz2, we only distribute .tar.gz anyway.
- Clean generated files on “make maintainer-clean”.
- Build _autoconf.py and ganeti.initd on “make all”.

Reviewed-by: iustinp

00003458 09/07/2007 02:30 pm Guido Trotter

Make import/export use the auxiliary ssh library to build the remote commands.

This avoids forgetting some parameters, as it's happening right now
(the correct known host file is not being passed)

In order to do so we split SSHCall into an auxiliary BuildSSHCmd which builds...

88d14415 09/05/2007 08:14 pm Michael Hanselmann

Add function to get all local IP addresses, will be used in cmdlib.py.

Reviewed-by: schreiberal

2ec08468 09/04/2007 02:32 pm Michael Hanselmann

Use _autoconf.py instead of version.py, generated by Makefile with more
variables. The underline is there to mark it as a private module.

Reviewed-by: iustinp

7c18ef8e 09/03/2007 05:42 pm Michael Hanselmann

- Generic automake cleanup
- Bump version number to 1.2b2
- Add version.py file generated from version.py.in by autoconf

Reviewed-by: schreiberal

113b55aa 09/03/2007 02:22 pm Iustin Pop

Switch utils.RunCmd from popen2 to subprocess

This changes the implementation of RunCmd from using the popen2 module
to using the (new in 2.4) subprocess module.

This is helpful because the subprocess module has more advanced features
than popen2, the most important ones being the ability to run code in the...

8d519422 08/30/2007 07:16 pm Iustin Pop

Fix mdadm -D output compatibility issues.

Also add some debugging output.

2a710df1 08/30/2007 06:36 pm Michael Hanselmann

- Check for secondary node before doing a failover.
- Replace magic values by constants.

Reviewed-by: iustinp

c20494cd 08/30/2007 05:32 pm Iustin Pop

Add a safety check to the backend.AddOSToInstance

This changes a ';' to '&&' to make sure we run the create script from
the correct directory.

Reviewed-by: imsnah

130e907e 08/30/2007 05:30 pm Iustin Pop

Add one more check on cluster init.

This adds a check that the initial node's IP name doesn't resolve to a
loopback address (127.x.y.z).

Also remove an unused variable.

Reviewed-by: imsnah

16450d30 08/30/2007 12:35 pm Iustin Pop

Document kernel selection method

This changelist add:
- documentation on how to select the kernel and initrd (if needed) for
instances
- support in hypervisor.py for the initrd
- adds note about internet-connectivity and debootstrap requirements...

ff98055b 08/28/2007 03:25 pm Iustin Pop

Refuse nodes with non-FQDN hostnames.

This changes the cluster init and node join to refuse a node that has a
different hostname than what the resolver returns.

Reviewed-by: imsnah

1a87dca7 08/28/2007 11:50 am Iustin Pop

Fix compatibility problems with mdadm-2.5.6

This fixes a compatibility problem with recent mdadm (2.x?) by
reimplementing the zero-ing of the superblocks in ganeti itself.

Reviewed-by: imsnah

82122173 08/24/2007 12:20 pm Iustin Pop

Rework ssh known-hosts handling.

This changes:
- cluster setup, we no longer edit /etc/ssh/ssh_known_hosts but our
own file
- node add, we no longer remove root's known_hosts (twice)
- gnt-instance console, both the LU and the script: since now the ssh...

02715459 08/23/2007 04:59 pm Iustin Pop

Improve LURunClusterCommand

This function used a hand-coded ssh call to remote nodes. Fix it to use the
ssh.SSHCall function, and in the process drop the command field from the
results, as it's too verbose and we can use (in gnt-cluster) what we passed in....

8bd562f5 08/22/2007 06:53 pm Iustin Pop

Fix one wrong usage of _GetWantedNodes

_GetWantedNodes is used wrongly by the LUClusterCopyFile. This fixes that.

Reviewed-by: imsnah

31ee599c 08/21/2007 05:35 pm Michael Hanselmann

Fix typo.

Reviewed-by: iustin

3899870e 08/20/2007 04:27 pm Iustin Pop

Disable hashing of the ssh keys.

In case we use StrictHostKeyChecking=ask, also add HashKnownHosts=no so that
debugging is easier. The nodes to which we are connecting are anyway visible in
/etc/ssh/ssh_known_hosts.

644eeef9 08/20/2007 03:17 pm Iustin Pop

Add support for listing instance disk sizes.

Reviewed-by: imsnah

a02bc76e 08/20/2007 02:29 pm Iustin Pop

A CheckPrereq method had one unconverted "return 1" statement. Change it to the
appropriate raise.

Reviewed-by: imsnah

16be8703 08/17/2007 12:14 pm Iustin Pop

Change cli.OutputTable to cli.GenerateTable

Since the table generation might be useful elsewhere, let's change it to
return the data instead of directly printing it.

Its callers have also been updated.

Reviewed-by: imsnah

8925faaa 08/16/2007 06:13 pm Iustin Pop

Some small fixes.

It fixes the main Makefile.am to create $localstatedir/{lib,log}/ganeti.
It fixes the testing Makefile.am after the rename fake_config.py ->
mocks.py. It strips the output of "ip link show" to have a nicer output
if the master netdev does not exist.

3ecf6786 08/14/2007 06:17 pm Iustin Pop

Style changes for pep-8 and python-3000 compliance.

This changes the raising of exceptions from:
raise Exception, value
to
raise Exception(value)

as the first form will be removed in python-3000 and the second form is
preferred now.

The changes also involve a few cases of changing from raising standard...

5c947f38 08/08/2007 12:37 pm Iustin Pop

Implement tag support for cluster, nodes and instances.

This is only the backend part, from the command line the tags can't be
read/modified yet.

Reviewed-by: imsnah

37d19eb2 08/06/2007 02:26 pm Michael Hanselmann

Don't bail out if node isn't there on “gnt-node volumes”.

Reviewed-by: iustinp

e00fb268 08/03/2007 06:04 pm Iustin Pop

Prepare for the tags implementation:
- add an Update method on the ConfigWriter class;
- make the AddInstance method not log disks for diskless types (helps with testing)
- implement limited testing for the ConfigWriter with focus on the new Update method

fee9556c 08/03/2007 03:51 pm Iustin Pop

Re-stat the config file when we write it so that the next _OpenConfig()
won't reread it if not modified by someone else.

a0c3fea1 08/03/2007 03:35 pm Michael Hanselmann

Add instance name to LVM volume as a tag.

Reviewed-by: iustinp

62779dd0 08/03/2007 02:03 pm Iustin Pop

Implement a standard way of getting the cluster object from the
configuration.

Reviewed-by: imsnah

923b1523 08/03/2007 12:57 pm Iustin Pop

Change logival volume names to not be based on the instance's name, but
instead use an UUID prefix and a suffix denoting the disk iv_name
(sda/sdb) and possibly it's type (data/meta).

Reviewed-by: imsnah

e31c43f7 08/03/2007 12:18 pm Michael Hanselmann

Put synchronization speed into constant.

Reviewed-by: iustinp

cf62a272 08/02/2007 06:54 pm Michael Hanselmann

Put default bridge into constant.

Reviewed-by: iustinp

0006af7d 08/02/2007 04:45 pm Michael Hanselmann

Add configuration upgrade utility.

Reviewed-by: iustinp

47c28c5b 08/02/2007 03:51 pm Michael Hanselmann

Implement setitem for ConfigObject to add container protocol compatibility.

ecb215b5 07/30/2007 03:40 pm Michael Hanselmann

Fix issues reported by pylint.

Reviewed-by: iustinp

396e1b78 07/27/2007 03:28 pm Michael Hanselmann

Unify environment variables for instance related hooks.

Reviewed-by: iustinp

db915bd1 07/27/2007 01:00 pm Michael Hanselmann

Check for instances on “gnt-cluster destroy”.

Reviewed-by: iustinp

d0834de3 07/27/2007 12:05 pm Michael Hanselmann

- Implement “gnt-instance reinstall --os-type=…”
- Add the command to gnt-instance.sgml

Reviewed-by: iustinp

59322403 07/27/2007 11:15 am Iustin Pop

Fix the "gnt-cluster getmaster" command by making the LuQueryClusterInfo
runnable on non-master nodes (and remove the list of instances and nodes
returned by it, that information can be retrieved by other opcodes).

Also, remove the node/instance list from "gnt-cluster info" as it...

5fcdc80d 07/27/2007 10:41 am Iustin Pop

Move the cluster name from ConfigWriter to SimpleStore.

Reason: if left ConfigWriter, nodes don't know to which cluster they belong.
This will bite us later when we'll revisit node join operation.

Cons: we lose the cluster name from the config file, which means a...

fe7b0351 07/26/2007 07:09 pm Michael Hanselmann

- Move --force option to cli.py
- Implement “gnt-instance reinstall”
- Fix two typos

Reviewed-by: iustinp

330cda58 07/26/2007 06:26 pm Michael Hanselmann

Don't pass master_node

Reviewed-by: iustinp

098c0958 07/26/2007 02:40 pm Michael Hanselmann

Comment formatting updates.

Reviewed-by: iustinp

b2fddf63 07/26/2007 11:48 am Iustin Pop

The master_node is no longer stored in the config file (but in sstore)
and all users have been converted, let's remove it from the slots of the
cluster object.

Also let's move the tcpudp_port_pool to the cluster object.

Reviewed-by: imsnah

264bb3c5 07/25/2007 07:16 pm Michael Hanselmann

Get ports from configuration if there are some.

Reviewed-by: iustinp

821afb13 07/25/2007 04:34 pm Iustin Pop

It seems the _CheckNodesDirs function is no longer used. Let's remove it.

cb91d46e 07/25/2007 02:46 pm Iustin Pop

Since the watcher can run on all nodes, let's get rid of the cron file
handling, as it can be static and outside of ganeti.

This also means we can get rid of a lot of infrastructure too:
- the master/node config files checkers
- one rpc function

38242904 07/25/2007 11:05 am Iustin Pop

Make the ganeti-watcher exit gracefully if it's not run on the master.

Reviewed-by: imsnah

83120a01 07/24/2007 05:10 pm Michael Hanselmann

Add description, fix indentation.

Reviewed-by: iustinp

137161c9 07/24/2007 04:29 pm Michael Hanselmann

Use generic function to output tables.

Reviewed-by: iustinp

dcb93971 07/24/2007 02:45 pm Michael Hanselmann

- Implement “gnt-node volumes”
- Create all --output options using a constant
- Put node checking code from opcodes into a single function
- Do the same for output fields

Reviewed-by: iustinp

880478f8 07/23/2007 05:38 pm Iustin Pop

Big change/cleanup in relation to the master startup:
- move the master node name from the ConfigWriter to SimpleStore (all
nodes need this, and it was the only thing pulled in from the
ConfigWriter on nodes)
- fix mcpu.py and the testing w.r.t. this change; for testing, rename...

5b7b5d49 07/23/2007 03:14 pm Guido Trotter

Do the secondary check and subsequently allocate the drive on all available
logival volumes. This lets you use more than one when none of them can support
your full drive size.

Reviewed-By: iustinp

191a8385 07/23/2007 02:33 pm Guido Trotter

Fix a typo in an error message, and actually pass it its parameters.

Reviewed-By: imsnah

d0b3526f 07/23/2007 01:27 pm Michael Hanselmann

Output instance name in error message instead of object representation.

Reviewed-by: iustinp

72d6c464 07/23/2007 10:44 am Michael Hanselmann

Fix calls to _GenerateMDDRBDBranch.

Reviewed-by: iustinp

3a7c308e 07/19/2007 05:41 pm Guido Trotter

Check for memory size requirements before failing over an instance.

Reviewed-By: iustinp

ed1ebc60 07/19/2007 03:08 pm Guido Trotter

Implement space requirement checking before creating/importing an instance.

Reviewed-By: iustinp

a8083063 07/16/2007 04:39 pm Iustin Pop

Initial commit.