Statistics
| Branch: | Tag: | Revision:

root / lib / cmdlib.py @ 6b7d5878

History | View | Annotate | Download (326.5 kB)

# Date Author Comment
6b7d5878 03/15/2010 06:40 pm Michael Hanselmann

Rightname confd's HMAC key

Currently, the ganeti-confd's HMAC key is called “cluster HMAC key” or
simply “HMAC key” everywhere. With the implementation of inter-cluster
instance moves, another HMAC key will be introduced for signing critical
data. They can not be the same, so this patch clarifies the purpose of the...

2f414c48 03/15/2010 05:38 pm Iustin Pop

Implement conversion from drbd to plain

This is much simpler than the opposite, with fewer possibilities of
failures.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

e29e9550 03/15/2010 05:38 pm Iustin Pop

Implement conversion from plain to drbd

This patch adds a new mode to instance modify, the changing of the disk
template. For now only plain to drbd conversion is supported, and the
new secondary node must be specified manually (no iallocator support).

The procedure for conversion works as follows:...

31624382 03/15/2010 05:29 pm Iustin Pop

Abstract check that an instance is down

Multiple LUs require that an instance is not running while they operate
on the instance (reinstall, rename, modify, recreate disks, deactivate
disks). The code to do this check is duplicate many times, and not very...

701384a9 03/15/2010 05:29 pm Iustin Pop

Abstract node free disk space check

Both create instance and grow disk check the free disk space on nodes
using the same, duplicate code. Since we'll need this in other places in
the future, we abstract the check into a new function.

The patch adjusts the error message to be more in-line with the one for...

5d55819e 03/15/2010 05:28 pm Iustin Pop

Abstract disk template verification

This is a simple check, but we'll need it in multiple places.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

c3589cf8 03/15/2010 05:17 pm Iustin Pop

LUCreateInstance: implement disk adoption mode

This new mode, valid only for the plain template disk, allows creation
of an instance based on existing logical volumes (preserving data),
rather than creation of new volumes and OS creation.

The new mode works as follows:...

df4272e5 03/15/2010 05:16 pm Iustin Pop

LUCreateInstance: Move parameter init earlier

This way, the parameters are available in CheckArguments too.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

b98bf262 03/12/2010 05:44 pm Michael Hanselmann

Verify cluster certificates in LUVerifyCluster

When using pyOpenSSL 0.7 or above, LUClusterVerify will start to show a
warning 30 days before a certificate expires. 7 days before the
certificate expires, the warning becomes an error. Once expired,
LUVerifyCluster will always report an error. The latter is also supported...

d3100055 03/12/2010 05:44 pm Michael Hanselmann

Add constant with cluster X509 certificates

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

3ab991a4 03/12/2010 03:32 pm Iustin Pop

Merge branch 'stable-2.1' into devel-2.1

  • stable-2.1:
    Release version 2.1.1
    Update NEWS file for the 2.1.1 release
    Validate the os-specific hypervisor parameters

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

0cf5e7f5 03/12/2010 11:33 am Iustin Pop

Improve cluster verify with hypervisor errors

In case the hypervisor has issues on one node, currently
backend.VerifyNode will exit via an exception (two exit paths possible,
one via HypervisorError from hypervisor.Verify(), and one via RPCFail
from GetInstanceList). This is bad as it invalidates all other checks of...

92c1b5d6 03/11/2010 05:07 pm Iustin Pop

Fix cluster verify with simulate-errors

In simulate errors mode, the test "ntime_diff is not None" will be
ignored, and thus a None value will try to be formatted as %.01f. We
workaround this by formatting it before, and then only using %s, which
can format a 'None' value....

cced4c39 03/11/2010 11:03 am Iustin Pop

Validate the os-specific hypervisor parameters

This adds a validation similar to the one for cluster-wide hypervisor
paramters.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

601908d0 03/09/2010 06:07 pm Iustin Pop

Rework the node modify for mc-demotion

The current code in LUSetNodeParms regarding the demotion from master
candidate role is complicated and duplicates the code in ConfigWriter,
where such decisions should be made. Furthermore, we still cannot demote
nodes (not even with force), if other regular nodes exist....

6d7b472a 03/09/2010 04:56 pm Iustin Pop

Fix typo that makes cluster verify to ignore hooks

The return from LUVerifyCluster should be True (or equivalent) for pass,
and False (or equivalent) for fail. The HooksCallBack function uses '1'
(= True) when a hook fails, which is exactly the opposite of what we...

6819dc49 03/09/2010 03:27 pm Iustin Pop

Fix redistribute config and offline nodes

We need to manually filter out offline nodes before using
rpc.call_upload_file and rpc.call_write_ssconf_files, since these method
are static (they work without a ConfigWriter instance) and thus do not
know which nodes are offline and which are not)....

17463d22 03/09/2010 02:27 pm René Nussbaumer

Add support for per-os-hypervisor parameters

This patch implements all modifications to support per-os-hypervisor
parameters in the framework.

Signed-off-by: René Nussbaumer <>
Signed-off-by: Michael Hanselmann <>
Reviewed-by: Michael Hanselmann <>

44caf5a8 03/08/2010 03:53 pm Iustin Pop

Validate the hostnames at creation time

This patch adds validation of new names used, i.e. at cluster init time,
node add time, and instance creation.

For instances, especially when using «--no-name-check» (which skips DNS
checks), we should validate the give name, and also normalize it...

cb7c0198 03/08/2010 03:49 pm Iustin Pop

Implement disabling of file-based storage

Rationale: the file-based storage backend can add/remove files under a
certain directory. However, the master node is also controlling the
setting of the file-based root directory, so basically it means we can't
prevent arbitrary modifications by the master of the node's filesystem....

c4feafe8 03/08/2010 03:48 pm Iustin Pop

Switch from os.path.join to utils.PathJoin

This passes a full burnin with lots of instances, and should be safe as
we mostly to join a known root (various constants) to a run-time
variable.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

467c1078 02/26/2010 04:23 pm Guido Trotter

Merge branch 'stable-2.1' into devel-2.1

  • stable-2.1:
    Add NLD constants to Ganeti
    Fix two potentially endless loops in http library
    Fix bug in LUQueryConfigValues
    Fix typo in LUVerifyCluster when checking node time

Signed-off-by: Guido Trotter <>...

cac599f1 02/26/2010 02:38 pm Michael Hanselmann

Fix bug in LUQueryConfigValues

LUQueryConfigValues supports multiple output fields. If the client asked
for the watcher pause status, it would not get a list, but simply the
value.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

30bb62ea 02/25/2010 03:16 pm Michael Hanselmann

Fix typo in LUVerifyCluster when checking node time

The first argument to _ErrorIf should always be True in this case.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

f7e7689f 02/22/2010 02:50 pm Iustin Pop

Add LUNodeEvacuationStrategy

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

823a72bc 02/22/2010 02:50 pm Iustin Pop

Implement support for mevac in OpTestAllocator

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

7f60a422 02/22/2010 02:50 pm Iustin Pop

Implement IAllocator multi-evacuate mode

This is a new mode that request a solution for the evacuation of
multiple nodes. The external script will be fed a list of names, and is
expected to return a list of [instance, new_node(s)] lists, detailing
the evacuation path of each instance....

680f0a89 02/22/2010 02:50 pm Iustin Pop

Accept both 'nodes' and 'result from iallocator

This patch switches the default result key from 'nodes' to 'result'. The
old name is still accepted for backwards-compatiblity, and should be
removed in later versions.

Signed-off-by: Iustin Pop <>...

8d3f86a0 02/22/2010 02:50 pm Iustin Pop

Change internal API for the IAllocator class

Currently the 'name' parameter in the constructor is required (as a
non-keyword argument). Since the (to follow) node evac IAllocator mode
doesn't have 'name' as a valid argument, we're moving this one into the...

9757cc90 02/22/2010 02:50 pm Iustin Pop

Remove redundant code in IAllocator class

This moves the setting of the request member on the in_data, of the
request type, and of the branching basef on request type outside of
individual functions and directly into the constructor.

Since the values we're using externally are identical to the...

61dabca4 02/17/2010 08:08 pm Iustin Pop

Simplify a bit _GetWantedNodes

This should have been done in the _ExpandNodeName patch.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

083a91c9 02/17/2010 06:41 pm Iustin Pop

Fix a wrong docstring

There's no such thing as OpProgrammerError (I found this as I wrote it
in code in another place, and pylint complained).

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

cf26a87a 02/17/2010 03:07 pm Iustin Pop

Remove boiler-plate code about node/instance names

Currently we have lots of duplication of the error-checking (and proper
exception raising) around node/instance name expansion. LUCreateInstance
is the only place where we have abstracted this.

This patch creates two functions (ExpandNodeName and ExpandInstanceName)...

d5cd389c 02/15/2010 04:42 pm Iustin Pop

Release all node locks during disk replace

This patch extends commit 7ea7bcf by releasing all node locks in disk
replace for the early release mode. The rationale behind this is:

- LUCreateInstance already releases all node locks while waiting for
disk synchronization, and does an instance startup later...

9af0fa6a 02/15/2010 12:27 pm Iustin Pop

Auto-enable early release for offline old nodes

In case the old node is offline, we won't be able to talk to it to
remove the storage, and in most cases the node is powered
off/unreachable.

In this case, it makes no sense to delay the storage release, so we...

abd8e836 02/11/2010 06:00 pm Iustin Pop

Run instance hooks on more nodes

This should fix issue 68: some hooks should be run on more nodes than
currently. GrowDisk runs on both nodes, remove run the post hook on the
instance's nodes, and failover and migrate run the post hook on the
source node too....

08eec276 02/11/2010 06:00 pm Iustin Pop

Add {NEW,OLD}_{PRIMARY,SECONDARY} vars to hooks

Per issue 71, the migrate and failover need special variables for
keeping the nodes consistent during instance migrations.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

dd713605 02/11/2010 01:50 pm Iustin Pop

Pass debug mode to noded for OS-related calls

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

ee844e20 02/11/2010 01:46 pm Iustin Pop

Add a generic 'debug_level' attribute to opcodes

Also automatically fix opcodes which have this missing in the LU init
routine.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

7ea7bcf6 02/09/2010 12:04 pm Iustin Pop

Add an early release lock/storage for disk replace

This patch adds an early_release parameter in the OpReplaceDisks and
OpEvacuateNode opcodes, allowing earlier release of storage and more
importantly of internal Ganeti locks.

The behaviour of the early release is that any locks and storage on all...

4c06a2d0 02/08/2010 04:04 pm Iustin Pop

Merge branch 'stable-2.1' into devel-2.1

  • stable-2.1:
    TLReplaceDisks: Delay iallocator when evacuating node
    Implement debug level across OS-related RPC calls
    Second try to fix LUVerifyCluster
    LUVerifyCluster: Fix bug with offline nodes
    utils: Fix retry delay calculator...
94a1b377 02/08/2010 01:35 pm Michael Hanselmann

TLReplaceDisks: Delay iallocator when evacuating node

When evacuating nodes, the iallocator was run for all
instances without taking planned changes into consideration.
This patch delays part of CheckPrereq and running the
iallocator for node evacuation....

4a0e011f 02/03/2010 07:04 pm Iustin Pop

Implement debug level across OS-related RPC calls

This doesn't implement the full functionality, we need to add the debug
level to the opcodes too, but at least won't require changing the RPC
calls during the 2.1 series.

Signed-off-by: Iustin Pop <>...

dd9e9f9c 02/03/2010 03:55 pm Michael Hanselmann

Second try to fix LUVerifyCluster

My previous patch, commit 785d142, fixed the case where a node is marked
offline. With this patch it'll also handle other failures correctly.

  • Hooks Results
    - ERROR: node node2.example.com: Communication failure in hooks...
785d142e 02/03/2010 03:01 pm Michael Hanselmann

LUVerifyCluster: Fix bug with offline nodes

[…] * Other Notes
- NOTICE: 1 offline node(s) found. * Hooks Results
Failure: command execution error:
iteration over non-sequence

Commit a0c9776a introduced an error simulation mode to LUVerifyCluster.
Due to a small mistake, offline nodes weren't skipped when checking the...

9f53d9ce 02/01/2010 02:55 pm Michael Hanselmann

Merge remote branch 'origin/stable-2.1' into devel-2.1

  • origin/stable-2.1:
    Bump version to 2.1.0~rc5
    Fix missing bridge for xen instances
    Fix flipping MC flag bug
    ganeti-watcher: ensure confd is running as well
cea0534a 01/28/2010 04:46 pm Guido Trotter

Fix flipping MC flag bug

Currently unofflining or undraining an already functional master
candidate node, can cause it to demote itself. In order to avoid that we
only trigger the self-promotion check if the node is not currently a
candidate.

Signed-off-by: Guido Trotter <>...

4c1a504b 01/26/2010 02:58 pm Iustin Pop

Merge branch 'devel-2.0' into devel-2.1

  • devel-2.0:
    Fix the mocks.py for 2.0 unittests
    LURemoveNode safety in face of wrong node list
    Fix an unsafe formatting bug
    Ensure all int/float conversions are handled right

Conflicts:
lib/backend.py - trivial merge...

9bb31ea8 01/25/2010 06:17 pm Iustin Pop

LURemoveNode safety in face of wrong node list

LURemoveNode runs under the BGL, which means we're guaranteed that the
list of nodes as retrieved in CheckPrereq is still valid in
BuildHooksEnv. However, we can make Ganeti handle failures in case the
locking is broken (or the node list has been modified otherwise) easily,...

691744c4 01/25/2010 06:16 pm Iustin Pop

Ensure all int/float conversions are handled right

int()/float() can raise either ValueError (in case of int("a")), or
TypeError (in case of int(None)). We had many bugs over time due to
this, and a recent one was just diagnosed, so we go over the codebase...

82187135 01/11/2010 02:25 pm René Nussbaumer

Normalize MAC addresses to all lower.

This change will normalize the MAC to all lower after validation.

Signed-off-by: René Nussbaumer <>
Signed-off-by: Iustin Pop <>
Reviewed-by: Iustin Pop <>

47a72f18 01/05/2010 02:39 pm Iustin Pop

LURenameCluster: run post hook on all nodes

Since the cluster name might be used for various purposes on nodes, we
should let all nodes "know" about a cluster rename by running the post
hook on all nodes. This will make cluster rename slightly
slower/costlier, but it is not/shouldn't be an operation that is run...

2d54e29c 01/04/2010 11:17 am Iustin Pop

Further pylint disables, mostly for Unused args

Many of our functions have to follow a given API, and thus we have to
keep a given signature, but pylint doesn't understand this. Therefore,
we silence this warning.

The patch does a few other cleanups.

Signed-off-by: Iustin Pop <>...

857121ad 01/04/2010 11:16 am Iustin Pop

LUDiagnoseOS._DiagnoseByOS: remove unused arg

The node_list argument to _DiagnoseByOS is not used, and is obsoleted by
the fact that the rlist argument already has the valid nodes as keys
(assuming RPC behaviour didn't change). Thus, we remove it and silence...

7e950d31 01/04/2010 11:16 am Iustin Pop

Convert to static methods (where appropriate)

Many methods are simple pure functions, and not depending on the object
state. We convert these to staticmethods.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

7260cfbe 01/04/2010 11:15 am Iustin Pop

Add targeted pylint disables

This patch should have only:

- pylint disables
- docstring changes
- whitespace changes

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

d1b83918 01/04/2010 11:10 am Iustin Pop

Fix an error message

Detected by an 'Unused variable' warning.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

1122eb25 01/04/2010 11:10 am Iustin Pop

Remove many 'Unused variable' warnings

Note there are some cases left which need extra cleanup.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

d984846d 12/28/2009 02:05 pm Iustin Pop

Merge branch 'devel-2.0' into devel-2.1

  • devel-2.0:
    Fix indentation in hv_kvm
    Implement BuildHooksEnv for NoHooksLU
    Clarifiy some more wide pylint disables
    Fix two bugs in seldom-used codepaths
    Update pylintrc
    Add targetted pylint disables
    Partial cherry-pick of 6c881c5 from the 2.1 branch...
fe267188 12/28/2009 12:43 pm Iustin Pop

Add targetted pylint disables

This patch adds targeted pylint disables, where it makes sense (either
due to limitations in pylint or due to historical usage), and also a few
blanket ones in rapi where all the names are… “different”.

Signed-off-by: Iustin Pop <>...

4c4b5058 12/28/2009 12:43 pm Iustin Pop

Fix two bugs in seldom-used codepaths

New version of pylint, new bugs found!

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

c70d2d9b 12/28/2009 12:43 pm Iustin Pop

Clarifiy some more wide pylint disables

This removes/updates some module-wide pylint disables.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

fc8a6b8f 12/28/2009 12:43 pm Iustin Pop

Implement BuildHooksEnv for NoHooksLU

This just adds a stub function that raises an assertion error; this
accomplishes two things:

- silences many pylint warnings
- if we ever stumble upon this, a specific assertion error is
(hopefully) clearer than just a not implemented error...

fa05c92d 12/16/2009 04:10 pm Iustin Pop

Merge branch 'stable-2.1' into devel-2.1

  • stable-2.1:
    Bump version to 2.1.0~rc2
    Update NEWS file and release Ganeti 2.0.5
    Security issue: add validation of script names
    Move the hooks file mask into constants.py
    Improve LUQueryNodes for lockless case...
5c0433d6 12/16/2009 04:06 pm Iustin Pop

Merge branch 'stable-2.0' into stable-2.1

  • stable-2.0:
    Update NEWS file and release Ganeti 2.0.5
    Security issue: add validation of script names
    Move the hooks file mask into constants.py
    Improve LUQueryNodes for lockless case
    Ship rapi.rst/rapi.html in the dist archive...
18c8f361 12/16/2009 11:54 am Iustin Pop

CreateInstance: allow no ip check with start mode

Since gnt-instance start doesn't do any checks on the IP, it doesn't
make much sense to do so in instance create (with start) if the user
expressly passes in ‘--no-ip-check’. Removing this requirement eases the...

5f23e043 12/16/2009 11:54 am Iustin Pop

Op/LUCreateInstance support for (no) name checks

This adds a new opcode parameter ‘name_check’ (similar to ip_check) that
is not required to be present (to easy backwards compatibility for
tools).

It also adds a CheckArguments to LUCreateInstance and changes the...

4dfd6266 12/14/2009 05:34 pm Iustin Pop

Improve LUQueryNodes for lockless case

In most uses of LUQueryNodes, we don't take a lock. This means that the
instance data is not protected across GetInstanceList and
GetInstanceInfo, and this can lead to instances not existing anymore.

Switching to GetAllInstanceInfo means that we get a single,...

313b2dd4 11/30/2009 04:34 pm Michael Hanselmann

gnt-cluster verify: Warn if node time diverges too far

The warning will be generated if the clocks diverge by more
than 150 seconds. Due to the way the RPC system works, we
cannot get exact time differences, e.g. if one of the
queried nodes is broken. The comparision is done using a...

5bc556dd 11/26/2009 05:29 pm Michael Hanselmann

cmdlib: Work around race condition in DRBD before version 8.0.13

DRBD goes into sync mode for a short amount of time after
executing the "resize" command. DRBD 8.x below version
8.0.13 contains a bug whereby calling "resize" in sync
mode fails.

Signed-off-by: Michael Hanselmann <>...

1f864b60 11/25/2009 04:30 pm Iustin Pop

Remove quotes from CommaJoin and convert to it

This patch removes the quotes from CommaJoin and converts most of the
callers (that I could find) to it. Since CommaJoin does str(i) for i in
param, we can remove these, thus simplifying slightly a few calls....

ab3e6da8 11/25/2009 01:45 pm Iustin Pop

Revert "Get rid of utils.CommaJoin"

This reverts commit 6915bc28fe053e92aa16cf2d974d205f1140219c based on thread on
ganeti-devel.

Conflicts:

lib/cmdlib.py (due to the error code classification, trivial)

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

b6c07b79 11/20/2009 01:43 pm Michael Hanselmann

Remove unused parameter “unlock” from cmdlib._WaitForSync

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

21bcb9aa 11/16/2009 06:52 pm Michael Hanselmann

Fix off-by-one error when modifying instance NIC

For an instance with exactly one NIC:

$ gnt-instance modify --net 1:ip=1.2.3.4 inst1
Failure: prerequisites not met for this operation:
error type: wrong_input, error details:
Invalid NIC index 1, valid values are 0 to 1...

b8716596 11/16/2009 03:58 pm Michael Hanselmann

Re-add check for duplicate instance IP

This was originally implemented in 0ce8f948 and partially
rolled back in 9b65e0d4. Apart from re-adding the check,
this patch does some housekeeping by renaming the “_helper”
function to “_AddIpAddress”.

Signed-off-by: Michael Hanselmann <>...

90b704a1 11/13/2009 02:07 pm Guido Trotter

Fix change of cluster nic parameters

To stay on the safe side, we check for errors in all instances, and
refuse to act, reporting on the errors we found, if there are any
problems.

Signed-off-by: Guido Trotter <>
Reviewed-by: Michael Hanselmann <>

beabf067 11/12/2009 07:29 pm Guido Trotter

Fix mispopulation of nic parameters at nic modify

There's a bug in Ganeti 2.1 rc0 that makes nic parameters be populated
from the "filled in" dict, even if we're not changing any values in
them. This patch fixes the problem, by populating them from the correct...

4fae38c5 11/06/2009 05:36 pm Guido Trotter

ConfigWriter: move _temporary_ids to reservation

In order to do this we need to pass a job id when reserving a resource.
We have one during _EnsureUUIDs because we passed it in from AddNode and
AddInstance. During config upgrade we use a fake job ID which we then...

36b66e6e 11/06/2009 05:36 pm Guido Trotter

ConfigWriter: move _temporary_macs to reservation

This solves the race conditions in mac reservation, as macs are actually
reserved, under the current ec id.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

afa1386e 11/06/2009 05:36 pm Guido Trotter

ConfigWriter: simplify GenerateDRBDSecret

We can do this by adding a new TemporaryReservationManager

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

0debfb35 11/06/2009 04:08 pm Guido Trotter

config.Add{Node,Instance}: get the ec id

This is ok because adding a node or instance cannot happen in a query.

We get the ec id from the LU and pass it to _EnsureUUID, which will
then for now not use it.

Signed-off-by: Guido Trotter <>...

7736a5f2 11/06/2009 01:42 pm Iustin Pop

Introduce 'global hypervisor parameters' support

This patch adds support for global hypervisor parameters in instance
creation, instance modification, instance query and at instance load
time.

We basically prevent any query on these parameters, discard them at load...

78212a5d 11/04/2009 05:35 pm Iustin Pop

TLMigrateInstance: add error messagess during Exec

Currently the migration of an instance doesn't show any error until the
end. We add two messages that show better the progress:

node1# gnt-instance migrate -f instance5
Wed Nov 4 04:04:34 2009 Migrating instance instance5...

104f4ca1 11/04/2009 01:54 pm Iustin Pop

Introduce a wrapper for hostname resolving

Currently a few of the LU's CheckPrereq use utils.HostInfo which raises
a resolver error in case of failure. This is an exception from the
standard that CheckPrereq should raise an OpPrereqError if the error is
in the 'pre' phase (so that it can be retried)....

099c52ad 11/03/2009 04:31 pm Iustin Pop

Another round of pylint-related style fixes

A newer version of pylint, more warnings…

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

d091393e 11/03/2009 01:45 pm Iustin Pop

Implement cluster verify checks for wrong PV names

Since ':' is not a valid character in PV names (for the way Ganeti uses
LVM), we need to check this and warn the user. This patch adds a new
NV_PVLIST cluster verify check and verifies the PV names returned from...

6bcb1446 11/03/2009 12:51 pm Michael Hanselmann

jqueue: Convert to utils.Retry

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

7e9c6a78 11/02/2009 04:14 pm Iustin Pop

Some improvements to gnt-node repair-storage

Currently the repair storage has two issues:

- down instances are aborting the operation, even though they should be
ignored (it's not technically possible to know their disk status
unless we would activate their disks)...

045dd6d9 11/02/2009 04:14 pm Iustin Pop

Add ecode to rpc.py's RpcResult.Raise()

This patch adds a new ecode argument to RpcResult.Raise(). This allows
specifying the error code (for both OpExec and OpPrereq errors).

Note that this patch also makes the OpExecError exceptions raised from
_FindFaultInstanceDisks have the error code classification....

5c983ee5 11/02/2009 04:14 pm Iustin Pop

Introduce two-argument style for OpPrereqError

This patch introduces a two-argument style for OpPrereqError. Only the
direct raise calls in cmdlib.py are converted, other users will follow.

cli.py is modified to handle both two-argument style and the current...

159d4ec6 11/02/2009 04:06 pm Iustin Pop

Remove the OpRetryError exception

This is only used in two places, in an error path that is no longer
valid since Ganeti 2.0. We remove the try..except since we should not
get it anymore (and if we do, then we should catch it in all
config.Update cases) and we remove the exception class completely....

3e53a60b 11/02/2009 02:07 pm Michael Hanselmann

Activate disks while exporting an instance

Exporting an instance not running or without activated disks
will fail. This patch makes sure to activate disks before
exporting an instance if it's in the ADMIN_down state.

Signed-off-by: Michael Hanselmann <>...

620a85fd 11/02/2009 10:22 am Iustin Pop

Unify the query fields for the storage framework

This patch unifies the query fields in the storage framework for all
types. Note that the information is still computed on-demand, so if e.g.
the used disk space is not requested for the ‘file’ type, it won't be...

1df79ce6 10/29/2009 06:06 pm Michael Hanselmann

Don't show warnings on ADMIN_down instance failover

Before:
$ gnt-instance failover -f inst1
… checking disk consistency between source and target
… - WARNING: Can't find disk on node node21.example.com
… shutting down instance on source node

After:
$ gnt-instance failover -f inst1...

c6f1af07 10/28/2009 03:49 am Iustin Pop

Fix another style issue

For the Nth time, re-fix shadowing of outer-scope variable :)

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

20eca47d 10/28/2009 03:22 am Iustin Pop

Fix an error handling case in TLReplaceDisks

pylint is your friend, since the compiler doesn't exist.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

a4eae71f 10/27/2009 03:14 pm Michael Hanselmann

Provide feedback from redistributing configuration

This is particularily useful for “gnt-cluster redist-conf”, but
also for all other cases where the configuration files are
rewritten on other nodes.

$ gnt-cluster redist-conf
… Copy of file /var/lib/ganeti/config.data to node … failed: Error while...

e9022531 10/27/2009 02:54 am Iustin Pop

Fix gnt-node evacuate w. iallocator

Commit 2bb5c911 moved around and changed the _RunAllocator function in
the DiskReplace → TaskLet conversion, but in the process it changed the
relocate_from argument from a list of nodes to just the secondary node.
This breaks the protocol and current iallocator scripts....

d52ea991 10/23/2009 12:01 pm Michael Hanselmann

cmdlib._AssembleInstanceDisks: Fix case where variable wouldn't be set

The “result” variable may not be set and/or come from the previous loop.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

b989b9d9 10/22/2009 04:40 pm Ken Wehr

Adding '--no-ssh-init' option to 'gnt-cluster init'.

Allows the initialization of a cluster without the creation or distribution
of SSH key pairs. Includes changes for LeaveCluster and RPC.

Signed-off-by: Ken Wehr <>
Signed-off-by: Guido Trotter <>...