Michael Hanselmann [Mon, 1 Nov 2010 13:01:23 +0000 (14:01 +0100)]
QA: Test ssconf_instance_list file on rename and creation
This test would've caught the bug fixed in the previous patch.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 1 Nov 2010 13:00:33 +0000 (14:00 +0100)]
config: Write ssconf after renaming instance
This fixes a bug where the ssconf_instance_list file was
not updated after an instance rename.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 1 Nov 2010 12:59:47 +0000 (13:59 +0100)]
Change qa_utils.ResolveInstanceName to take name
… instead of an object. Allows it to be used in places where
only the name is available.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 29 Oct 2010 14:55:05 +0000 (16:55 +0200)]
Makefile: Add PYTHON_BOOTSTRAP to linted code
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 29 Oct 2010 14:26:28 +0000 (16:26 +0200)]
Make *.in non-executable
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 29 Oct 2010 14:10:50 +0000 (16:10 +0200)]
Move ganeti-rapi to ganeti.server.rapi
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 29 Oct 2010 14:08:48 +0000 (16:08 +0200)]
Move ganeti-noded to ganeti.server.noded
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 29 Oct 2010 14:05:20 +0000 (16:05 +0200)]
Move ganeti-confd to ganeti.server.confd
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 29 Oct 2010 13:26:20 +0000 (15:26 +0200)]
Move ganeti-masterd to ganeti.server.masterd
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 29 Oct 2010 13:13:51 +0000 (15:13 +0200)]
Prepare move of daemons to ganeti.server
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 17:51:30 +0000 (19:51 +0200)]
Move ganeti-watcher to ganeti.watcher
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 17:52:17 +0000 (19:52 +0200)]
Makefile: Generalize bootstrap script generator
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 15:20:20 +0000 (17:20 +0200)]
Makefile: Stricter checks for release distchecks
This should avoid cases like commit
f64de30f where the release
date was forgotten from NEWS.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Fri, 29 Oct 2010 12:52:52 +0000 (14:52 +0200)]
setup-ssh: Better error reporting
Together with Michael we refactored the code to make it better and
easier error reporting. Without printing backtraces for authentication
and verification issues.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Thu, 28 Oct 2010 15:06:21 +0000 (17:06 +0200)]
Makefile: Streamline directory creation
Some directories don't exist in the repository, but are required at build time
(e.g. doc/html). Until now some were created explicitly, some through the
target “stamp-directories” and other target simply relied on a previous target
to create the directory.
This patch tries to clean this up by getting rid of “stamp-directories” and
instead use rules to recreate any missing directory. As described in a comment
in the code, a file inside each directory is necessary, named “.dir”.
Order-only dependencies are used for directory creation to avoid rebuilding
where only the “.dir” file is missing (see “info make”, section “4.3 Types of
Prerequisites”).
The target for building the documentation is also changed to use “…/index.html”
instead of a hidden file. Some style changes are also made.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Thu, 28 Oct 2010 16:48:20 +0000 (18:48 +0200)]
Add support and checks for version in LUXI
A new constant, LUXI_VERSION, is used to verify the peer's version. The
version is optional, so old(er) clients and servers talking to peers not
supporting it won't break. Example with mismatching library:
$ gnt-instance list
Unhandled Ganeti error: LUXI version mismatch, server 2020000, request
1010000
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 28 Oct 2010 15:11:43 +0000 (17:11 +0200)]
luxi.ProtocolError: Derive from errors.LuxiError
This allows LUXI errors to be encoded and serialized.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 28 Oct 2010 16:03:14 +0000 (18:03 +0200)]
LUExportInstance: Accept instance already shut down
To remove the instance after an export it needs to be stopped. This can
be achived using the parameter “shutdown”, or by explicitly shutting
down the instance before exporting. The latter would still require the
“shutdown” parameter to be set. To make it more intuitive, this
requirement is changed with this patch. Instances already stopped are
accepted for automatic removal.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 28 Oct 2010 15:58:45 +0000 (17:58 +0200)]
QA: Allow job queue test to be disabled
On my machine it takes over 30 seconds, disabling it can
speed up the QA.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 27 Oct 2010 13:47:12 +0000 (14:47 +0100)]
ConfigWriter.GetNodeGroupList
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Wed, 27 Oct 2010 13:14:47 +0000 (14:14 +0100)]
GanetiLockManager, remove default values
The nodes and instances parameters to the constructor are mandatory
anyway, as a value of None will fail when creating the LockSet. Rather
than fixing this adding code lines, since we never used the default
value, let's remove them and require that the parameters are passed.
This also fixes the only places where we inited GanetiLockManager with
keyed parameters and without arguments.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Wed, 27 Oct 2010 14:09:01 +0000 (15:09 +0100)]
Add test for modifiable locking levels
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Adeodato Simo [Thu, 28 Oct 2010 11:57:04 +0000 (12:57 +0100)]
Update 2.3 design doc regarding node group features and behavior.
In particular:
- introduce a "gnt-group" command to hold group-level operations.
- ditch the concept of "default node group", except for single-group
clusters.
- introduce an "alloc_policy" attribute for node groups, indicating
how they should be treated by automated allocation tools.
- introduce a "drain" operation on node groups.
- define iallocator modes for new instance allocation and
inter-group moves (choosing among all groups, or providing a
limiting list).
- indicate and explain that changing the group of a node will be
initially only supported for nodes that are empty.
Signed-off-by: Adeodato Simo <dato@google.com>
Signed-off-by: Balazs Lecz <leczb@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Thu, 28 Oct 2010 12:32:07 +0000 (14:32 +0200)]
Prevent onlining a node without working noded
This is just a basic check, plus a warning. In the future, we might do
more checks, or prevent simple onlining (without readd) if --force is
not passed.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Thu, 28 Oct 2010 11:57:28 +0000 (13:57 +0200)]
Yet another rework in LUSetNodeParms
We will need the new role in CheckPrereq, so move its computation there
and save the new role to self.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Wed, 27 Oct 2010 15:17:14 +0000 (17:17 +0200)]
Prevent moving/creating instances on non-vm nodes
This small patch modifies LUCreateInstance, LUReplaceDisks and
LUMoveInstance to not use non-vm_capable nodes.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 27 Oct 2010 15:11:05 +0000 (17:11 +0200)]
Add a CheckNodeVmCapable helper in cmdlib
Also changes the error code for the other CheckNode* helpers to
ECODE_STATE, not ECODE_INVAL: ECODE_INVAL is for requests that are
invalid (e.g. create drbd instance with one node), whereas ECODE_STATE
denote requests that are not satisfiable due to cluster/node/instance
state.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 27 Oct 2010 15:06:23 +0000 (17:06 +0200)]
Add the capability flags in node info output
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 27 Oct 2010 15:03:03 +0000 (17:03 +0200)]
Add the master/vm_capable flags in node add
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 27 Oct 2010 14:36:42 +0000 (16:36 +0200)]
Add support for vm_capable in file distribution
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 27 Oct 2010 14:34:01 +0000 (16:34 +0200)]
Add an UploadHelper to cmdlib
This is used in two places already, and will be needed in a third, so
let's abstract it.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 27 Oct 2010 14:12:01 +0000 (16:12 +0200)]
Add support for vm_capable in cluster verify
The method to make vm_capable integrate easily into cluster verify is as follows:
- we add a new NV_VMNODES that represents *non*-vm-capable nodes
- the LU populates this list (it's expected that non-vm_capable nodes
are few compared to vm_capable nodes)
- backend skips the checks that are related to VM hosting
- in the LU, we reorder the VM-related checks so that they occur after
the non-VM (generic) tests, and we only execute them conditionally
Additionally, we add some support to the instance checks to detect
instances living on bad nodes.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 27 Oct 2010 12:43:32 +0000 (14:43 +0200)]
Add vm_capable to gnt-node modify
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 27 Oct 2010 11:53:27 +0000 (13:53 +0200)]
Add vm_capable to LUSetNodeParams
And also do some cleanup: we only run the role changed actions if the
node has actually changed roles.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 27 Oct 2010 11:30:16 +0000 (13:30 +0200)]
ConfigWriter: add some helper functions
This can be used to compute a node's instances easily, and a small
function to get all non-vm_capable nodes.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 15:50:16 +0000 (17:50 +0200)]
LUClusterVerify: Complain if disk is marked faulty
This will show a warning if, for example, one side of a DRBD
disk becomes unavailable. The data is collected separately
from the other verification data.
Example output:
* Verifying instance status
- ERROR: instance inst1: disk/0 on node2 is faulty
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 12:32:14 +0000 (14:32 +0200)]
A number of Makefile fixes
- run-in-tempdir should depend on what it copies to the temporary dir
- Add PYTHON_BOOTSTRAP to BUILT_SOURCES
- Don't use “mkdir -p” directly
- Create directory if necessary for writing bootstrap script
In summary, this should make “make distcheck” in pristine
checkout work again.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 12:05:34 +0000 (14:05 +0200)]
Rebuild bash completion if client scripts change
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 11:41:47 +0000 (13:41 +0200)]
Move gnt-backup to ganeti.client.gnt_backup
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 11:37:48 +0000 (13:37 +0200)]
Move gnt-instance to ganeti.client.gnt_instance
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 11:33:28 +0000 (13:33 +0200)]
Move gnt-job to ganeti.client.gnt_job
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 11:30:44 +0000 (13:30 +0200)]
Move gnt-node to ganeti.client.gnt_node
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 11:27:32 +0000 (13:27 +0200)]
Move gnt-cluster to ganeti.client.gnt_cluster
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 11:52:14 +0000 (13:52 +0200)]
Python bootstrapper: hardcode /usr/bin/python
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 11:02:13 +0000 (13:02 +0200)]
Move gnt-os to ganeti.client.gnt_os
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 11:00:49 +0000 (13:00 +0200)]
Move gnt-debug to ganeti.client.gnt_debug
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 27 Oct 2010 10:58:13 +0000 (12:58 +0200)]
Allow programs to be part of the Ganeti library
Eventually this will help ensuring that clients and servers are of the
same version, as long as they're imported from the same path. Currently
it's relatively easy for gnt-* and ganeti-* to be from a different
version.
Scripts will be at ganeti.client.gnt_* and a small bootstrap script
calls a “Main” function from the module.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Tue, 26 Oct 2010 15:43:37 +0000 (17:43 +0200)]
Add master_capab to gnt-node modify
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Tue, 26 Oct 2010 15:36:35 +0000 (17:36 +0200)]
Implement the master_capable flag in node modify
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Tue, 26 Oct 2010 15:59:10 +0000 (17:59 +0200)]
Export the capability flags in query, rapi, ialloc
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Tue, 26 Oct 2010 12:05:56 +0000 (14:05 +0200)]
Add the master/vm_capable flags to objects
This adds the flag and some initial handling. The rest of the changes,
for cmdlib, come in a separate patch.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 26 Oct 2010 13:33:36 +0000 (15:33 +0200)]
Rework node role changes
There have been many bugs in gnt-node modify. Let's try to introduce
some more.
This patch reworks the node role changes from tracking the flag changes
to completely overwriting the flags based on the new role. This paves
the way for (in 2.4 or later) moving to a single attribute for nodes.
We compute the old role and the new role based on the required changes
and whether we need to auto-promote. Once this is done, the body of the
Exec() function becomes trivial (there's more code related to output
formatting than the node flag changes).
Another advantage of the new version is that the entire flags are
overwritten, and that all are changed at the same time, making it
impossible (harder?) to have partial updates.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Balazs Lecz [Tue, 26 Oct 2010 18:17:34 +0000 (19:17 +0100)]
Minor language fixes to the 2.3 design doc.
Signed-off-by: Balazs Lecz <leczb@google.com>
[dato@google.com: extracted language fixes from bigger patch.]
Signed-off-by: Adeodato Simo <dato@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Tue, 26 Oct 2010 11:59:22 +0000 (13:59 +0200)]
Add documentation about the capability flags
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Tue, 26 Oct 2010 13:02:35 +0000 (15:02 +0200)]
Enable failure on warnings in epydoc
This causes epydoc to fail on any warning.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 26 Oct 2010 13:02:01 +0000 (15:02 +0200)]
rpc: Work around epydoc warning
Aliasing the “threading” module allows us to avoid the “No information
available for ganeti.rpc._RpcThreadLocal's base threading.local” warning
by epydoc.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
René Nussbaumer [Tue, 26 Oct 2010 13:08:03 +0000 (15:08 +0200)]
Revert "Allow to specify wipe command and flags at configure time"
This reverts commit
6e991d0e64e36adf985d0512e4148bcd6a160c6a.
Conflicts:
lib/constants.py (this got already removed, so no changes in here)
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Tue, 26 Oct 2010 12:30:35 +0000 (14:30 +0200)]
Merge branch 'devel-2.2'
* devel-2.2:
Allow remote imports without checked names
ConfigWriter: Fix typo in error message parts
Fix remote imports
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 25 Oct 2010 16:37:52 +0000 (18:37 +0200)]
Allow remote imports without checked names
By default all names are checked (LUCreateInstance, name_check). In some
cases it can be useful to disable this check, but doing so was not
allowed for remote imports. One should be aware, however, that using
this feature can lead to rename script failures when importing a remote
instance without the proper name, e.g.:
“Failed to run rename script for inst1 on node node3.example.com: OS
rename script failed (exited with exit code 1), last lines in the log
file:\nCannot rename from inst2.example.com to inst1:\nInstance has a
different hostname (inst2)”
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Tue, 26 Oct 2010 11:46:36 +0000 (13:46 +0200)]
Update NEWS
This add my recent changes for support of wiping disks prior to
allocation as a new feature to the NEWS file
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Tue, 26 Oct 2010 11:13:33 +0000 (13:13 +0200)]
Support modify of prealloc_wipe_disks config value
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Mon, 25 Oct 2010 12:08:40 +0000 (14:08 +0200)]
Export a node's group information in iallocator
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Mon, 25 Oct 2010 11:21:00 +0000 (13:21 +0200)]
Rename node.nodegroup to node.group
In the context of a node, its group has (at least today) only one
meaning, that is the node's node group. As such, we rename
node.nodegroup to just node.group.
Note: if we want to keep node in there, it should be at least
node_group, for consistency with the other node attributes.
Similarly, we rename the OpAddNode nodegroup attribute to group.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Mon, 25 Oct 2010 11:19:44 +0000 (13:19 +0200)]
Rename --nodegroup to --node-group
For consistency with other CLI options.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Mon, 25 Oct 2010 11:11:08 +0000 (13:11 +0200)]
Export node group data in iallocator
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Mon, 25 Oct 2010 11:00:00 +0000 (13:00 +0200)]
Split IAllocator._ComputeClusterData
The node and instance computations were all in this big function; we
separate them out for more clarity.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Mon, 25 Oct 2010 14:40:37 +0000 (16:40 +0200)]
Putting the pieces together and invoke the wipe in cmdlib
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Mon, 25 Oct 2010 14:32:31 +0000 (16:32 +0200)]
Adding RPC call for blockdev_wipe
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Mon, 25 Oct 2010 14:30:34 +0000 (16:30 +0200)]
Second iteration over backend.BlockdevWipe
This patch now uses dd entirely to wipe the disk, make it
much easier to wipe in blocks so we can give interactive feedback
about the status.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 22 Oct 2010 16:07:39 +0000 (18:07 +0200)]
ConfigWriter: Fix typo in error message parts
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Mon, 25 Oct 2010 10:06:20 +0000 (12:06 +0200)]
Simplify and extend the instance OS env
Some parameters were missing (uuid, c/mtime). We simplify the export
method; unfortunately we cannot simply iterate over __slots__ since the
mapping is not 1:1.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 22 Oct 2010 14:53:29 +0000 (16:53 +0200)]
Fix QA mixup of node/instance tests
There are two node tests that are run from RunCommonInstanceTests, which is the
bad place—it causes these node tests to be run three times instead of once.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 22 Oct 2010 13:54:52 +0000 (15:54 +0200)]
ConfigWriter: prevent using a foreign config
If the configuration file doesn't denote this node as master, we prevent
startup. This would have detected our previous race condition more
easily, hence we add it as a permanent check.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 22 Oct 2010 13:40:29 +0000 (15:40 +0200)]
Fix bootstrap.MasterFailover race with watcher
This fixes a recently diagnosed race condition between master failover
and the watcher.
Currently, the master failover first stops the master daemon, checks
that the IP is no longer reachable, and then distributes the updated
configuration. Between the stop and the distribution, it can happen that
the watcher starts the master daemon on the old node again, since ssconf
still points the master to it (and all nodes vote so).
In even more weird cases, the master daemon starts and before it manages
to open the configuration file, it is updated, which means the master
will respond to QueryClusterInfo with another node as the real master.
This patch reorders the actions during master failover:
- first, we redistribute a fixed config; this means the old master will
refuse to update its own config file and ssconf, and that most jobs
that change state will fail to finish
- we then immediately kill it; after this step, the watcher will be
unable to start it, since the master will refuse startup
- and only then we check for IP reachability, etc.
I've tested the new version against concurrent launch of the watcher;
while my tests are not very exhaustive, two things can happen: watcher
see the daemons as dead, and tries to restart them, which also fail; or
it simply get an error while reading from the master daemon. Both these
should be OK.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 22 Oct 2010 12:33:14 +0000 (14:33 +0200)]
ConfigWriter: protect against multiple writers
This should fix the case where there are two masters that both try to
distribute the configuration file to the cluster. The first one that does so,
will "win" the ownership of the config.data.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 22 Oct 2010 12:40:13 +0000 (14:40 +0200)]
backend.Upload: switch to utils.SafeWriteFile
This allows serialization of updates to a given file, with respect to
other cooperating writers.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 22 Oct 2010 12:29:47 +0000 (14:29 +0200)]
Add a "safe" file wrapper over WriteFile
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 22 Oct 2010 12:00:35 +0000 (14:00 +0200)]
Add functions to read and compare file 'ID's
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Wed, 20 Oct 2010 18:10:21 +0000 (20:10 +0200)]
LUSetInstanceParams: Remove unused attribute
“os_new” is not used anywhere, removing it.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Thu, 21 Oct 2010 12:19:19 +0000 (14:19 +0200)]
Adding backend method to wipe a block device
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Thu, 21 Oct 2010 12:51:51 +0000 (14:51 +0200)]
Allow to specify wipe command and flags at configure time
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 22 Oct 2010 07:59:03 +0000 (09:59 +0200)]
Fix remote imports
A simple typo…
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Fri, 22 Oct 2010 08:12:39 +0000 (10:12 +0200)]
Fix typo introduced in 8d8c4ef
Commit 8d8c4ef broke instance reinstall with different OS, due to an
attribute typo.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
René Nussbaumer [Thu, 21 Oct 2010 13:01:32 +0000 (15:01 +0200)]
Adjust the error message of setup-ssh if join check fails
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 21 Oct 2010 10:28:33 +0000 (12:28 +0200)]
Fix clearing of the default iallocator
And also update the man page.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Wed, 20 Oct 2010 18:13:49 +0000 (20:13 +0200)]
gnt-instance reinstall: Allow overriding OS parameters
This allows OS installation scripts to make use of special parameters,
e.g. to retain some data on reinstallation.
The RAPI resource is not updated as it takes all parameters via the
query string and encoding arbitrary data in a query string is tricky.
The resource will need to be changed to use the POST body instead.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 20 Oct 2010 12:51:53 +0000 (14:51 +0200)]
Add option to ignore offline node on instance start/stop
In some cases it can be useful to mark as an instance as started
or stopped while its primary node is offline. With this patch,
a new option, “--ignore-offline”, is introduced to “gnt-instance
start” and “… stop”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 19 Oct 2010 14:47:16 +0000 (16:47 +0200)]
utils: Add function to find items in dictionary using regex
This basically extracts a small piece of code from ganeti-rapi and puts
it into a utility function. RAPI resources are found using a dictionary
in which the keys can either be static strings or compiled regular
expressions. This might be handy in other places, hence extracting it
and adding unittests.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Tue, 19 Oct 2010 16:14:00 +0000 (18:14 +0200)]
QA RAPI: Test HTTP 404 and 501
This tests the HTTP Not Found and Not Implemented errors.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 20 Oct 2010 12:04:32 +0000 (14:04 +0200)]
QA: Add test for “gnt-node modify”
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Tue, 12 Oct 2010 11:39:43 +0000 (13:39 +0200)]
Let gnt-cluster support prealloc_wipe_disks
This includes a new option gnt-cluster init and approriate output
on gnt-cluster info. Though gnt-cluster modify is not yet prepared.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 19 Oct 2010 11:39:11 +0000 (13:39 +0200)]
Merge branch 'devel-2.2'
* devel-2.2:
Bump version to 2.2.1, update NEWS
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 19 Oct 2010 11:26:40 +0000 (13:26 +0200)]
Bump version to 2.2.1, update NEWS
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 15 Oct 2010 15:29:12 +0000 (17:29 +0200)]
Merge branch 'devel-2.2'
* devel-2.2:
http.client: Disable SSL session ID cache
Crude workaround for pylint breakage
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Apollon Oikonomopoulos [Fri, 15 Oct 2010 05:55:59 +0000 (08:55 +0300)]
http.client: Disable SSL session ID cache
This patch disables the SSL session ID cache for all cURL operations.
This is needed because http.HttpBase's PyOpenSSL implementation does not
currently set a context using SSL_set_session_id_context(3SSL), cURL
tries to re-use the session ID and, according to
SSL_set_session_id_context(3SSL):
If the session id context is not set on an SSL/TLS server and client
certificates are used, stored sessions will not be reused but a fatal
error will be flagged and the handshake will fail.
Ideally, session caching should be either controlled, or disabled in
HttpBase, however PyOpenSSL does not seem to implement
SSL_CTX_set_session_cache_mode nor SSL_CTX_set_session_id_context which
are used for these purposes (it seems that only M2Crypto's SSL module
supports these).
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Apollon Oikonomopoulos [Fri, 15 Oct 2010 05:55:59 +0000 (08:55 +0300)]
http.client: Disable SSL session ID cache
This patch disables the SSL session ID cache for all cURL operations.
This is needed because http.HttpBase's PyOpenSSL implementation does not
currently set a context using SSL_set_session_id_context(3SSL), cURL
tries to re-use the session ID and, according to
SSL_set_session_id_context(3SSL):
If the session id context is not set on an SSL/TLS server and client
certificates are used, stored sessions will not be reused but a fatal
error will be flagged and the handshake will fail.
Ideally, session caching should be either controlled, or disabled in
HttpBase, however PyOpenSSL does not seem to implement
SSL_CTX_set_session_cache_mode nor SSL_CTX_set_session_id_context which
are used for these purposes (it seems that only M2Crypto's SSL module
supports these).
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 15 Oct 2010 14:48:26 +0000 (16:48 +0200)]
Crude workaround for pylint breakage
The way we currently call pylint, the exact order it inspect modules in
lib/http/ depends on the filesystem order. This is not good, and if
lib/http/server.py is loaded before lib/http/__init__.py, it will throw
a "R0921:763:HttpMessageReader: Abstract class not referenced" (as that
class is used in server.py).
For the short-term fix, we just add server.py after "ganeti", so that
it gets parsed (again?) and pylint sees the usage of the class.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Fri, 15 Oct 2010 14:19:54 +0000 (16:19 +0200)]
http.auth: Fix docstring error
This was missing from commit
2287b920.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 15 Oct 2010 14:19:08 +0000 (16:19 +0200)]
devnotes.rst: Remove hardcoded Python version
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 14 Oct 2010 12:29:24 +0000 (14:29 +0200)]
Merge branch 'stable-2.2'
* stable-2.2:
Release 2.2.1~rc1
Require aclocal 1.11.1 or above for devel/release
Revert "Require aclocal 1.11.1 or above for autogen.sh"
Add mising --units in gnt-instance list man page
Set list of trusted SSL CAs for client to verify
Require aclocal 1.11.1 or above for autogen.sh
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>