ganeti-local
13 years agoMerge branch 'devel-2.2'
Michael Hanselmann [Wed, 22 Sep 2010 14:54:22 +0000 (16:54 +0200)]
Merge branch 'devel-2.2'

* devel-2.2:
  NEWS: Add 2.2.0~rc2 release date
  Bump version to 2.2.0~rc2
  Fix mac checker regex
  Remove two old aliases
  Fix migration on new KVMs
  Fix typo in ganeti man page
  cli: Pass options in {Add,Remove}Tags
  Prepare 2.2.0~rc2 release

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

13 years agoMerge branch 'stable-2.2' into devel-2.2
Michael Hanselmann [Wed, 22 Sep 2010 14:33:34 +0000 (16:33 +0200)]
Merge branch 'stable-2.2' into devel-2.2

* stable-2.2:
  NEWS: Add 2.2.0~rc2 release date
  Bump version to 2.2.0~rc2
  Remove two old aliases
  Fix migration on new KVMs
  Prepare 2.2.0~rc2 release

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

13 years agojqueue: Add unittest for _QueuedJob.CalcStatus
Michael Hanselmann [Mon, 20 Sep 2010 13:21:20 +0000 (15:21 +0200)]
jqueue: Add unittest for _QueuedJob.CalcStatus

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

13 years agoUse free space in vg instead of biggest free pv space for a snapshot
René Nussbaumer [Wed, 22 Sep 2010 11:54:51 +0000 (13:54 +0200)]
Use free space in vg instead of biggest free pv space for a snapshot

Even for snapshot we looked at the biggest free pv space even though
the vg might have fit the snapshot we aborted if one of the pvs was too
small. This patch fixes this by looking at the vg size instead of the pv
size.

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

13 years agoMerge branch 'devel-2.1' into devel-2.2
Michael Hanselmann [Wed, 22 Sep 2010 12:58:37 +0000 (14:58 +0200)]
Merge branch 'devel-2.1' into devel-2.2

* devel-2.1:
  Fix mac checker regex

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

13 years agoNEWS: Add 2.2.0~rc2 release date
Michael Hanselmann [Wed, 22 Sep 2010 12:49:52 +0000 (14:49 +0200)]
NEWS: Add 2.2.0~rc2 release date

This was forgotten when preparing the release.

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

13 years agoBump version to 2.2.0~rc2 v2.2.0rc2
Michael Hanselmann [Wed, 22 Sep 2010 10:44:17 +0000 (12:44 +0200)]
Bump version to 2.2.0~rc2

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

13 years agoFix mac checker regex
Iustin Pop [Tue, 21 Sep 2010 18:24:28 +0000 (20:24 +0200)]
Fix mac checker regex

Currently, the mac checker regex could match a corner case of
11:22:33:44:55:66: (one extra colon at the end). We fix this, and we
also move the regex compilation outside of this function, at module
level.

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

13 years agoRemove two old aliases
Iustin Pop [Tue, 21 Sep 2010 07:09:08 +0000 (09:09 +0200)]
Remove two old aliases

These were deprecated since Ganeti 2.0, it's time to remove them.

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

13 years agoIgnore failures while shutting down instances during failover from offline node
René Nussbaumer [Mon, 20 Sep 2010 12:53:57 +0000 (14:53 +0200)]
Ignore failures while shutting down instances during failover from offline node

Don't abort failover if instance shutdown doesn't work on a node marked
offline. The node is offline, so the instances living on it are too. Before
you had to use --ignore-consistency to archieve that.

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

13 years agoDocument common options in ganeti(7)
Michael Hanselmann [Fri, 17 Sep 2010 16:36:51 +0000 (18:36 +0200)]
Document common options in ganeti(7)

So far the “--dry-run” option is not documented at all. This also adds
documentation for the new “--priority” option.

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

13 years agocli: Expose priority option and pass priority to master daemon
Michael Hanselmann [Fri, 17 Sep 2010 15:50:31 +0000 (17:50 +0200)]
cli: Expose priority option and pass priority to master daemon

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

13 years agojqueue: Change model from per-job to per-opcode processing
Michael Hanselmann [Mon, 20 Sep 2010 12:40:31 +0000 (14:40 +0200)]
jqueue: Change model from per-job to per-opcode processing

In order to support priorities, the processing of jobs needs to be
changed. Instead of processing jobs as a whole, the code is changed to
process one opcode at a time and then return to the queue. See the
Ganeti 2.3 design document for details.

This patch does not yet use priorities for acquiring locks.

The enclosed unittests increase the test coverage of jqueue.py from
about 34% to 58%. Please note that they also test some parts not added
by this patch, but testing them became only possible with some
infrastructure added by this patch. For the first time, many
implications and assumptions for the job queue are codified in these
unittests.

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

13 years agojqueue: Use priority for worker pool
Michael Hanselmann [Fri, 10 Sep 2010 15:28:09 +0000 (17:28 +0200)]
jqueue: Use priority for worker pool

A small helper function is added to make this easier. Priorities are not
yet used in all necessary places.

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

13 years agoFix migration on new KVMs
Vitaly Kuznetsov [Thu, 16 Sep 2010 20:27:24 +0000 (20:27 +0000)]
Fix migration on new KVMs

New KVMs (0.12.1.2-el6 and 0.13.5 tested) exit immediately after
unsuccessful network connection when they are in "-incoming" mode. The
simple check netutils.TcpPing causes remote kvm to exit so the migration
will always fail. This check is also redundant by the way as if the
network port is closed migration will fail with guarantee. This commit
removes this check.

Signed-off-by: Vitaly Kuznetsov <vitty@altlinux.ru>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix typo in ganeti man page
Michael Hanselmann [Fri, 17 Sep 2010 15:51:58 +0000 (17:51 +0200)]
Fix typo in ganeti man page

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

13 years agocli: Pass options in {Add,Remove}Tags
Michael Hanselmann [Fri, 17 Sep 2010 15:35:36 +0000 (17:35 +0200)]
cli: Pass options in {Add,Remove}Tags

They'll be used for job priorities. Also add an empty line to
gnt-os where it's missing.

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

13 years agojqueue: Add missing docstring to _QueuedJob.Cancel
Michael Hanselmann [Fri, 17 Sep 2010 13:54:17 +0000 (15:54 +0200)]
jqueue: Add missing docstring to _QueuedJob.Cancel

This was forgotten in commit 099b2870b.

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

13 years agoPrepare 2.2.0~rc2 release
Michael Hanselmann [Fri, 17 Sep 2010 11:45:57 +0000 (13:45 +0200)]
Prepare 2.2.0~rc2 release

Update NEWS, but not yet configure.ac.

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

13 years agoBail out if daemon gets fired up under wrong uid
René Nussbaumer [Thu, 16 Sep 2010 11:35:44 +0000 (13:35 +0200)]
Bail out if daemon gets fired up under wrong uid

This patch bails out in early stage, if the user invoking the daemon
doesn't match the user set at configure time.

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

13 years agoMerge branch 'devel-2.2'
Michael Hanselmann [Thu, 16 Sep 2010 10:48:07 +0000 (12:48 +0200)]
Merge branch 'devel-2.2'

* devel-2.2:
  QA: Test more tag operations via RAPI
  qa_rapi: Fix indentation error
  opcode summary: improve display for list summaries
  cmdlib: Fix type of “name” parameter for tag operations
  rlib2: Set tag operation param “name” to None for cluster tags
  Fix OS_VARIANT variable setting

Conflicts:
lib/backend.py: Trivial

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

13 years agoQA: Test more tag operations via RAPI
Michael Hanselmann [Thu, 16 Sep 2010 10:46:32 +0000 (12:46 +0200)]
QA: Test more tag operations via RAPI

This ensures tag operations work via RAPI. Also print requested URI to
stdout for debugging.

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

13 years agoqa_rapi: Fix indentation error
Michael Hanselmann [Wed, 15 Sep 2010 19:38:23 +0000 (21:38 +0200)]
qa_rapi: Fix indentation error

If no function to verify the result was specified, qa_rapi._DoTests
wouldn't return the result.

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

13 years agoMerge branch 'stable-2.2' into devel-2.2
Michael Hanselmann [Thu, 16 Sep 2010 10:38:18 +0000 (12:38 +0200)]
Merge branch 'stable-2.2' into devel-2.2

* stable-2.2:
  cmdlib: Fix type of “name” parameter for tag operations
  rlib2: Set tag operation param “name” to None for cluster tags
  Fix OS_VARIANT variable setting

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

13 years agoopcode summary: improve display for list summaries
Iustin Pop [Mon, 23 Aug 2010 14:20:26 +0000 (16:20 +0200)]
opcode summary: improve display for list summaries

Currently, opcodes like NODE_EVAC_STRATEGY look bad:

  89684 error   NODE_EVAC_STRATEGY([u'node3'])

With this patch, we try to render list arguments a little bit better:

  89684 error   NODE_EVAC_STRATEGY(node3)

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

13 years agoAlways enable logging for unittests
Michael Hanselmann [Wed, 15 Sep 2010 18:23:01 +0000 (20:23 +0200)]
Always enable logging for unittests

By enabling all log levels, we ensure all calls are fully evaluated.
There was one case in the workerpool where a call to “logging.debug”
was wrong, but not caught in unittests because debug logging was
disabled.

The optional environment variable “LOGTOSTDERR” can be set to
write all log messages to stderr instead of /dev/null.

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

13 years agoworkerpool: Fix typo
Michael Hanselmann [Wed, 15 Sep 2010 18:21:21 +0000 (20:21 +0200)]
workerpool: Fix typo

A call to logging.debug was missing an argument, leading to complaints
on stderr at runtime.

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

13 years agoAdd small jqueue unittests
Michael Hanselmann [Wed, 15 Sep 2010 17:31:44 +0000 (19:31 +0200)]
Add small jqueue unittests

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

13 years agojqueue: Move CancelJob logic to separate function
Michael Hanselmann [Wed, 15 Sep 2010 17:31:03 +0000 (19:31 +0200)]
jqueue: Move CancelJob logic to separate function

Moving the internals of this function will allow it to be used from
unittests in the future. Splitting this into a pure, side-effect free
function and an impure one makes the pure function easily testable.

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

13 years agoMerge branch 'devel-2.2'
Iustin Pop [Thu, 16 Sep 2010 07:25:33 +0000 (09:25 +0200)]
Merge branch 'devel-2.2'

* devel-2.2:
  Fix case of MAC special-values
  Remove mcpu's ReportLocks callback
  Revert "jqueue: Resume jobs from “waitlock” status"

(no conflicts, took LGTM from original commit)

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

13 years agoMerge branch 'devel-2.1' into devel-2.2
Iustin Pop [Thu, 16 Sep 2010 07:24:55 +0000 (09:24 +0200)]
Merge branch 'devel-2.1' into devel-2.2

* devel-2.1:
  Fix case of MAC special-values

(no conflicts, took LGTM from original commit)

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

13 years agoFix case of MAC special-values
Iustin Pop [Mon, 13 Sep 2010 09:30:03 +0000 (11:30 +0200)]
Fix case of MAC special-values

This fixes Debian bug #596347. An alternative would be to also allow
the uppercase form, but it's not nice I think.

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

13 years agocmdlib: Fix type of “name” parameter for tag operations
Michael Hanselmann [Wed, 15 Sep 2010 19:37:38 +0000 (21:37 +0200)]
cmdlib: Fix type of “name” parameter for tag operations

The parameter “name” is be None for cluster tags.

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

13 years agorlib2: Set tag operation param “name” to None for cluster tags
Michael Hanselmann [Wed, 15 Sep 2010 19:39:05 +0000 (21:39 +0200)]
rlib2: Set tag operation param “name” to None for cluster tags

Otherwise parameter verification in the master daemon fails.

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

13 years agoStop all daemons precautiosly before trying to start ganeti-noded again
René Nussbaumer [Wed, 15 Sep 2010 12:25:49 +0000 (14:25 +0200)]
Stop all daemons precautiosly before trying to start ganeti-noded again

Please note that if the pid file is broken or missing we'll not catch
the process (if any is running) and it's up to the user to fix this state

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

13 years agoCheck for duplicate nodegroup names
Guido Trotter [Mon, 6 Sep 2010 15:52:17 +0000 (16:52 +0100)]
Check for duplicate nodegroup names

Since the nodegroups dict is indexed by uuid duplicate names might
happen as a result of bugs. Add a check to prevent them.

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

13 years agoSplit a long docstring line in objects.py
Guido Trotter [Wed, 15 Sep 2010 10:46:05 +0000 (11:46 +0100)]
Split a long docstring line in objects.py

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

13 years agoInitConfig: create nodegroups as well
Guido Trotter [Wed, 15 Sep 2010 08:59:46 +0000 (09:59 +0100)]
InitConfig: create nodegroups as well

This patch also ensures that the initial configuration has all the
needed UUIDs and that they are unique, by using a
TemporaryReservationManager inside InitConfit to generate them.

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

13 years agoAdd nodegroup option to AddNode
Guido Trotter [Fri, 10 Sep 2010 15:56:50 +0000 (16:56 +0100)]
Add nodegroup option to AddNode

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

13 years agoAdd nodegroup bash autocomplation
Guido Trotter [Tue, 7 Sep 2010 16:16:17 +0000 (17:16 +0100)]
Add nodegroup bash autocomplation

We autocomplete both by nodegroup name and uuid.

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

13 years agoExport nodegroups list (names/uuids) via ssconf
Guido Trotter [Tue, 7 Sep 2010 16:42:13 +0000 (17:42 +0100)]
Export nodegroups  list (names/uuids) via ssconf

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

13 years agoAdd node's nodegroup field
Guido Trotter [Fri, 10 Sep 2010 14:19:19 +0000 (15:19 +0100)]
Add node's nodegroup field

If a node doesn't have a node group we'll upgrade the config making it
the cluster default. Also the node add and removal operations are
changed to set/clear the node group correctly. Finally we populate the
"members" list of nodegroups on config load with  the value from the
nodes.

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

13 years agoconfig.LookupNodeGroup
Guido Trotter [Mon, 13 Sep 2010 14:02:24 +0000 (15:02 +0100)]
config.LookupNodeGroup

This function allows a node group to be looked up by name or uuid.
If no nodegroup is specified and only one exists, that one is returned.

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

13 years agoCheck for nodegroup uuid indexing
Guido Trotter [Mon, 6 Sep 2010 15:31:04 +0000 (16:31 +0100)]
Check for nodegroup uuid indexing

Since the uuid is immutable the probability of it getting out of sync
between the object and the dict key is very low. Still, checking is
cheap, so we do it to be more sure nothing is wrong.

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

13 years agoConfigWriter: create the default node group
Guido Trotter [Mon, 6 Sep 2010 15:30:10 +0000 (16:30 +0100)]
ConfigWriter: create the default node group

If no node groups exist we'll create a new default empty one.

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

13 years agoAdd a 'nodegroups' slot to ConfigData
Guido Trotter [Mon, 6 Sep 2010 13:28:40 +0000 (14:28 +0100)]
Add a 'nodegroups' slot to ConfigData

Also:
  - reformat the __slots__ declaration of ConfigData
  - call UpgradeConfig on each node groups to handle future upgrades
  - add nodegroups special case in {To,From}Dict
  - add nodegroups to _AllUUIDObjects

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

13 years ago_ContainerFromDicts: handle None source
Guido Trotter [Mon, 13 Sep 2010 16:49:17 +0000 (17:49 +0100)]
_ContainerFromDicts: handle None source

When _ContainerFromDicts is called on some element which doesn't exist
in the config, because it is yet to be upgraded, it will receive its
value as None. We take care of this case by using an empty element of
the required target type.

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

13 years agoAdd a new NodeGroup config object
Guido Trotter [Mon, 6 Sep 2010 11:13:32 +0000 (12:13 +0100)]
Add a new NodeGroup config object

The "members" slot of this object is not serialized, and is discarded
when deserializing, initializing it explicitly to [].

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

13 years agocli: Add option definition for priority
Michael Hanselmann [Mon, 6 Sep 2010 21:00:34 +0000 (23:00 +0200)]
cli: Add option definition for priority

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

13 years agojqueue: Ensure only accepted priorities are allowed for submitting jobs
Michael Hanselmann [Mon, 6 Sep 2010 17:01:26 +0000 (19:01 +0200)]
jqueue: Ensure only accepted priorities are allowed for submitting jobs

Quoting the design document: “Submitted opcodes can have one of the priorities
listed below. Other priorities are reserved for internal use”. Submitting jobs
at priority -20 should not be allowed.

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

13 years agoAdd support for job priority to opcodes and job queue objects
Michael Hanselmann [Thu, 2 Sep 2010 16:04:50 +0000 (18:04 +0200)]
Add support for job priority to opcodes and job queue objects

This allows clients to submit opcodes with a priority. Except for being
tracked by the job queue, it is not yet used by any code.

Unittests for jqueue._QueuedOpCode and jqueue._QueuedJob are provided for
the first time.

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

13 years agoAdd job priority constants
Michael Hanselmann [Thu, 2 Sep 2010 16:28:30 +0000 (18:28 +0200)]
Add job priority constants

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

13 years agoRAPI server: Move user file watching out, update documentation
Michael Hanselmann [Mon, 13 Sep 2010 15:16:06 +0000 (17:16 +0200)]
RAPI server: Move user file watching out, update documentation

This patch moves the code watching the users file into a
a separate class to not mix it with HTTP serving. The users
file is now driven from outside the HTTP server class.

Also the documentation is updated to mention the automatic
reloading.

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

13 years agoRemove mcpu's ReportLocks callback
Michael Hanselmann [Mon, 13 Sep 2010 14:46:41 +0000 (16:46 +0200)]
Remove mcpu's ReportLocks callback

This is no longer needed with the new lock monitor. One callback is kept to
check for cancelled jobs.

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

13 years agoRevert "jqueue: Resume jobs from “waitlock” status"
Michael Hanselmann [Fri, 10 Sep 2010 15:28:30 +0000 (17:28 +0200)]
Revert "jqueue: Resume jobs from “waitlock” status"

This reverts commit 4008c8edae31a3971fa8c4b200238afc8005d3d4.

While it worked in my initial tests, I've now found cases where this doesn't
work properly as it is. More work is needed and will be done as part of the
Ganeti 2.3 job queue changes.

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

13 years agoProposed design changes for 2.3 and big clusters
Iustin Pop [Thu, 9 Sep 2010 14:03:52 +0000 (16:03 +0200)]
Proposed design changes for 2.3 and big clusters

A big design doc patch touching three areas related to increasing
scalability in 2.3.

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

13 years agoFix OS_VARIANT variable setting
Vitaly Kuznetsov [Wed, 8 Sep 2010 16:57:45 +0000 (16:57 +0000)]
Fix OS_VARIANT variable setting

This was introduced in efaa9b06d1e1e6d1678d0edd75b1ba37cf0de3d9.

 in OSCoreEnv:
  inst_os.name is pure operating system name (without variant) as variant is stripped
   in OSFromDisk(). So we always get variant = inst_os.supported_variants[0] (first
   variant in variants list).
  Adding argument os_name with full name (including variant) solves this problem.

Signed-off-by: Vitaly Kuznetsov <vitty@altlinux.ru>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
[modified by iustin to handle the call to OSCoreEnv from ValidateOS too]
Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoUpdate the authentication mapping in RAPI if users file has been updated
René Nussbaumer [Fri, 10 Sep 2010 09:38:26 +0000 (11:38 +0200)]
Update the authentication mapping in RAPI if users file has been updated

Please note: This only works if the file existed upon startup. If the file was
created later, ganeti-rapi has to be restarted.

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

13 years agoMerge branch 'devel-2.2'
Michael Hanselmann [Fri, 10 Sep 2010 12:11:22 +0000 (14:11 +0200)]
Merge branch 'devel-2.2'

* devel-2.2:
  Fix pylint warning in http/__init__.py
  Allow SSL ciphers to be overridden in HTTP server
  jqueue: Resume jobs from “waitlock” status
  jqueue: Move queue inspection into separate function
  jqueue: Don't update file in MarkUnfinishedOps
  locking.SharedLock: Update class docstring
  If we had any errors in setup in one of the hosts, exit with non-zero
  Fix the output of the key fingerprint from binary to hex

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

13 years agoMerge branch 'stable-2.2' into devel-2.2
Michael Hanselmann [Fri, 10 Sep 2010 12:06:22 +0000 (14:06 +0200)]
Merge branch 'stable-2.2' into devel-2.2

* stable-2.2:
  Fix pylint warning in http/__init__.py
  Allow SSL ciphers to be overridden in HTTP server
  If we had any errors in setup in one of the hosts, exit with non-zero

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

13 years agoFix pylint warning in http/__init__.py
Michael Hanselmann [Fri, 10 Sep 2010 11:48:53 +0000 (13:48 +0200)]
Fix pylint warning in http/__init__.py

My bad for not seeing this before:
R0201:614:HttpBase.GetSslCiphers: Method could be a function

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

13 years agoAllow SSL ciphers to be overridden in HTTP server
Michael Hanselmann [Fri, 10 Sep 2010 11:14:04 +0000 (13:14 +0200)]
Allow SSL ciphers to be overridden in HTTP server

Users of this class, such as the RAPI server, might want to override or adjust
the default SSL cipher defined in a constant.

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

13 years agojqueue: Resume jobs from “waitlock” status
Michael Hanselmann [Thu, 9 Sep 2010 16:17:25 +0000 (18:17 +0200)]
jqueue: Resume jobs from “waitlock” status

After an unclean restart of ganeti-masterd, jobs in the “waitlock” status can
be safely restarted. They hadn't modified the cluster yet.

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

13 years agojqueue: Move queue inspection into separate function
Michael Hanselmann [Wed, 8 Sep 2010 17:25:07 +0000 (19:25 +0200)]
jqueue: Move queue inspection into separate function

This makes the __init__ function a lot smaller while not changing
functionality.

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

13 years agojqueue: Don't update file in MarkUnfinishedOps
Michael Hanselmann [Thu, 9 Sep 2010 13:53:56 +0000 (15:53 +0200)]
jqueue: Don't update file in MarkUnfinishedOps

This reduced the number of updates to the job files. It's used in two places
while processing a job and the file is updated just afterwards.

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

13 years agolocking.SharedLock: Update class docstring
Michael Hanselmann [Tue, 7 Sep 2010 14:04:00 +0000 (16:04 +0200)]
locking.SharedLock: Update class docstring

This was already outdated when the initial version of SharedLock was added
in commit 162c1c1f1 (February 2008).

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

13 years agoAdding functionality to check feasability of joining the host
René Nussbaumer [Thu, 9 Sep 2010 11:02:52 +0000 (13:02 +0200)]
Adding functionality to check feasability of joining the host

This checks if the host might possibily belong already to another
cluster. If this is the case we abort without any further action
unless we are forced by --force-join.

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

13 years agoIf we had any errors in setup in one of the hosts, exit with non-zero
René Nussbaumer [Thu, 9 Sep 2010 11:13:08 +0000 (13:13 +0200)]
If we had any errors in setup in one of the hosts, exit with non-zero

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

13 years agoFix the output of the key fingerprint from binary to hex
René Nussbaumer [Thu, 9 Sep 2010 11:09:41 +0000 (13:09 +0200)]
Fix the output of the key fingerprint from binary to hex

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

13 years agolocking: Implement priorities in SharedLock and LockSet
Michael Hanselmann [Tue, 7 Sep 2010 12:49:09 +0000 (14:49 +0200)]
locking: Implement priorities in SharedLock and LockSet

For proper support of job priorities, jobs' locks need to respect
priorities.  Otherwise it could happen that a job with a lower priority
could get a lock before a job with a higher priority (depending on
timeouts and when they start acquiring).

This patch adds support for priorities in SharedLock and LockSet and
provides (unfortunately non-trivial) unittests. Outdated comments are also
adjusted and improved.

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

13 years agoModify daemon-util to support launching daemons under different user/groups
René Nussbaumer [Tue, 27 Apr 2010 13:39:44 +0000 (15:39 +0200)]
Modify daemon-util to support launching daemons under different user/groups

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

13 years agoRemove utils.EnsureDir as this is done by ensure-dirs.in now
René Nussbaumer [Tue, 27 Jul 2010 12:25:38 +0000 (14:25 +0200)]
Remove utils.EnsureDir as this is done by ensure-dirs.in now

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

13 years agoThe config now should also belong to confd group and readable by it
René Nussbaumer [Tue, 31 Aug 2010 11:43:16 +0000 (13:43 +0200)]
The config now should also belong to confd group and readable by it

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

13 years agoMove job queue to new ganeti.runtime
René Nussbaumer [Mon, 16 Aug 2010 08:32:18 +0000 (10:32 +0200)]
Move job queue to new ganeti.runtime

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

13 years agoRevert "Make it possible to call utils.Daemonize with uid and gid to run as"
René Nussbaumer [Tue, 27 Jul 2010 09:36:24 +0000 (11:36 +0200)]
Revert "Make it possible to call utils.Daemonize with uid and gid to run as"

This reverts commit 743b53d4eb9f3de46edb5e54738dab287b1979ac.

Conflicts:

lib/daemon.py

Trivial conflict resolved. This patch reverts changes from earlier permissions
separation stage. This is not needed anymore as start-stop-daemon takes care
of user switching

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

13 years agoPartial Revert "Let ganeti-rapi run under a different user/group"
René Nussbaumer [Tue, 27 Jul 2010 09:48:43 +0000 (11:48 +0200)]
Partial Revert "Let ganeti-rapi run under a different user/group"

This partially reverts commit 8b72b05c51208190796b558233d69dae7643c7f7.

Basically it removes the user involved changes

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

13 years agoMerge branch 'devel-2.2'
Michael Hanselmann [Tue, 7 Sep 2010 10:07:29 +0000 (12:07 +0200)]
Merge branch 'devel-2.2'

* devel-2.2:
  cli: Use list of options shared between commands
  jqueue: Use separate function for encoding errors
  Fix some epydoc warnings
  Fix breakage introduced by commit 8044bf655
  Remove “dry_run” from opcodes.OpCreateInstance
  Disable the RAPI CA checks in watcher
  move-instance: Fix parameter order in _CreateInstance

Conflicts:
daemons/ganeti-watcher: Trivial
lib/cli.py: Trivial

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

13 years agoMerge branch 'stable-2.2' into devel-2.2
Michael Hanselmann [Tue, 7 Sep 2010 09:53:12 +0000 (11:53 +0200)]
Merge branch 'stable-2.2' into devel-2.2

* stable-2.2:
  Fix breakage introduced by commit 8044bf655
  Remove “dry_run” from opcodes.OpCreateInstance
  Disable the RAPI CA checks in watcher
  move-instance: Fix parameter order in _CreateInstance

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

13 years agocli: Use list of options shared between commands
Michael Hanselmann [Tue, 7 Sep 2010 09:44:26 +0000 (11:44 +0200)]
cli: Use list of options shared between commands

The completion script for bash has to know about these options. Until now
the list was in two places--once in cli.py and once in
autotools/build-bash-completion. A shared list is used with this patch.

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

13 years agojqueue: Use separate function for encoding errors
Michael Hanselmann [Mon, 6 Sep 2010 19:58:31 +0000 (21:58 +0200)]
jqueue: Use separate function for encoding errors

Comes with unittest.

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

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 agoFix some epydoc warnings
Manuel Franceschini [Fri, 3 Sep 2010 10:47:51 +0000 (12:47 +0200)]
Fix some epydoc warnings

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

13 years agoFix breakage introduced by commit 8044bf655
Michael Hanselmann [Thu, 2 Sep 2010 16:34:38 +0000 (18:34 +0200)]
Fix breakage introduced by commit 8044bf655

Note to self: even patches removing one line can break everything.

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

13 years agoRemove “dry_run” from opcodes.OpCreateInstance
Michael Hanselmann [Thu, 2 Sep 2010 15:52:44 +0000 (17:52 +0200)]
Remove “dry_run” from opcodes.OpCreateInstance

I'ts declared twice, once in opcodes.OpCode and here, and this one
is redundant.

Signed-off-by: Michael Hanselmann <hansmi@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 agoDisable the RAPI CA checks in watcher
Iustin Pop [Thu, 2 Sep 2010 09:18:27 +0000 (11:18 +0200)]
Disable the RAPI CA checks in watcher

Since the RAPI certificate is not necessarily self-signed, and we
currently don't have any configuration variable for the real CA file, we
disable for now the CA checks. This fixes the 'restart RAPI every 5
minutes' problem with non-self-signed certs.

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

13 years agomove-instance: Fix parameter order in _CreateInstance
Manuel Franceschini [Wed, 1 Sep 2010 09:34:30 +0000 (11:34 +0200)]
move-instance: Fix parameter order in _CreateInstance

This patch fixes a bug, which caused the primary and secondary
destination nodes to be revered on the destination cluster after an
instance move.

Signed-off-by: Manuel Franceschini <livewire@google.com>
Reviewed-by: Michael Hanselmann <hansmi@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>