ganeti-local
13 years agoconfig: Add method to get members of nodes' groups
Michael Hanselmann [Fri, 20 May 2011 13:35:28 +0000 (15:35 +0200)]
config: Add method to get members of nodes' groups

This will be used for locking during node evacuation.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoYet another attempt to fix builds
Iustin Pop [Wed, 25 May 2011 08:54:34 +0000 (10:54 +0200)]
Yet another attempt to fix builds

It seems that abs_top_srcdir is not a good option, so I tested again
with just using the same as in doc/examples/bash_completion.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoFix build breakage
Iustin Pop [Tue, 24 May 2011 16:46:39 +0000 (18:46 +0200)]
Fix build breakage

Sorry, I already had PYTHONPATH exported in my env, and as I said I
wasn't able to test this on buildbot.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoMerge branch 'devel-2.4'
Michael Hanselmann [Tue, 24 May 2011 16:50:13 +0000 (18:50 +0200)]
Merge branch 'devel-2.4'

* devel-2.4:
  node evac: don't call IAllocator if no instances

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agonode evac: don't call IAllocator if no instances
Iustin Pop [Tue, 24 May 2011 09:29:39 +0000 (11:29 +0200)]
node evac: don't call IAllocator if no instances

Currently we generate an empty list only for the '-n node' invocation,
but for iallocator we still call the iallocator (which needs an RPC
call, etc.). By moving the computation of instances outside of the if
block, we can return early from the LU.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoMerge branch 'devel-2.4'
Michael Hanselmann [Tue, 24 May 2011 16:35:56 +0000 (18:35 +0200)]
Merge branch 'devel-2.4'

* devel-2.4:
  RPC/Backend: Make UploadFile uid and gid agnostic
  Resolve uid/gid upon mainloop run
  GetEntResolver: Make it possible to resolve uid/gid to name
  utils.algo: Add InvertDict to invert a dict
  autotools: Add noded group

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agognt-debug: rename allocator to iallocator
Iustin Pop [Tue, 24 May 2011 09:34:32 +0000 (11:34 +0200)]
gnt-debug: rename allocator to iallocator

I'm always confused by this strange difference, so let's rename the
command to match what it tests.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoMisc other conversions
Iustin Pop [Thu, 19 May 2011 16:44:51 +0000 (18:44 +0200)]
Misc other conversions

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoConvert job status strings to constants
Iustin Pop [Thu, 19 May 2011 16:44:37 +0000 (18:44 +0200)]
Convert job status strings to constants

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoConvert group policies to constants
Iustin Pop [Thu, 19 May 2011 16:29:06 +0000 (18:29 +0200)]
Convert group policies to constants

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoReplace instance states hardcoded with constants
Iustin Pop [Thu, 19 May 2011 16:21:13 +0000 (18:21 +0200)]
Replace instance states hardcoded with constants

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoIAllocator.hs: replace a few strings with constants
Iustin Pop [Thu, 19 May 2011 16:18:22 +0000 (18:18 +0200)]
IAllocator.hs: replace a few strings with constants

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoImplement conversion of Python constants to Haskell
Iustin Pop [Thu, 19 May 2011 15:45:01 +0000 (17:45 +0200)]
Implement conversion of Python constants to Haskell

With the merge of the repositories, we can now auto-generate the code
for Haskell constants from the Python code.

Currently this only handles the basic types (strings and
integers). Handling containers such as lists and dictionaries is only
possible if we would use a parser such that we recognise the element
names. We could extend the convert-constants script if that becomes
necessary, right now I'm looking at just the simple constants such as
Iallocator modes, instance states, etc.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoRPC/Backend: Make UploadFile uid and gid agnostic
René Nussbaumer [Thu, 19 May 2011 08:37:58 +0000 (10:37 +0200)]
RPC/Backend: Make UploadFile uid and gid agnostic

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoResolve uid/gid upon mainloop run
René Nussbaumer [Fri, 20 May 2011 12:24:13 +0000 (14:24 +0200)]
Resolve uid/gid upon mainloop run

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoGetEntResolver: Make it possible to resolve uid/gid to name
René Nussbaumer [Wed, 18 May 2011 12:19:52 +0000 (14:19 +0200)]
GetEntResolver: Make it possible to resolve uid/gid to name

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoutils.algo: Add InvertDict to invert a dict
René Nussbaumer [Fri, 20 May 2011 12:17:29 +0000 (14:17 +0200)]
utils.algo: Add InvertDict to invert a dict

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoautotools: Add noded group
René Nussbaumer [Thu, 19 May 2011 11:41:52 +0000 (13:41 +0200)]
autotools: Add noded group

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoImprove hooks documentation unittest
Michael Hanselmann [Tue, 17 May 2011 16:12:27 +0000 (18:12 +0200)]
Improve hooks documentation unittest

Also check for the opcode ID.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoUpdate hooks.rst for cluster verify changes
Guido Trotter [Fri, 20 May 2011 14:30:21 +0000 (15:30 +0100)]
Update hooks.rst for cluster verify changes

Also update NEWS on this change.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoFix a couple of style mistakes
Guido Trotter [Fri, 20 May 2011 14:20:25 +0000 (15:20 +0100)]
Fix a couple of style mistakes

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoCluster verify: accept a --node-group option
Adeodato Simo [Tue, 3 May 2011 14:22:18 +0000 (15:22 +0100)]
Cluster verify: accept a --node-group option

This will trigger a ClusterVerifyGroup operation only on the specified
group, skipping other groups as well as cluster-wide verifications.

Signed-off-by: Adeodato Simo <dato@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoCluster verify: check for nodes/instances with no group
Adeodato Simo [Tue, 3 May 2011 14:22:17 +0000 (15:22 +0100)]
Cluster verify: check for nodes/instances with no group

Previously, all nodes and instances would *always* be visited/verified. By
driving the verification by node group now, we will miss nodes and
instances that can't be reached from existing node groups, should that rare
and bogus circumstance ever occur.

We safeguard against that by checking for unreachable nodes and instances
explicitly. (These will not be further verified.)

Signed-off-by: Adeodato Simo <dato@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoCluster verify: fix LV checks for split instances
Adeodato Simo [Tue, 3 May 2011 14:22:16 +0000 (15:22 +0100)]
Cluster verify: fix LV checks for split instances

When sharding by group, if a mirrored instance is split (primary and
secondary) between two groups, its volumes will not be properly checked:
the group of the primary will warn about a missing volume in the secondary,
and the group of the secondary about an unknown volume (in the secondary as
well).

To solve the "missing volumes" bit, we will detect this case and perform an
extra RPC verify call to these split secondaries (querying only for
NV_LVLIST), and introduce the results in the node images appropriately. We
do this detection early in ExpandNames/CheckPrereq, as to properly lock the
extra nodes.

As for the "unknown volumes" warning in the secondary, we update the volume
mapping with split instances before checking for orphaned volumes.

Finally, we mark nodes as "ghost" only if they really don't exist in the
cluster configuration, which avoid spurious "instance lives in ghost node"
warnings.

Signed-off-by: Adeodato Simo <dato@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoCluster verify: make NV_NODELIST smaller
Adeodato Simo [Tue, 3 May 2011 14:22:15 +0000 (15:22 +0100)]
Cluster verify: make NV_NODELIST smaller

To cope with increasing cluster sizes, we now make nodes try to contact all
other nodes in their group, and one node from every other group.

Signed-off-by: Adeodato Simo <dato@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoCluster verify: verify hypervisor parameters only once
Adeodato Simo [Tue, 3 May 2011 14:22:14 +0000 (15:22 +0100)]
Cluster verify: verify hypervisor parameters only once

The list of all hypervisor parameters has to be computed in
LUClusterVerifyGroup, since it needs to be passed to nodes as
NV_HVPARAMS. However, it is better only to verify said parameters once,
out of LUClusterVerifyConfig.

For this, we refactor the code that constructs the list of parameters to a
module-level _GetAllHypervisorParameters() function that both LUs can use.

Signed-off-by: Adeodato Simo <dato@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoSplit LUClusterVerify into LUClusterVerify{Config,Group}
Adeodato Simo [Tue, 3 May 2011 14:22:13 +0000 (15:22 +0100)]
Split LUClusterVerify into LUClusterVerify{Config,Group}

With this change, LUClusterVerifyConfig becomes a "light" LU that only
verifies the global config and other, master-only settings, and the bulk of
node/instance verification is done by LUClusterVerifyGroup, which only acts
on nodes and instances of a given group.

To ensure that `gnt-cluster verify` continues to operate on the whole
cluster, the client creates an OpClusterVerifyGroup job per node group; for
convenience, the list of node groups is returned by LUClusterVerifyConfig.

Signed-off-by: Adeodato Simo <dato@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoCluster verify: factor out error codes and functions
Adeodato Simo [Tue, 3 May 2011 14:22:12 +0000 (15:22 +0100)]
Cluster verify: factor out error codes and functions

We move all error code definitions, plus the _Error and _ErrorIf helpers,
to a private _VerifyErrors mix-in class that can be later shared by the new
two cluster verify LUs.

(_Error and _ErrorIf code was moved around verbatim, except to disable
"_VerifyError class does not have 'op' or '_feedback_fn' members" errors
from pylint.)

Signed-off-by: Adeodato Simo <dato@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoCluster verify: make "instance runs in wrong node" node-driven
Adeodato Simo [Tue, 3 May 2011 14:22:11 +0000 (15:22 +0100)]
Cluster verify: make "instance runs in wrong node" node-driven

Previously, the "instance should not be running in this node" error was
computed by verifying, for each instance, whether any node other than its
primary was running it. But this is not a well-suited approach if we were
to shard cluster verification (because, for each instance, we won't have
information whether it's running *outside* the current set of nodes).

By reversing the logic of the check, and asking instead, for each node,
"is it running any instance for which it's not primary", we catch all
occurrences of the problem even if running sharded.

Because of this, we can also detect orphan instances at the same time
(instances that are not known in the cluster config). We warn about them
here too, and drop the later _VerifyOrphanInstances check.

Signed-off-by: Adeodato Simo <dato@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoVerify an absent vm_capable node for files
Guido Trotter [Mon, 16 May 2011 15:22:50 +0000 (16:22 +0100)]
Verify an absent vm_capable node for files

If we're not verifying all nodes, adding a node outside the current
group for file checksums helps us making sure checksums are the same in
all of the cluster.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoCluster verify: master must be present for _VerifyFiles
Adeodato Simo [Tue, 3 May 2011 14:22:10 +0000 (15:22 +0100)]
Cluster verify: master must be present for _VerifyFiles

This commit prepares the call to _VerifyFiles for the case when the master
node is not one of the nodes that's being verified (which will be the case
for all node groups but one). We fix it by always passing master info and
checksums to _VerifyFiles, which ensures there's a cluster-wide consistency
check.

Signed-off-by: Adeodato Simo <dato@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoCluster verify: don't assume we're verifying all nodes/instances
Adeodato Simo [Tue, 3 May 2011 14:22:09 +0000 (15:22 +0100)]
Cluster verify: don't assume we're verifying all nodes/instances

This commit fixes a few initial simple cases in which it was assumed that
we're always working over the whole cluster. With this change, we
differentiate between "nodes/instances to verify" and "checks that need
cluster-wide information".

In particular:

  - retrieve hypervisor parameters always from all instances
  - always specify full node list in NV_NODELIST
  - retrieve OOB path from all nodes
  - verify DRBD devices against the full set of instances (this ensures
    minors get properly verified even if an instance is split between groups)
  - look up node groups against the set of all nodes (to avoid tracebacks
    in case instances are split between groups)
  - determine whether running instances are unknown by checking against the
    full list of instances

Behavior in all cases stays the same if still running over the whole
cluster.

Signed-off-by: Adeodato Simo <dato@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoCluster verify: gather node/instance list in CheckPrereq
Adeodato Simo [Tue, 3 May 2011 14:22:08 +0000 (15:22 +0100)]
Cluster verify: gather node/instance list in CheckPrereq

This commit introduces no behavior changes, and is only a minor refactoring
that aids with a cleaner division of future LUClusterVerify work. The
change consists in:

  - substitute the {node,instance}{list,info} structures previously created
    in Exec() by member variables created in CheckPrereq; and

  - mechanically convert all references to the old variables to the new
    member variables.

Creating both self.all_{node,inst}_info and self.my_{node,inst}_info, both
with the same contents at the moment, is not capricious. We've now made
Exec use the my_* variables pervasively; in future commits, we'll break the
assumption that all nodes and instances are listed there, and it'll become
clear when the all_* variables have to be substituted instead.

Signed-off-by: Adeodato Simo <dato@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoMerge remote branch 'origin/devel-2.4'
Iustin Pop [Fri, 20 May 2011 07:33:29 +0000 (09:33 +0200)]
Merge remote branch 'origin/devel-2.4'

* origin/devel-2.4:
  Fix errors in hooks documentation
  Clarify a bit the noded man page
  Note --no-remember in NEWS
  Switch QA over to using instance stop --no-remember
  Implement no_remember at RAPI level
  Implement no_remember at CLI level
  Introduce instance start/stop no_remember attribute
  Bump version for the 2.4.2 release
  Fix a bug in LUInstanceMove
  Abstract ignore_consistency opcode parameter
  Preload the string-escape code in noded
  Fix error in iallocator documentation reg. disk mode
  Try to prevent instance memory changes N+1 failures
  Update NEWS file for the 2.4.2 release

Conflicts:
        NEWS                (trivial)
        doc/iallocator.rst  (kept our version)
        lib/cli.py          (trivial)
        lib/opcodes.py      (removed duplicated work, both branches
                             introduced the same new variable
                              PIgnoreConsistency :)
        lib/rapi/client.py  (trivial)
        lib/rapi/rlib2.py   (almost trivial)
        qa/ganeti-qa.py     (below trivial)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agocli: Replace hardcoded disk templates with constants
Michael Hanselmann [Thu, 19 May 2011 14:31:19 +0000 (16:31 +0200)]
cli: Replace hardcoded disk templates with constants

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agomcpu: Add missing docstring to _ProcessResult
Michael Hanselmann [Tue, 17 May 2011 16:49:46 +0000 (18:49 +0200)]
mcpu: Add missing docstring to _ProcessResult

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoconfig: Add function to get instances in node group
Michael Hanselmann [Tue, 17 May 2011 15:56:18 +0000 (17:56 +0200)]
config: Add function to get instances in node group

This will be used for evacuating instances in a node group.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoiallocator: Stricter check for multi-evac result
Michael Hanselmann [Thu, 19 May 2011 10:46:37 +0000 (12:46 +0200)]
iallocator: Stricter check for multi-evac result

Check new secondary nodes' group like it's already done for
multi-relocation requests.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: Use ganeti.ht for checking iallocator result
Michael Hanselmann [Tue, 17 May 2011 14:10:15 +0000 (16:10 +0200)]
cmdlib: Use ganeti.ht for checking iallocator result

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix errors in hooks documentation
Michael Hanselmann [Tue, 17 May 2011 16:13:16 +0000 (18:13 +0200)]
Fix errors in hooks documentation

In many cases the opcode ID was incorrect. A unittest for this will
be added in the master branch.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoht: Add strict check for dictionaries
Michael Hanselmann [Tue, 17 May 2011 14:09:11 +0000 (16:09 +0200)]
ht: Add strict check for dictionaries

This allows checking specific dictionary items, unlike TDict
or TDictOf.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: Remove punctuation from error messages
Michael Hanselmann [Mon, 16 May 2011 15:44:55 +0000 (17:44 +0200)]
cmdlib: Remove punctuation from error messages

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoVarious grammar fixes and updates
Stephen Shirley [Tue, 17 May 2011 09:02:12 +0000 (11:02 +0200)]
Various grammar fixes and updates

Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agognt-debug: New iallocator mode
Michael Hanselmann [Thu, 12 May 2011 16:16:55 +0000 (18:16 +0200)]
gnt-debug: New iallocator mode

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdd new iallocator mode to LUTestAllocator
Michael Hanselmann [Thu, 12 May 2011 16:16:35 +0000 (18:16 +0200)]
Add new iallocator mode to LUTestAllocator

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib.IAllocator: Add multi-relocate support
Michael Hanselmann [Wed, 11 May 2011 15:56:54 +0000 (17:56 +0200)]
cmdlib.IAllocator: Add multi-relocate support

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdd constants for multi-relocation iallocator mode
Michael Hanselmann [Wed, 11 May 2011 15:29:13 +0000 (17:29 +0200)]
Add constants for multi-relocation iallocator mode

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoClarify a bit the noded man page
Iustin Pop [Mon, 16 May 2011 11:26:44 +0000 (13:26 +0200)]
Clarify a bit the noded man page

"This can be overriden" can be read as either the port we listen on or
the address we bind to. Replace with "The port" for great clarity!

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoNote --no-remember in NEWS
Iustin Pop [Fri, 13 May 2011 15:54:34 +0000 (17:54 +0200)]
Note --no-remember in NEWS

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoSwitch QA over to using instance stop --no-remember
Iustin Pop [Fri, 13 May 2011 15:38:25 +0000 (17:38 +0200)]
Switch QA over to using instance stop --no-remember

Instead of hardcoded Xen commands. This will make it work for all
hypervisors, instead of duplicating hypervisor functionality in QA
itself.

The timeout has been removed as gnt-instance stop itself will make
sure the instance is down before returning. We just double-check that
it is indeed down.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoImplement no_remember at RAPI level
Iustin Pop [Fri, 13 May 2011 15:20:29 +0000 (17:20 +0200)]
Implement no_remember at RAPI level

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoImplement no_remember at CLI level
Iustin Pop [Fri, 13 May 2011 15:17:44 +0000 (17:17 +0200)]
Implement no_remember at CLI level

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoIntroduce instance start/stop no_remember attribute
Iustin Pop [Fri, 13 May 2011 15:02:35 +0000 (17:02 +0200)]
Introduce instance start/stop no_remember attribute

This will allow stopping or starting an instance without changing the
remembered state. While this seems counter-intuitive at first (it will
create cluster verify errors), it can help in a few corner cases:

- shutting down an entire cluster for maintenance but without having
  to remember state
- doing testing of Ganeti itself

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agocmdlib.IAllocator: Fewer temporary variables
Michael Hanselmann [Wed, 11 May 2011 15:37:35 +0000 (17:37 +0200)]
cmdlib.IAllocator: Fewer temporary variables

Reduce the number of temporary variables and generate dictionaries in
one go.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoTLMigrateInstance: do not migrate to self
Apollon Oikonomopoulos [Fri, 13 May 2011 13:16:11 +0000 (16:16 +0300)]
TLMigrateInstance: do not migrate to self

Check that the instance is not being migrated to its current primary node
during CheckPrereq. Otherwise migration is aborted because the instance is
already running and cleaned-up, which causes the running instance to be killed.

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoSharedLock: Implement downgrade from exclusive to shared mode
Michael Hanselmann [Fri, 6 May 2011 14:43:38 +0000 (16:43 +0200)]
SharedLock: Implement downgrade from exclusive to shared mode

If a job needs to modify a resource and then wait for a result, it must
acquire the resource lock in exclusive mode. In some cases it would be
possible to only have a shared lock for waiting. Until now it was not
possible to change a lock's mode once it'd been acquired. Releasing and
re-acquiring might have been possible, but would require many more
checks and can introduce new issues.

With this patch a new method, named “downgrade”, is added to Ganeti's
own SharedLock class. It can only be called when the lock is held in
exclusive mode and changes it to shared. If there are any pending shared
acquires on the same priority, they're moved to the front of the queue
and notified (jumping ahead of exclusive acquires).

In a lockset the internal lock will be downgraded if, and only if, all
individual locks owned by the current thread are either released or
acquired in shared mode.

Unittests are provided.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agognt-debug: Use constants for iallocator direction
Michael Hanselmann [Thu, 12 May 2011 16:27:51 +0000 (18:27 +0200)]
gnt-debug: Use constants for iallocator direction

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoUse disk mode constants in iallocator documentation
Michael Hanselmann [Thu, 12 May 2011 13:46:29 +0000 (15:46 +0200)]
Use disk mode constants in iallocator documentation

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agognt-debug, opcodes: Use constants for iallocator
Michael Hanselmann [Thu, 12 May 2011 13:40:58 +0000 (15:40 +0200)]
gnt-debug, opcodes: Use constants for iallocator

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib.IAllocator: Use lookup table for mode-specific data
Michael Hanselmann [Wed, 11 May 2011 15:29:40 +0000 (17:29 +0200)]
cmdlib.IAllocator: Use lookup table for mode-specific data

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoBump version for the 2.4.2 release v2.4.2
Iustin Pop [Thu, 12 May 2011 13:46:46 +0000 (15:46 +0200)]
Bump version for the 2.4.2 release

I think we should stop finding bugs and instead release this :)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoFix a bug in LUInstanceMove
Iustin Pop [Thu, 12 May 2011 11:39:47 +0000 (13:39 +0200)]
Fix a bug in LUInstanceMove

The opcode parameter ignore_consistency was used in the LU, but not
actually declared in the OpCode. The patch adds it in the opcode and
the command line client.

ObQuote — Please, please, can I have static typing?

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoAbstract ignore_consistency opcode parameter
Iustin Pop [Thu, 12 May 2011 11:34:23 +0000 (13:34 +0200)]
Abstract ignore_consistency opcode parameter

Two opcodes already use it and we need it for a third, time to add a
constant for it.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoPreload the string-escape code in noded
Iustin Pop [Thu, 12 May 2011 11:17:47 +0000 (13:17 +0200)]
Preload the string-escape code in noded

This encoding, part of the standard Python installation, is used by
the pickle module (in turn used by subprocess when handling
failures in program execution). Preloading it means that Python will
cache it in memory so that even if the disk goes away or just the
module, we're not going to fail in reporting errors.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoFix error in iallocator documentation reg. disk mode
Michael Hanselmann [Wed, 11 May 2011 16:14:30 +0000 (18:14 +0200)]
Fix error in iallocator documentation reg. disk mode

The code uses the disk object's “mode” attribute, which uses the
constants DISK_RDONLY (“ro”) and DISK_RDWR (“rw”).

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoTry to prevent instance memory changes N+1 failures
Iustin Pop [Wed, 11 May 2011 15:54:27 +0000 (17:54 +0200)]
Try to prevent instance memory changes N+1 failures

There are multiple bugs with the code checking for N+1 failures in the
instance memory changes which needs significant changes, in the
meantime we can at least:

- change the warning message into an error (--force will skip checks)
- only make checks when we increase the memory

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoUpdate NEWS file for the 2.4.2 release
Iustin Pop [Tue, 10 May 2011 16:45:18 +0000 (18:45 +0200)]
Update NEWS file for the 2.4.2 release

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoRemove references to acquired_locks
Guido Trotter [Wed, 11 May 2011 14:51:54 +0000 (16:51 +0200)]
Remove references to acquired_locks

These sneaked in from 2.4 during the merge, but this attribute is
actually gone in the master branch.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoMerge branch 'devel-2.4'
Guido Trotter [Wed, 11 May 2011 12:58:12 +0000 (14:58 +0200)]
Merge branch 'devel-2.4'

* devel-2.4:
  Use floppy disk and a second CDROM on KVM
  Document the selection of instance kernels
  Make root_path an optional hypervisor parameter
  Some man page updates
  Add 2 new variables to the OS scripts environment
  Add --no-wait-for-sync when converting to drbd
  Recreate instance disks: allow changing nodes
  Rename instance: only show new name when different
  Fix race condition in LUGroupAssignNodes
  Re-wrap and fix formatting issues in gnt-instance.rst
  Documentation for the new parameters for KVM
  cmdlib: Fix typo, s/nick/NIC/
  A small optimisation in cluster verify
  A few docstring fixes
  luxi: do not handle KeyboardInterrupt
  Handle EPIPE errors while writing to the terminal
  Cluster verify: check for missing bridges

Conflicts:
lib/cmdlib.py
          - manually merge the 2.4 fix
lib/opcodes.py
          - add new field from 2.4, but also describe it
man/gnt-cluster.rst
man/gnt-instance.rst
man/gnt-node.rst
          - merge new attributes with general 2.4 manpage fixes

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoiallocator: Specify result of “multi-relocate” request
Michael Hanselmann [Tue, 10 May 2011 16:24:53 +0000 (18:24 +0200)]
iallocator: Specify result of “multi-relocate” request

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoUse floppy disk and a second CDROM on KVM
Marco Casavecchia [Mon, 2 May 2011 08:39:50 +0000 (01:39 -0700)]
Use floppy disk and a second CDROM on KVM

Hi all,
this patch will add 3 new KVM parameters and a new option.

New Parameters:
 - floppy_image_path = "" -> Specify the floppy image to load as
floppy disk.
 - cdrom2_image_path = "" -> Specify a second cdrom image to load on
the system (note: this in not intended to be used as a boot device. To
boot the system from cdrom you must use the "cdrom_image_path"
parameter as always).
 - cdrom_disk_type = "" -> it can be one of the kvm supported types as
"ide,scsi,paravirtual,ecc". I introduced this optional parameter to
make possible to specify a different virtual device for cdroms. It is
useful if you want to install a windows system

New option for "boot_device" parameter:
 -  "floppy": with this value you should be able to boot a KVM
instance from floppy image.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
(cherry picked from commit cc130cc7a60fd5377c032116b0c036ae44639913)

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoDocument the selection of instance kernels
Iustin Pop [Tue, 10 May 2011 15:54:31 +0000 (17:54 +0200)]
Document the selection of instance kernels

A simple doc patch to document how to configure the kernels for the
instances.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agojqueue: Update worker thread name to include opcode summary
Michael Hanselmann [Mon, 9 May 2011 15:14:20 +0000 (17:14 +0200)]
jqueue: Update worker thread name to include opcode summary

With this patch, the worker thread name is updated to include a short
summary of the opcode (basically its OP_ID). The base name of job queue
threads is shortened from “JobQueue” to “Jq”. Logs and the lock monitor
will show a job verifying the cluster as e.g. “Jq2/Job1742/C_VERIFY”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoUse the new dry-run mode in cmdlib
Iustin Pop [Mon, 9 May 2011 15:06:34 +0000 (17:06 +0200)]
Use the new dry-run mode in cmdlib

This will hopefully detect potential LVM (or any other storage, when
they implement it) issues before committing changes just on some
nodes.

Unfortunately due to the dry_run opcode handling, we can't integrate
this into the usual handling (as we need to activate the disks before
doing any tests, which belongs in Exec not in CheckPrereq).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoImplement grow dry-run at RPC level
Iustin Pop [Mon, 9 May 2011 15:01:23 +0000 (17:01 +0200)]
Implement grow dry-run at RPC level

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoImplement dryrun mode for BlockDev.Grow()
Iustin Pop [Mon, 9 May 2011 14:50:23 +0000 (16:50 +0200)]
Implement dryrun mode for BlockDev.Grow()

This is always called with False from backend for now.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agocmdlib: Sort nodes for OOB commands
Michael Hanselmann [Tue, 10 May 2011 12:19:21 +0000 (14:19 +0200)]
cmdlib: Sort nodes for OOB commands

Also reorder the methods to match all other LUs.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: Use helper for expanding nodes for OOB commands
Michael Hanselmann [Tue, 10 May 2011 12:15:24 +0000 (14:15 +0200)]
cmdlib: Use helper for expanding nodes for OOB commands

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: Expand instances using helper for repairing disks
Michael Hanselmann [Tue, 10 May 2011 12:07:48 +0000 (14:07 +0200)]
cmdlib: Expand instances using helper for repairing disks

Also change the way “share_locks” is filled.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix bug introduced in commit 0d5a0b96
Michael Hanselmann [Tue, 10 May 2011 12:02:15 +0000 (14:02 +0200)]
Fix bug introduced in commit 0d5a0b96

When removing “acquired_locks” in commit 0d5a0b96, I didn't remember
that it does not contain the Big Ganeti Lock.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix lock release in TLMigrateInstance
Apollon Oikonomopoulos [Tue, 10 May 2011 11:10:13 +0000 (14:10 +0300)]
Fix lock release in TLMigrateInstance

Commit 52f33103 introduced lock release factorization, replacing manual
lock release using utility functions. However, it broke
TLMigrateInstance due to a typo (passing the Tasklet to ReleaseLocks
instead of the parent LU). We fix this by passing the LU to
ReleaseLocks.

Thanks to Dan Eriksson for reporting this.

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoRe-indent test/mocks.py using two spaces
Michael Hanselmann [Tue, 10 May 2011 09:55:42 +0000 (11:55 +0200)]
Re-indent test/mocks.py using two spaces

No idea where those four spaces came from, but they must've been there
for a while.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: Remove acquired_locks attribute from LUs
Michael Hanselmann [Tue, 10 May 2011 09:41:14 +0000 (11:41 +0200)]
cmdlib: Remove acquired_locks attribute from LUs

The “acquired_locks” attribute in LUs is used to keep a list of acquired
locks at each lock level. This information is already known in the lock
manager, which also happens to be the authoritative source. Removing the
attribute and directly talking to the lock manager saves us from having
to maintain the duplicate information when releasing locks.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agocmdlib: Use local alias for lock manager
Michael Hanselmann [Mon, 9 May 2011 16:09:07 +0000 (18:09 +0200)]
cmdlib: Use local alias for lock manager

Saves some typing and we'll use it more often in the future.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoMake root_path an optional hypervisor parameter
René Nussbaumer [Mon, 9 May 2011 13:49:10 +0000 (15:49 +0200)]
Make root_path an optional hypervisor parameter

This will allow us an easy migration to pv-grub, because a set root_path
confused pv-grub.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoopcodes: Add function for compact summary
Michael Hanselmann [Mon, 9 May 2011 14:46:29 +0000 (16:46 +0200)]
opcodes: Add function for compact summary

Depending on the opcode and its parameters, the existing “Summary”
function can give a rater long summary. For displaying the summary in
logs and in the lock monitor, it should be shorter. Hence this new
function is added to just use the opcode ID with common prefixes
replaced (e.g. “INSTANCE_” becomes “I_”). Opcode values are not used.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoShow locksets in lock monitor
Michael Hanselmann [Fri, 6 May 2011 15:37:08 +0000 (17:37 +0200)]
Show locksets in lock monitor

When all locks contained in a set are acquired, the lockset's internal
lock is acquired with the same mode. With this patch the internal lock
will show up on the lock monitor, named e.g. “instances/[lockset]”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agolocking: Make parameter to condition's wait() positional
Michael Hanselmann [Fri, 6 May 2011 12:46:29 +0000 (14:46 +0200)]
locking: Make parameter to condition's wait() positional

It is always used in the locking code. Unittests are updated.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoSharedLock: Avoid acquires from sneaking in while notifying
Michael Hanselmann [Fri, 6 May 2011 12:40:26 +0000 (14:40 +0200)]
SharedLock: Avoid acquires from sneaking in while notifying

In some rare cases new shared acquires could sneak in through the
condition cached in “__pending_shared” while the code was still
notifying acquires. This was only working because such a condition
would be on top of the queue.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoSome man page updates
Iustin Pop [Mon, 9 May 2011 12:09:03 +0000 (14:09 +0200)]
Some man page updates

This adds documentation for both the short and long form of many
options (which was inconsistent before: in some cases only the short
form was used, in others only the long form).

Note that the standard this patch adopts is to document both forms as
such:

  {-O|--os-parameters} …

This makes it a bit uglier in complex situations, but the alternatives
considered were not perfect either. Other suggestions (with patches)
welcome.

Additionally, it fixes two doc bugs:

- in gnt-cluster.rst, the --prealloc-wipe-disks section was in the
  middle of a paragraph
- in gnt-instance.rst, a list was not typed correctly, thus it was
  mangled as a single paragraph

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoAdd 2 new variables to the OS scripts environment
Marco Casavecchia [Thu, 5 May 2011 09:17:09 +0000 (02:17 -0700)]
Add 2 new variables to the OS scripts environment

Add INSTANCE_PRIMARY_NODE and INSTANCE_SECONDARY_NODES. These new
values are useful for OS scripts that needs to know the nodes where
the instance lives.. or has lived.

Signed-off-by: Iustin Pop <iustin@google.com>
[iustin@google.com: fixed small issue with SECONDARY_NODES]
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdd --no-wait-for-sync when converting to drbd
Iustin Pop [Mon, 9 May 2011 09:42:25 +0000 (11:42 +0200)]
Add --no-wait-for-sync when converting to drbd

Currently, when converting an instance from plain to DRBD, the
instance is blocked during the entire resync period. This patch adds
the --no-wait-for-sync so that the operation finishes as soon as the
DRBD sync has started, without waiting for the entire sync. This makes
the instance available much faster.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoRecreate instance disks: allow changing nodes
Iustin Pop [Sat, 7 May 2011 10:25:18 +0000 (12:25 +0200)]
Recreate instance disks: allow changing nodes

This patch introduces the option of changing an instance's nodes when
doing the disk recreation. The rationale is that currently if an
instance lives on a node that has gone down and is marked offline,
it's not possible to re-create the disks and reinstall the instance on
a different node without hacking the config file.

Additionally, the LU now locks the instance's nodes (which was not
done before), as we most likely allocate new resources on them.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoFix instance failover/migration w.r.t TLMigrateInstance
Iustin Pop [Fri, 6 May 2011 09:07:32 +0000 (11:07 +0200)]
Fix instance failover/migration w.r.t TLMigrateInstance

Commit 1c6e5787 removed the iallocator and target_node keyword
parameters from TLMigrateInstance, but I didn't update their use in
LUInstanceFailover and (not fully) in LUInstanceMigrate.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoRename instance: only show new name when different
Iustin Pop [Fri, 6 May 2011 09:03:30 +0000 (11:03 +0200)]
Rename instance: only show new name when different

It makes not sense to show messages like:
Fri May  6 02:04:01 2011  - INFO: Resolved given name 'instance18' to
'instance18'

So we'll skip the message if the resolved name is identical to the
requested one.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoFix race condition in LUGroupAssignNodes
Michael Hanselmann [Thu, 5 May 2011 13:38:43 +0000 (15:38 +0200)]
Fix race condition in LUGroupAssignNodes

The original code would get all node information and their groups
without before acquiring the necessary locks. With this patch the node
information is only retrieved once all locks have been acquired. Groups
are locked optimistically and verified after acquiring the node locks.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix DTS_EXT_MIRROR migration
Apollon Oikonomopoulos [Tue, 22 Mar 2011 16:17:53 +0000 (18:17 +0200)]
Fix DTS_EXT_MIRROR migration

Commit faaabe3c fixed failover behaviour for DTS_INT_MIRROR instances, however
it broke migration for DTS_EXT_MIRROR instances, by moving iallocator and node
checks from LUInstanceMigrate to TLMigrateInstance. This has the side-effect
that the LU called the TL with None for both, node and iallocator when the
default iallocator was being used.

This patch maintains the iallocator checks in TLMigrateInstance and fixes the
LU-TL integration.

Signed-off-by: Iustin Pop <iustin@google.com>
[iustin@google.com: rebased patch on current HEAD]
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoUse node group locking for replacing disks
Michael Hanselmann [Mon, 2 May 2011 14:33:40 +0000 (16:33 +0200)]
Use node group locking for replacing disks

This is one of the first opcodes to make use of node group locking. To
get an instance's node groups, the instance's nodes need to be looked
at. Due to a previous design decision nodes are locked after the group,
hence there's no clean locking order. This patch works around that by
first getting the instance's groups without locks, and then verifying
them after actually getting all locks. Rough overview:

- Lock instance
- Get groups of instance's nodes
- Lock groups
- Lock all nodes in groups
- Verify node groups
- Run iallocator
- Release group and unused nodes
- Replace disks, etc.

There are probably too many assertions in the code, but it's locking and
we've been bitten in the past.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoconfig: Add function to determine instance's groups
Michael Hanselmann [Mon, 2 May 2011 14:22:57 +0000 (16:22 +0200)]
config: Add function to determine instance's groups

This will be used for locking only the necessary node group(s)
for per-instance operations.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoTLMigrateInstance: Fix live migration breakage
Apollon Oikonomopoulos [Thu, 5 May 2011 08:26:27 +0000 (11:26 +0300)]
TLMigrateInstance: Fix live migration breakage

Commit 77fcff4 unintentionally incorporated code from
TLMigrateInstance.CheckPrereq into TLMigrateInstance._RunAllocator, presumably
during a rebase from earlier versions of the patch to the 2.5 codebase. As a
result all migrations running without an iallocator were performed non-live :-(

This patch moves the affected code back to CheckPrereq.

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>