ganeti-local
13 years agoRevert "Add 2.2->2.3 cluster upgrade function"
Guido Trotter [Mon, 6 Sep 2010 14:11:33 +0000 (15:11 +0100)]
Revert "Add 2.2->2.3 cluster upgrade function"

This reverts commit 2c9cf6bb05e14ea606638fce9680994cf92e8e24.
The change is better done in objects.py

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

13 years agoCluster.UpgradeConfig: populate primary_ip_family
Guido Trotter [Mon, 6 Sep 2010 14:20:03 +0000 (15:20 +0100)]
Cluster.UpgradeConfig: populate primary_ip_family

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

13 years agoAdding a runtime configuration library
René Nussbaumer [Thu, 12 Aug 2010 08:28:12 +0000 (10:28 +0200)]
Adding a runtime configuration library

This is used to expand the users/group names just once at
initial call.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoAllow ensure-dirs to run partially and skip big file chunks
René Nussbaumer [Tue, 27 Jul 2010 09:23:11 +0000 (11:23 +0200)]
Allow ensure-dirs to run partially and skip big file chunks

The startup of the daemons would take a lot of time otherwise,
also it's not needed to set the permissions of those file over
and over again, because if the daemons are once migrated to the
user they will keep creating the file for that user.

The full run is intended as initial upgrade

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoAdapt ensure-dirs to accomodate the additional permissions and files
René Nussbaumer [Tue, 27 Jul 2010 12:43:21 +0000 (14:43 +0200)]
Adapt ensure-dirs to accomodate the additional permissions and files

Please note that this can and will be improved over time. There are discussions
about automated file generation of ensure-dirs so we can _really_ keep all the
permissions and file ownerships in one place. Because right now they are all
in this file _and_ on every WriteFile call.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoLog warning instead of raising OpExecError for ndisc6
Manuel Franceschini [Fri, 3 Sep 2010 12:10:07 +0000 (14:10 +0200)]
Log warning instead of raising OpExecError for ndisc6

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdapt configure.ac to the new users/groups
René Nussbaumer [Mon, 26 Jul 2010 12:02:27 +0000 (14:02 +0200)]
Adapt configure.ac to the new users/groups

This patch does not affect anything. The logic to start the other daemons
(except for RAPI which is already implemented) under different users has
not been added and comes later on. If not specified at all it doesn't even
change behaviour at all.

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

13 years agognt-node: Fix bug that inverts ssh-key-check behavior
Manuel Franceschini [Thu, 2 Sep 2010 12:19:50 +0000 (14:19 +0200)]
gnt-node: Fix bug that inverts ssh-key-check behavior

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdd 2.2->2.3 cluster upgrade function
Manuel Franceschini [Wed, 25 Aug 2010 17:32:58 +0000 (19:32 +0200)]
Add 2.2->2.3 cluster upgrade function

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoMerge branch 'devel-2.2'
Michael Hanselmann [Fri, 27 Aug 2010 13:10:31 +0000 (15:10 +0200)]
Merge branch 'devel-2.2'

* devel-2.2:
  Show list of pending acquires in “gnt-debug locks”

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoHandle ENOENT case in ssconf.GetPrimaryIPFamily
Manuel Franceschini [Fri, 27 Aug 2010 08:52:46 +0000 (10:52 +0200)]
Handle ENOENT case in ssconf.GetPrimaryIPFamily

This patch adds an optional default parameter to SimpleStore._ReadFile. This
can be used to default the return value of this method in case the ssconf file
is not present.

In this particular case it is used to return AF_INET in case
ssconf_primary_ip_familiy is absent. This is the case when upgrading
from 2.2 -> 2.3. This is intended behaviour as it is suboptimal to copy
the ssconf file manually to the nodes during an upgrade using
cfgupgrade.

In the concrete case of an upgrade from 2.2 -> 2.3 cfgupgrade will just
add the primary_ip_family parameter to the cluster configuration and the
daemons will start with default family AF_INET. This is perfectly fine,
since there is no AF_INET6 2.2 clusters. After that, the admin is
required (as in an major upgrade) to run 'gnt-cluster redist-conf' which
will write ssconf_primary_ip_family on all nodes.

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoShow list of pending acquires in “gnt-debug locks”
Michael Hanselmann [Thu, 26 Aug 2010 16:17:20 +0000 (18:17 +0200)]
Show list of pending acquires in “gnt-debug locks”

This is accomplished by keeping a list of waiting threads instead
of just their number inside the lock-internal condition. A few
other tweaks to the output format are also made.

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

13 years agoDesign for job priorities
Michael Hanselmann [Thu, 19 Aug 2010 17:14:32 +0000 (19:14 +0200)]
Design for job priorities

This is an additional patch on top of my previous design for
workerpool priorities.

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

13 years agoNode groups design doc
Guido Trotter [Wed, 25 Aug 2010 11:13:47 +0000 (12:13 +0100)]
Node groups design doc

For the first version we should be able to implement node groups without
any backend api changes (ie. Iallocator). Yikes!

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

13 years agoMove sections of 2.3 design doc up a level
Guido Trotter [Mon, 23 Aug 2010 14:37:16 +0000 (15:37 +0100)]
Move sections of 2.3 design doc up a level

This removes the "Detailed design" section and moves everything else up
a level.

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

13 years agoFix scp command when target is an IPv6 address
Manuel Franceschini [Wed, 25 Aug 2010 12:50:53 +0000 (14:50 +0200)]
Fix scp command when target is an IPv6 address

Due to the syntax used for the target in scp <target>:<path>, it is
necessary when the target is an IPv6 address to enclose it in square
brackets.

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoRevert "Don't provide --no-ssh-key-check for QA"
René Nussbaumer [Tue, 24 Aug 2010 12:29:22 +0000 (14:29 +0200)]
Revert "Don't provide --no-ssh-key-check for QA"

This reverts commit dc092ece1bd07e9fa6ed97de8b4a3f360b26725e.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoRevert behaviour for calling SetupNodeDaemon
René Nussbaumer [Thu, 19 Aug 2010 12:42:29 +0000 (14:42 +0200)]
Revert behaviour for calling SetupNodeDaemon

This was previously done in setup-ssh which was the wrong place

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoChange bootstrap.SetupDaemonNode to use scp as we can assume SSH is setup
René Nussbaumer [Thu, 19 Aug 2010 12:38:22 +0000 (14:38 +0200)]
Change bootstrap.SetupDaemonNode to use scp as we can assume SSH is setup

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoMerge branch 'devel-2.2'
René Nussbaumer [Wed, 25 Aug 2010 09:52:09 +0000 (11:52 +0200)]
Merge branch 'devel-2.2'

hansmi helped me with merging the conflict. Thanks

Conflicts:
lib/workerpool.py

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

13 years agoAdding host key verification to setup-ssh
René Nussbaumer [Tue, 24 Aug 2010 11:54:01 +0000 (13:54 +0200)]
Adding host key verification to setup-ssh

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

13 years agoAdding a paramiko fingerprint format helper
René Nussbaumer [Tue, 24 Aug 2010 14:21:37 +0000 (16:21 +0200)]
Adding a paramiko fingerprint format helper

And provide unittests for them

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

13 years agoIPv6 design doc part
Manuel Franceschini [Mon, 23 Aug 2010 13:23:21 +0000 (15:23 +0200)]
IPv6 design doc part

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoMerge branch 'devel-2.1' into devel-2.2
Guido Trotter [Tue, 24 Aug 2010 17:06:33 +0000 (18:06 +0100)]
Merge branch 'devel-2.1' into devel-2.2

* devel-2.1:
  Increase version to 2.1.7
  Update NEWS for the 2.1.7 release

Conflicts:
NEWS
  - merge
configure.ac
  - keep the 2.2 version

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

13 years agoIncrease version to 2.1.7 v2.1.7
Guido Trotter [Tue, 24 Aug 2010 16:46:43 +0000 (17:46 +0100)]
Increase version to 2.1.7

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

13 years agoUpdate NEWS for the 2.1.7 release
Guido Trotter [Fri, 20 Aug 2010 09:39:29 +0000 (10:39 +0100)]
Update NEWS for the 2.1.7 release

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

13 years agoworkerpool: Add support for task priority
Michael Hanselmann [Sun, 18 Jul 2010 20:01:01 +0000 (22:01 +0200)]
workerpool: Add support for task priority

To add job priorities, the worker pool underlying the job queue must
support priorities per task. This patch adds them to the worker pool.

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

13 years agoFix race condition in locking unittest
Michael Hanselmann [Tue, 24 Aug 2010 15:22:29 +0000 (17:22 +0200)]
Fix race condition in locking unittest

While writing unittests for the new lock monitor, I made a small mistake and
didn't synchronize acquiring locks properly. This patch takes care of this
issue by adding additional synchronization.

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

13 years agoAdd simple lock monitor
Michael Hanselmann [Mon, 23 Aug 2010 17:32:54 +0000 (19:32 +0200)]
Add simple lock monitor

This patch adds an initial implementation of a lock monitor, accessible
for the user through “gnt-debug locks”. It currently shows all resource
locks: BGL, nodes and instances. Config and job queue locks could be
shown too, but wouldn't be of much help.  The current owner(s) and mode
are also shown.

Showing pending acquires will require further changes on the SharedLock
internals and is not yet implemented.

Example output:
$ gnt-debug locks -o name,mode,owner
Name            Mode      Owner
BGL/BGL         shared    JobQueue19/Job147
instances/inst1 exclusive JobQueue19/Job147
instances/inst2 -         -
instances/inst3 -         -
instances/inst4 -         -
nodes/node1     exclusive JobQueue19/Job147
nodes/node2     exclusive JobQueue19/Job147

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

13 years agoworkerpool: Allow setting task name
Michael Hanselmann [Mon, 23 Aug 2010 11:31:55 +0000 (13:31 +0200)]
workerpool: Allow setting task name

With this patch, the task name is added to the thread name and will show up in
logs. Log messages from jobs will look like “pid=578/JobQueue14/Job13 mcpu:289
DEBUG LU locks acquired/cluster/BGL/shared”.

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

13 years agoUse one function to parse “--fields” option values
Michael Hanselmann [Mon, 23 Aug 2010 15:14:11 +0000 (17:14 +0200)]
Use one function to parse “--fields” option values

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

13 years agolocking.LockSet: Use function to get member lock name
Michael Hanselmann [Mon, 23 Aug 2010 12:15:46 +0000 (14:15 +0200)]
locking.LockSet: Use function to get member lock name

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

13 years agoFinalize removal of “lock_status” job field
Michael Hanselmann [Mon, 23 Aug 2010 14:54:22 +0000 (16:54 +0200)]
Finalize removal of “lock_status” job field

When removing the field in commit 9bdab62198, I forgot to remove some parts.

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

13 years agoPrepare 2.2.0~rc1 release v2.2.0rc1
Michael Hanselmann [Mon, 23 Aug 2010 11:58:41 +0000 (13:58 +0200)]
Prepare 2.2.0~rc1 release

Update NEWS and version number.

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

13 years agoSwitch to the RPC call to update /etc/hosts in LUAddNode and LURemoveNode
René Nussbaumer [Fri, 23 Jul 2010 11:49:19 +0000 (13:49 +0200)]
Switch to the RPC call to update /etc/hosts in LUAddNode and LURemoveNode

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

13 years agoAdd RPC calls to update /etc/hosts
René Nussbaumer [Fri, 23 Jul 2010 11:48:50 +0000 (13:48 +0200)]
Add RPC calls to update /etc/hosts

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

13 years agoFix a few epydoc docstrings
Manuel Franceschini [Mon, 23 Aug 2010 11:18:37 +0000 (13:18 +0200)]
Fix a few epydoc docstrings

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoMerge branch 'devel-2.2'
Iustin Pop [Mon, 23 Aug 2010 10:35:48 +0000 (12:35 +0200)]
Merge branch 'devel-2.2'

* devel-2.2:
  setup-ssh: fix updating of authorized_keys
  setup-ssh: Also use keys from the ssh-agent
  setup-ssh: try to use key auth first
  setup-ssh: redo the logging levels
  setup-ssh: only read the ssh port once
  setup-ssh: fix the logging error message
  Use Sphinx' :rfc: extension to refer to RFCs
  Document non-standard usage of JSON in RAPI
  Fix small spelling mistake
  Explicitly add dry-run to some commands
  Stop adding the dry-run option by default
  Fix a few commands behaviour with dry-run
  jqueue: Remove lock status field
  QA: Run simple job queue test
  Don't ignore secondary node silently
  etags: force Python as a language

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

13 years agoMake family argument in FormatAddress optional
Manuel Franceschini [Mon, 23 Aug 2010 10:26:55 +0000 (12:26 +0200)]
Make family argument in FormatAddress optional

By doing this we delegate the task of finding the correct address family
to the FormatAddress method.

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoSupport IPv6 for instances
Manuel Franceschini [Fri, 20 Aug 2010 13:02:50 +0000 (15:02 +0200)]
Support IPv6 for instances

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agosetup-ssh: fix updating of authorized_keys
Iustin Pop [Sun, 22 Aug 2010 07:00:20 +0000 (09:00 +0200)]
setup-ssh: fix updating of authorized_keys

Due to what seems like a bug (or inconsistency) in paramiko, files
opened with a+ over SFTP need a seek() in order for the user to be able
to read data from them. We implement this, and rely on the fact that we
do iterate over all lines before writing and that the file is opened in
append mode (which at least on Linux should work correctly).

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

13 years agosetup-ssh: Also use keys from the ssh-agent
Iustin Pop [Sun, 22 Aug 2010 06:37:32 +0000 (08:37 +0200)]
setup-ssh: Also use keys from the ssh-agent

Currently, setup-ssh only uses one disk-based key. This means that any
setup where we use keys from ssh-agent (which do not necessarily exist
on disk) will break when moving from the old method to setup-ssh.

This patch moves the SSH key handling to separate functions, and uses
both the disk key (first) and the agent keys for login.

The patch also fixes the root_logger setup level (I tried to hard to
reduce noise and broke the debug level, sorry).

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

13 years agosetup-ssh: try to use key auth first
Iustin Pop [Fri, 20 Aug 2010 13:12:02 +0000 (15:12 +0200)]
setup-ssh: try to use key auth first

This patch changes the setup-ssh workflow to try key authentication
first, and then fall-back to password authentication. The password is
also read lazily, with no prompts if we can authenticate via keys.

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

13 years agosetup-ssh: redo the logging levels
Iustin Pop [Fri, 20 Aug 2010 13:02:12 +0000 (15:02 +0200)]
setup-ssh: redo the logging levels

There is not enough logged by default on stderr, and way too much
information in the log file.

Since we don't want to debug paramiko itself, we filter only warnings
and above.

Otherwise, we make WARNINGS the default level, with verbose meaning INFO
and debug, well, DEBUG.

Additionally, a message is improved.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agosetup-ssh: only read the ssh port once
Iustin Pop [Fri, 20 Aug 2010 12:09:44 +0000 (14:09 +0200)]
setup-ssh: only read the ssh port once

Then reuse it. With certain setups, this could be slow when pre-seeding
an entire cluster.

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

13 years agosetup-ssh: fix the logging error message
Iustin Pop [Fri, 20 Aug 2010 11:54:54 +0000 (13:54 +0200)]
setup-ssh: fix the logging error message

This took a bit of interesting debugging, but the issue seems to be that
on older python/logging/paramiko (I'm not sure which is at fault here),
the other threads are finishing later than the main thread, so the
logging module closes the logging file (but doesn't unregister it)
before the paramiko thread(s) get a change to finish their logging.

Tested on both old versions (Dapper) and new versions (Lucid) of these
three pieces of the puzzle.

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

13 years agoUse Sphinx' :rfc: extension to refer to RFCs
Michael Hanselmann [Fri, 20 Aug 2010 13:13:51 +0000 (15:13 +0200)]
Use Sphinx' :rfc: extension to refer to RFCs

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

13 years agoDocument non-standard usage of JSON in RAPI
Michael Hanselmann [Fri, 20 Aug 2010 13:13:11 +0000 (15:13 +0200)]
Document non-standard usage of JSON in RAPI

This was requested in issue 118.

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

13 years agognt-node add: add error msg when using IPv6
Manuel Franceschini [Fri, 20 Aug 2010 11:59:39 +0000 (13:59 +0200)]
gnt-node add: add error msg when using IPv6

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoDon't provide --no-ssh-key-check for QA
René Nussbaumer [Fri, 20 Aug 2010 06:53:56 +0000 (08:53 +0200)]
Don't provide --no-ssh-key-check for QA

My last setup-ssh patch series removed this option. Though, this is
just a temporary fix as a patch series is coming which revert that
behaviour to the old state

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoUse family in backend.StartMaster
Manuel Franceschini [Fri, 20 Aug 2010 08:12:15 +0000 (10:12 +0200)]
Use family in backend.StartMaster

This patches changes the StartMaster method to consult the cluster
primary ip version when deciding whether to use arping or ndisc6 after
activating the master ip.

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoMake Hostname object always intialize its name to fqdn
Manuel Franceschini [Thu, 19 Aug 2010 11:44:48 +0000 (13:44 +0200)]
Make Hostname object always intialize its name to fqdn

This patch restores the behaviour of Hostname (previously known as
HostInfo) to always use fqdn. This was broken due to the fact that the
now used getaddrinfo does not return an fqdn in contrast to
gethostbyname_ex().

This patch adds Hostname.GetFqdn() which is always used when
initializing a Hostname object.

A problem this solves is when adding a node and not using its fqdn, node
verify won't complain.

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoFix small spelling mistake
Manuel Franceschini [Fri, 20 Aug 2010 09:46:24 +0000 (11:46 +0200)]
Fix small spelling mistake

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoExplicitly add dry-run to some commands
Iustin Pop [Thu, 19 Aug 2010 12:25:50 +0000 (14:25 +0200)]
Explicitly add dry-run to some commands

Based on manual inspection (that the command only does a submit of some
jobs/opcodes), we re-add the dry-run option on a subset of the existing
commands.

A few more commands could use dry-run, but the code doesn't deal nicely
with no results, so fixing those is left for later patches.

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

13 years agoStop adding the dry-run option by default
Iustin Pop [Thu, 19 Aug 2010 10:40:22 +0000 (12:40 +0200)]
Stop adding the dry-run option by default

Currently cli.py unconditionally adds the dry-run option. This patch
disables this, and exports dry-run as a normal option.

The other alternative I tried to implement (adding a new fake option for
disabling the auto-add per individual command) would require changes in
more places, as the list of options is no longer a homogeneous list.

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

13 years agoFix a few commands behaviour with dry-run
Iustin Pop [Thu, 19 Aug 2010 13:51:00 +0000 (15:51 +0200)]
Fix a few commands behaviour with dry-run

These commands use or display the result from the LU, so in case of
dry-run, they will crash or display just 'None'. At least checking that
the result is 'true' (in the boolean sense) will make them work better.

As for gnt-os modify, it didn't pass the 'opts' parameter properly to
SubmitOpCode, so the dry-run option was silently ignored.

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

13 years agojqueue: Remove lock status field
Michael Hanselmann [Wed, 18 Aug 2010 15:19:44 +0000 (17:19 +0200)]
jqueue: Remove lock status field

With the job queue changes for Ganeti 2.2, watched and queried jobs are
loaded directly from disk, rendering the in-memory “lock_status” field
useless. Writing it to disk would be possible, but has a huge cost at
runtime (when tested, processing 1'000 opcodes involved 4'000 additional
writes to job files, even with replication turned off).

Using an additional in-memory dictionary to just manage this field turned
out to be a complicated task due to the necessary locking.

The plan is to introduce a more generic lock debugging mechanism in the
near future. Hence the decision is to remove this field now instead of
spending a lot of time to make it working again.

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

13 years agoQA: Run simple job queue test
Michael Hanselmann [Wed, 18 Aug 2010 13:01:31 +0000 (15:01 +0200)]
QA: Run simple job queue test

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

13 years agoutils: Use WriteFile in {Set,Remove}EtcHostsEntry
Michael Hanselmann [Thu, 19 Aug 2010 15:13:23 +0000 (17:13 +0200)]
utils: Use WriteFile in {Set,Remove}EtcHostsEntry

This avoids duplicate effort and has been a TODO for a long time.

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

13 years agoMerge branch 'devel-2.1' into devel-2.2
Guido Trotter [Thu, 19 Aug 2010 13:56:40 +0000 (14:56 +0100)]
Merge branch 'devel-2.1' into devel-2.2

* devel-2.1:
  Don't ignore secondary node silently

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

13 years agoDon't ignore secondary node silently
Guido Trotter [Thu, 19 Aug 2010 12:59:55 +0000 (13:59 +0100)]
Don't ignore secondary node silently

Currently on non-mirrored disk templates the secondary node is ignored
silently. This patch adds a check for this case, and warns the user
should this be happening. This solves issue 113.

The patch also moves a prereq check to an argument check. This is ok
because the iallocator framework already checks it has a secondary node,
when it needs one.

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

13 years agoDocument primary ip version and ndisc6
Manuel Franceschini [Mon, 9 Aug 2010 16:09:07 +0000 (18:09 +0200)]
Document primary ip version and ndisc6

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoModify gnt-node add to call external script
René Nussbaumer [Wed, 21 Jul 2010 11:07:30 +0000 (13:07 +0200)]
Modify gnt-node add to call external script

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

13 years agoMake it possible to invoke RunCmd in interactive mode
René Nussbaumer [Thu, 19 Aug 2010 08:12:21 +0000 (10:12 +0200)]
Make it possible to invoke RunCmd in interactive mode

This is needed so we can run external scripts asking for password and such
to run interactive. Downside is that we can't get the output of the program
but we can still use the exit code.

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

13 years agoRemoving all ssh setup code from the core
René Nussbaumer [Tue, 20 Jul 2010 12:00:11 +0000 (14:00 +0200)]
Removing all ssh setup code from the core

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

13 years agoetags: force Python as a language
Iustin Pop [Thu, 19 Aug 2010 11:41:04 +0000 (13:41 +0200)]
etags: force Python as a language

etags has cannot properly identify the scripts/gnt-* files as Python, so
we statically force the language to Python.

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

13 years agoSupport for IPv6 QA
Manuel Franceschini [Tue, 3 Aug 2010 15:37:38 +0000 (17:37 +0200)]
Support for IPv6 QA

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoSupport IPv6 node add
Manuel Franceschini [Mon, 2 Aug 2010 18:02:35 +0000 (20:02 +0200)]
Support IPv6 node add

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoSupport IPv6 cluster init
Manuel Franceschini [Mon, 2 Aug 2010 17:26:07 +0000 (19:26 +0200)]
Support IPv6 cluster init

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdd primary_ip_family to ssconf
Manuel Franceschini [Mon, 2 Aug 2010 16:10:38 +0000 (18:10 +0200)]
Add primary_ip_family to ssconf

Since this parameter will be used on all daemon startups, it needs to be
available on all nodes. This is achieved by querying it via ssconf. This
patch additionally adds a getter method to readily retrieve the primary
ip family from a ConfigWriter object.

This patch also disables the 'R0904: Too many public methods' pylint
warning, as it crosses the 50 methods limit.

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdd new cluster parameter primary_ip_version
Manuel Franceschini [Mon, 2 Aug 2010 16:03:21 +0000 (18:03 +0200)]
Add new cluster parameter primary_ip_version

We expose the ip_version (4, 6) to the external interface and internally
we convert it to ip_family (AF_INET=2, AF_INET6=10). This makes the code
more concise as all functions deal with family rather than version.

This patch does not yet expose this parameter via gnt-cluster, but only uses
the constant IP4_VERSION. This will be enabled in a future patch.

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agonetutils: make re class attribute and catch IndexError
Manuel Franceschini [Thu, 19 Aug 2010 08:26:25 +0000 (10:26 +0200)]
netutils: make re class attribute and catch IndexError

These missing changes were initially agreed upon but then forgotten.
First, we move the valid name regex to the class-level such that it
won't be compiled for every invocation of GetIP() and we wrap the result
of getaddrinfo() into a try/except to catch a possible IndexError.

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoMerge branch 'devel-2.2'
Guido Trotter [Wed, 18 Aug 2010 16:59:28 +0000 (17:59 +0100)]
Merge branch 'devel-2.2'

* devel-2.2:
  RAPI client: Support modifying instances
  RAPI: Allow modifying instance
  Small fixes for instance creation via RAPI documentation
  gnt-debug: Extend job queue tests
  jqueue: Mark opcodes following failed ones as failed, too
  jqueue: Work around race condition between job processing and archival
  jqueue: More checks for cancelling queued job
  errors: Function to check whether value is encoded error
  jqueue: Add more debug output
  gnt-backup: Pass error code to OpPrereqError
  Fix --master-netdev arg name in gnt-cluster(8)
  Restore 'tablet mouse on vnc' behavior
  Document the usb_mouse hv parameter
  Revert "Add -usbdevice tablet to KVM when using vnc"

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

13 years agoMerge branch 'devel-2.1' into devel-2.2
Guido Trotter [Wed, 18 Aug 2010 16:44:12 +0000 (17:44 +0100)]
Merge branch 'devel-2.1' into devel-2.2

* devel-2.1:
  Fix --master-netdev arg name in gnt-cluster(8)
  Restore 'tablet mouse on vnc' behavior
  Document the usb_mouse hv parameter
  Revert "Add -usbdevice tablet to KVM when using vnc"

Conflicts:
man/gnt-instance.sgml
  - merge

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

13 years agoFix some small newline style issues
Manuel Franceschini [Wed, 18 Aug 2010 08:58:41 +0000 (10:58 +0200)]
Fix some small newline style issues

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoRAPI client: Support modifying instances
Michael Hanselmann [Tue, 17 Aug 2010 16:50:37 +0000 (18:50 +0200)]
RAPI client: Support modifying instances

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

13 years agoRAPI: Allow modifying instance
Michael Hanselmann [Tue, 17 Aug 2010 16:50:11 +0000 (18:50 +0200)]
RAPI: Allow modifying instance

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

13 years agoSmall fixes for instance creation via RAPI documentation
Michael Hanselmann [Tue, 17 Aug 2010 15:16:38 +0000 (17:16 +0200)]
Small fixes for instance creation via RAPI documentation

- Inconsistencies
- Missing types

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

13 years agognt-debug: Extend job queue tests
Michael Hanselmann [Fri, 13 Aug 2010 10:22:43 +0000 (12:22 +0200)]
gnt-debug: Extend job queue tests

Test multiple opcodes, also with failure.

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

13 years agojqueue: Mark opcodes following failed ones as failed, too
Michael Hanselmann [Tue, 17 Aug 2010 13:52:11 +0000 (15:52 +0200)]
jqueue: Mark opcodes following failed ones as failed, too

When an opcode fails, the job queue would leave following opcodes as “queued”,
which can be quite confusing. With this patch, they're all marked as failed and
assertions are added to check this.

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

13 years agojqueue: Work around race condition between job processing and archival
Michael Hanselmann [Tue, 17 Aug 2010 13:33:52 +0000 (15:33 +0200)]
jqueue: Work around race condition between job processing and archival

This is a simplified version of a patch I sent earlier to make sure the job
file is only written once with a finalized status.

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

13 years agorapi.client, http.client: Format url correctly when using IPv6
Manuel Franceschini [Fri, 13 Aug 2010 09:32:15 +0000 (11:32 +0200)]
rapi.client, http.client: Format url correctly when using IPv6

This patch moves the FormatAddress helper function from daemon.py to
netutils.py. This enables its use in http.client as well as in
rapi.client. Furthermore this adds functionality to format IPv6
addresses according to RFC 3986.

It is required for use of literal IPv6 addresses in URLs in pycurl.
For some reason it worked also without the bracketing ("["<address>"]"),
but we do not want to rely on that.

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoSupport IPv6 in lib/http/server.py
Manuel Franceschini [Fri, 16 Jul 2010 14:23:07 +0000 (16:23 +0200)]
Support IPv6 in lib/http/server.py

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoSupport for resolving hostnames to IPv6 addresses
Manuel Franceschini [Wed, 28 Jul 2010 13:41:22 +0000 (15:41 +0200)]
Support for resolving hostnames to IPv6 addresses

This patch enables IPv6 name resolution by using socket.getaddrinfo
instead of socket.gethostbyname_ex.

It renames the HostInfo class to Hostname and unifies its use throughout
the code. This is achieved by using static calls where no object is
needed and removes some obsolete code.

For now, we just resolve to IPv4 addresses, but this will change once it
is needed.

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAlways use address instead of hostname in rpc.Client
Manuel Franceschini [Fri, 2 Jul 2010 11:24:48 +0000 (13:24 +0200)]
Always use address instead of hostname in rpc.Client

In light of the upcoming IPv6 support, this patch enables the rpc.Client
to always use a node's address to connect to it. This is necessary as we
do not want to rely on name resolution to connect to the correct IP
address on a dual-stack machine.

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agocluster init: Write ssconf before noded starts
Manuel Franceschini [Fri, 2 Jul 2010 09:16:28 +0000 (11:16 +0200)]
cluster init: Write ssconf before noded starts

This change is needed as we will need to read the primary ip version
cluster parameter before we start the node daemon. The reason is that we
need to know in advance if we bind to the IPv4 or IPv6 any address.

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoIntroduce new IPAddress classes
Manuel Franceschini [Wed, 14 Jul 2010 12:23:53 +0000 (14:23 +0200)]
Introduce new IPAddress classes

This patch unifies the netutils functions dealing with IP addresses to
three classes:
- IPAddress: Common IP address functionality
- IPv4Address: IPv4 specific functionality
- IPv6address: IPv6-specific functionality

Furthermore it adds methods to check whether an address is a loopback
address, replacing the .startswith("127") for IPv4 and adding IPv6
support.

It also provides the basis for future IPv6 address handling. Methods to
convert IP strings to their corresponding interger values will allow to
canonicalize IPv6 addresses.

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoAdd template 2.3 design doc
Guido Trotter [Wed, 21 Jul 2010 15:31:33 +0000 (16:31 +0100)]
Add template 2.3 design doc

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

13 years agojqueue: More checks for cancelling queued job
Michael Hanselmann [Fri, 13 Aug 2010 17:18:36 +0000 (19:18 +0200)]
jqueue: More checks for cancelling queued job

We can also check when the lock status is updated. This will
improve job cancelling.

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

13 years agoerrors: Function to check whether value is encoded error
Michael Hanselmann [Fri, 13 Aug 2010 17:19:07 +0000 (19:19 +0200)]
errors: Function to check whether value is encoded error

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

13 years agojqueue: Add more debug output
Michael Hanselmann [Thu, 12 Aug 2010 11:08:46 +0000 (13:08 +0200)]
jqueue: Add more debug output

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

13 years agognt-backup: Pass error code to OpPrereqError
Michael Hanselmann [Mon, 16 Aug 2010 13:53:41 +0000 (15:53 +0200)]
gnt-backup: Pass error code to OpPrereqError

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

13 years agoMerge branch 'devel-2.1'
Iustin Pop [Tue, 17 Aug 2010 12:42:58 +0000 (14:42 +0200)]
Merge branch 'devel-2.1'

* devel-2.1:
  Fix path in ganeti-rapi man page
  Adjust message in case ~/.ssh is no directory

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

13 years agoRe-add the 'live' parameter to migration opcodes
Iustin Pop [Tue, 17 Aug 2010 12:18:34 +0000 (14:18 +0200)]
Re-add the 'live' parameter to migration opcodes

This patch reintroduces the live parameter, for backwards compatibility
at the Luxi level. This way, clients can work transparently with both
2.1 and 2.2, even though sub-optimally.

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

13 years agoFix --master-netdev arg name in gnt-cluster(8)
Guido Trotter [Thu, 12 Aug 2010 15:50:47 +0000 (11:50 -0400)]
Fix --master-netdev arg name in gnt-cluster(8)

This fixes Issue 114.

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

13 years agoRestore 'tablet mouse on vnc' behavior
Guido Trotter [Mon, 9 Aug 2010 18:30:17 +0000 (14:30 -0400)]
Restore 'tablet mouse on vnc' behavior

We needed to revert commit 5b062a58ac76b39c2dc6a7e1543affdf43dc7ee7
because it was in conflict with the usb_mouse hv parameter. Here we
reintroduce its functionality only when usb_mouse is not specified.

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

13 years agoDocument the usb_mouse hv parameter
Guido Trotter [Mon, 9 Aug 2010 16:19:07 +0000 (12:19 -0400)]
Document the usb_mouse hv parameter

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

13 years agoRevert "Add -usbdevice tablet to KVM when using vnc"
Guido Trotter [Mon, 9 Aug 2010 16:11:07 +0000 (12:11 -0400)]
Revert "Add -usbdevice tablet to KVM when using vnc"

This reverts commit 5b062a58ac76b39c2dc6a7e1543affdf43dc7ee7.
This fixes issue 109. The mouse type can be set with the usb_mouse
hv parameter.

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

13 years agoFix path in ganeti-rapi man page
Michael Hanselmann [Mon, 16 Aug 2010 13:54:26 +0000 (15:54 +0200)]
Fix path in ganeti-rapi man page

This takes care of issue 116.

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

13 years agoworkerpool: Don't keep reference to task arguments
Michael Hanselmann [Fri, 13 Aug 2010 10:26:31 +0000 (12:26 +0200)]
workerpool: Don't keep reference to task arguments

The workerpool should not keep any reference to task arguments after
they were processed by RunTask. Doing so led to jobs being cached
by the job queue's WeakValueDictionary for longer than they should've
been.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Manuel Franceschini <livewire@google.com>