ganeti-local
15 years agoGaneti 2.0 cluster parameters design doc
Alexander Schreiber [Tue, 7 Oct 2008 08:47:51 +0000 (08:47 +0000)]
Ganeti 2.0 cluster parameters design doc

Reviewed-by: ultrotter

15 years agoImplement job 'waiting' status
Iustin Pop [Tue, 7 Oct 2008 08:03:19 +0000 (08:03 +0000)]
Implement job 'waiting' status

Background: when we have multiple jobs in the queue (more than just a
few), many of the jobs (up to the number of threads) will be in state
'running', although many of them could be actually blocked, waiting for
some locks. This is not good, as one cannot easily see what is
happening.

The patch extends the opcode/job possible statuses with another one,
waiting, which shows that the LU is in the acquire locks phase. The
mechanism for doing so is simple, we initialize (in the job queue) the
opcode with OP_STATUS_WAITLOCK, and when the processor is ready to give
control to the LU's Exec, it will call a notifier back into the
_JobQueueWorker that sets the opcode status to OP_STATUS_RUNNING (with
the proper queue locking). Because this mechanism does not save the job,
all opcodes on disk will be in status WAITLOCK and not RUNNING anymore,
so we also change the load sequence to consider WAITLOCK as RUNNING.

With the patch applied, creating in parallel (via burnin) five instances
on a five node cluster shows that only two are executing, while three
are waiting for locks.

Reviewed-by: imsnah

15 years agoOS Interface design doc
Guido Trotter [Tue, 7 Oct 2008 07:25:56 +0000 (07:25 +0000)]
OS Interface design doc

Reviewed-by: imsnah

15 years agoAdd .. contents:: marker to design docs
Guido Trotter [Tue, 7 Oct 2008 07:25:38 +0000 (07:25 +0000)]
Add .. contents:: marker to design docs

Reviewed-by: imsnah

15 years agoImplement job auto-archiving
Iustin Pop [Mon, 6 Oct 2008 16:42:18 +0000 (16:42 +0000)]
Implement job auto-archiving

This patch adds a new luxi call that implements auto-archiving of jobs
older than a certain age (or -1 for all completed jobs), and the gnt-job
command that makes use of this (with 'all' for -1).

Reviewed-by: imsnah

15 years agoAdd a simple timespec parsing function
Iustin Pop [Mon, 6 Oct 2008 15:59:32 +0000 (15:59 +0000)]
Add a simple timespec parsing function

This function will be used for auto-archiving jobs via the command line.
The function is pretty simple, we only support up to weeks since months
and higher are not 'precise' entities, and dealing with them would
require us to start using calendar functions.

Reviewed-by: imsnah

15 years agobackend.py change to get cluster name from master
Iustin Pop [Mon, 6 Oct 2008 15:58:26 +0000 (15:58 +0000)]
backend.py change to get cluster name from master

Currently there are three function in backend that need the cluster name
in order to instantiate an SshRunner. The patch changes these to get the
cluster name from the master in the rpc call; once the multi-hypervisor
change is implemented, then very few places in which we need the SCR
remain in the backend.

Reviewed-by: killerfoxi, imsnah

15 years agoDisable re-reading of config file
Iustin Pop [Mon, 6 Oct 2008 15:56:31 +0000 (15:56 +0000)]
Disable re-reading of config file

Since the objects read from the config file are passed to the various
threads, it's unsafe to re-read the config file (and throw away
ConfigWriter._config_data). As such, we disable the re-reading of the
file (since now the master is the owner the file, it makes not sense to
re-read it), and any modifications to the file must be done offline,
otherwise they will be overwritten.

Reviewed-by: imsnah

15 years agoRAPI Desing Doc
Oleksiy Mishchenko [Mon, 6 Oct 2008 15:13:40 +0000 (15:13 +0000)]
RAPI Desing Doc

Reviewed-by: iustinp

15 years agoStart implementation of parallel burnin
Iustin Pop [Mon, 6 Oct 2008 14:11:02 +0000 (14:11 +0000)]
Start implementation of parallel burnin

This patch introduces a simple framework for executing jobs in parallel
in burnin (the ExecJobSet function) and the "--parallel" command line
flag.

The patch also changes the instance creation to run in parallel when the
above flag is given. Error handling/instance removal is currently flacky
with this options if there are errors in the instance creation.

We also modify burnin to reuse a single client.

Reviewed-by: imsnah

15 years agoFix gnt-job list with empty timestamps
Iustin Pop [Mon, 6 Oct 2008 13:40:52 +0000 (13:40 +0000)]
Fix gnt-job list with empty timestamps

In case the job object doesn't have a timestamp (which is a separate
issue), the listing should not break. We fix this by changing the
FormatTimstamp function itself to return '?' in case the timestamp
doesn't look good (note that it still can break if non-integers are
returned, but this is unlikely).

Reviewed-by: imsnah

15 years agoIncrease the number of threads to 25
Iustin Pop [Mon, 6 Oct 2008 13:29:51 +0000 (13:29 +0000)]
Increase the number of threads to 25

Since our locks are not gathered nicely, we can have jobs that are
actually blocking on locks (parallel burnin shows this), so at least we
need to increase the number of threads above the usual number of jobs we
could have in a such a case.

Reviewed-by: imsnah

15 years agoMinor cleanups & typo fixes.
Alexander Schreiber [Mon, 6 Oct 2008 13:21:28 +0000 (13:21 +0000)]
Minor cleanups & typo fixes.

Reviewed-by: iustinp

15 years agoFix SshRunner breakage from the changed API
Iustin Pop [Mon, 6 Oct 2008 13:16:23 +0000 (13:16 +0000)]
Fix SshRunner breakage from the changed API

More places actually use the SshRunner than just the gnt-cluster
commands.

Reviewed-by: ultrotter

15 years agoChange SshRunner usage
Iustin Pop [Mon, 6 Oct 2008 11:48:59 +0000 (11:48 +0000)]
Change SshRunner usage

Currently the SshRunner uses a SimpleConfigReader instance, however this
is not best. We change it to use the cluster name directly (and its
constructor now takes this as parameter, instead of SCR), and its
callers are change to pass the name directly.

As a consequence, we can now remove the initialization of SCR in
gnt-cluster (copyfile and command), and instead we query the master for
the cluster name).

Reviewed-by: imsnah

15 years agoUpdate document describing cluster security
Michael Hanselmann [Mon, 6 Oct 2008 11:01:49 +0000 (11:01 +0000)]
Update document describing cluster security

It may need further updates, but here's a start.

Reviewed-by: ultrotter

15 years agoFix ssconf.GetMasterAndMyself
Iustin Pop [Sun, 5 Oct 2008 09:16:03 +0000 (09:16 +0000)]
Fix ssconf.GetMasterAndMyself

The ssconf migration left this out.

Reviwed-by: imsnah,ultrotter

15 years agoFix a mistake in the gnt-backup man page
Iustin Pop [Fri, 3 Oct 2008 14:32:30 +0000 (14:32 +0000)]
Fix a mistake in the gnt-backup man page

The actual location is /export, not /exports.

Reviewed-by: ultrotter

15 years agoUse docbook2* paths found during configure for actual build
Michael Hanselmann [Thu, 2 Oct 2008 10:22:57 +0000 (10:22 +0000)]
Use docbook2* paths found during configure for actual build

docbook-wrapper had the names for the docbook2* programs hardcoded. This
patch changes Makefile.am and the wrapper script to pass them via
another argument.

Another issue where rapi.in was built before rapi-resources.sgml is
also fixed.

Reviewed-by: iustinp

15 years agoRemove references to Twisted framework
Michael Hanselmann [Thu, 2 Oct 2008 10:22:02 +0000 (10:22 +0000)]
Remove references to Twisted framework

Reviewed-by: iustinp

15 years agoGet rid of ssconf
Michael Hanselmann [Wed, 1 Oct 2008 17:37:29 +0000 (17:37 +0000)]
Get rid of ssconf

Remove leftovers from ssconf.

Reviewed-by: iustinp

15 years agoDon't pass sstore to LUs anymore
Michael Hanselmann [Wed, 1 Oct 2008 17:37:05 +0000 (17:37 +0000)]
Don't pass sstore to LUs anymore

sstore is no longer used in LUs.

Reviewed-by: iustinp

15 years agoConvert ganeti-master
Michael Hanselmann [Wed, 1 Oct 2008 17:36:51 +0000 (17:36 +0000)]
Convert ganeti-master

Use simpleconfig instead of ssconf.

Reviewed-by: iustinp

15 years agoConvert ganeti-watcher
Michael Hanselmann [Wed, 1 Oct 2008 17:36:20 +0000 (17:36 +0000)]
Convert ganeti-watcher

Use RPC calls instead of ssconf.

Reviewed-by: iustinp

15 years agoConvert ganeti-noded
Michael Hanselmann [Wed, 1 Oct 2008 17:36:09 +0000 (17:36 +0000)]
Convert ganeti-noded

Replace ssconf with utility functions.

Reviewed-by: iustinp

15 years agoConvert gnt-cluster
Michael Hanselmann [Wed, 1 Oct 2008 17:35:59 +0000 (17:35 +0000)]
Convert gnt-cluster

Replace ssconf with configuration.

Reviewed-by: iustinp

15 years agoConvert bootstrap.py
Michael Hanselmann [Wed, 1 Oct 2008 17:35:49 +0000 (17:35 +0000)]
Convert bootstrap.py

Replace ssconf with configuration.

Reviewed-by: iustinp

15 years agoConvert cmdlib.py
Michael Hanselmann [Wed, 1 Oct 2008 17:35:37 +0000 (17:35 +0000)]
Convert cmdlib.py

Replacing ssconf with configuration. Cluster rename is broken and stays
that way.

Reviewed-by: iustinp

15 years agoConvert ssh.py
Michael Hanselmann [Wed, 1 Oct 2008 17:35:21 +0000 (17:35 +0000)]
Convert ssh.py

Get rid of ssconf and convert to configuration instead.

Reviewed-by: iustinp

15 years agoConvert rpc.py
Michael Hanselmann [Wed, 1 Oct 2008 17:34:59 +0000 (17:34 +0000)]
Convert rpc.py

Replacing ssconf with utility functions.

Reviewed-by: iustinp

15 years agoConvert hypervisor
Michael Hanselmann [Wed, 1 Oct 2008 17:34:48 +0000 (17:34 +0000)]
Convert hypervisor

Replacing ssconf with configuration.

Reviewed-by: iustinp

15 years agoConvert mcpu.py
Michael Hanselmann [Wed, 1 Oct 2008 17:34:32 +0000 (17:34 +0000)]
Convert mcpu.py

Replacing ssconf with configuration.

Reviewed-by: iustinp

15 years agoConvert config.py
Michael Hanselmann [Wed, 1 Oct 2008 17:34:18 +0000 (17:34 +0000)]
Convert config.py

The configuration version is now again in the configuration file.

Reviewed-by: iustinp

15 years agoConvert backend.py
Michael Hanselmann [Wed, 1 Oct 2008 17:34:05 +0000 (17:34 +0000)]
Convert backend.py

Replacing ssconf with simpleconfig.

Reviewed-by: iustinp

15 years agoAdd new query to get cluster config values
Michael Hanselmann [Wed, 1 Oct 2008 17:33:52 +0000 (17:33 +0000)]
Add new query to get cluster config values

This can be used to retrieve certain cluster config values from
within clients.

OpDumpClusterConfig was not used anywhere, hence I'm just reusing
it. The way ConfigWriter.DumpConfig returned the configuration
was not thread-safe, anyway (no deepcopy).

Reviewed-by: iustinp

15 years agoMove functions from ssconf.py elsewhere
Michael Hanselmann [Wed, 1 Oct 2008 17:33:33 +0000 (17:33 +0000)]
Move functions from ssconf.py elsewhere

These functions will be used to access config values instead of using
ssconf.

Reviewed-by: iustinp

15 years agoAdd simple configuration reader/writer classes
Michael Hanselmann [Wed, 1 Oct 2008 17:33:18 +0000 (17:33 +0000)]
Add simple configuration reader/writer classes

This will be used to read the configuration file in the node daemon.
The write functionality is needed for master failover.

Reviewed-by: iustinp

15 years agoFix the watcher with down nodes
Iustin Pop [Wed, 1 Oct 2008 09:27:27 +0000 (09:27 +0000)]
Fix the watcher with down nodes

The watcher didn't handle the down nodes, fix this by ignoring (in
secondary node reboot checks) any node that doesn't return a boot id.

Reviewed-by: imsnah

15 years agoFix the watcher not restarting instance bug
Iustin Pop [Wed, 1 Oct 2008 09:27:17 +0000 (09:27 +0000)]
Fix the watcher not restarting instance bug

The watcher was using conflicting attributes of the instance:
  - it queried the admin_/oper_state, which are booleans
  - but it compared those to the status (which is a text field)

The code was changed to query the aggregated 'status' field, as that
will also return indication of node problems, and we can use this only
one field for all decisions. We still ask for the admin_state field as
that is needed for the activate disks check (in secondary node restart).

The patch also touches the watcher in some other parts:
  - log exceptions nicer
  - convert a method to @staticmethod
  - remove unused imports

Reviewed-by: imsnah

15 years agoRemove last use of utils.RunCmd from the watcher
Iustin Pop [Wed, 1 Oct 2008 09:27:07 +0000 (09:27 +0000)]
Remove last use of utils.RunCmd from the watcher

The watcher has one last use of ganeti commands as opposed to sending
requests via luxi. The patch changes this to use the cli functions.

The patch also has two other changes:
  - fix the docstring for OpVerifyDisks (found out while converting
    this)
  - enable stderr logging on the watcher when “-d” is passes

Reviewed-by: imsnah

15 years agoFix unittests broken by revision 1727
Michael Hanselmann [Wed, 1 Oct 2008 09:24:18 +0000 (09:24 +0000)]
Fix unittests broken by revision 1727

Reviewed-by: iustinp

15 years agoAdd cluster options from ssconf to configuration
Michael Hanselmann [Wed, 1 Oct 2008 09:03:22 +0000 (09:03 +0000)]
Add cluster options from ssconf to configuration

ssconf will become write-only from ganeti-masterd's point of view,
therefore all settings in there need to go into the main configuration
file.

Reviewed-by: iustinp

15 years agoMove instantiation of config into bootstrap.py
Michael Hanselmann [Wed, 1 Oct 2008 09:03:06 +0000 (09:03 +0000)]
Move instantiation of config into bootstrap.py

Future patches will add even more variables to the cluster config.
Adding more parameters wouldn't make the function easier to use and
it doesn't make sense to pass them to another function, as it's
only done once in bootstrap.py on cluster initialization.

Reviewed-by: iustinp

15 years agoChange the results from cli.PollJob
Iustin Pop [Wed, 1 Oct 2008 08:29:16 +0000 (08:29 +0000)]
Change the results from cli.PollJob

Curently PollJob accepts a generic job, but will return (history
artifact) only the first opcode result. This is wrong, as it doesn't
allow polling of a job with multiple results.

Its only caller (for now) is also changed, so no functional changes
should happen.

Reviewed-by: ultrotter, amishchenko

15 years agoAdd list of build dependencies
Michael Hanselmann [Tue, 30 Sep 2008 15:01:54 +0000 (15:01 +0000)]
Add list of build dependencies

Reviewed-by: iustinp

15 years agoBuild HTML from RST input
Michael Hanselmann [Tue, 30 Sep 2008 12:28:14 +0000 (12:28 +0000)]
Build HTML from RST input

This patch also adds the design documents to Makefile.am.

Reviewed-by: iustinp

15 years agoFix ‘gnt-job info’ with no arguments
Iustin Pop [Tue, 30 Sep 2008 12:22:13 +0000 (12:22 +0000)]
Fix ‘gnt-job info’ with no arguments

I didn't realize that my zip will break when no args are passed...

Reviewed-by: imsnah

15 years agoAdd output of job/opcode timestamps
Iustin Pop [Tue, 30 Sep 2008 12:13:26 +0000 (12:13 +0000)]
Add output of job/opcode timestamps

This patch adds posibility of selection of job/opcode timestamps in
gnt-job list and info.

The code handling the possible cases (None or a valid timestamps) are
ugly though...

Reviwed-by: imsnah

15 years agoEnhance the job-related timestamps
Iustin Pop [Tue, 30 Sep 2008 12:04:31 +0000 (12:04 +0000)]
Enhance the job-related timestamps

This patch adds start, stop, and received timestamp for jobs (and allows
querying of them), and allows querying of the opcode timestamps.

Reviewed-by: imsnah

15 years agoSmall fixes for master daemon design document
Michael Hanselmann [Tue, 30 Sep 2008 11:36:46 +0000 (11:36 +0000)]
Small fixes for master daemon design document

It said CLI/RAPI will talk to master using HTTP, which isn't true. Add
a reference to job queue design document. Small typos.

Reviewed-by: iustinp

15 years agoImport design doc for commandline arguments
Alexander Schreiber [Tue, 30 Sep 2008 11:16:15 +0000 (11:16 +0000)]
Import design doc for commandline arguments

Reviewed-by: iustinp

15 years agolocking design: code path and declarations
Guido Trotter [Tue, 30 Sep 2008 10:21:21 +0000 (10:21 +0000)]
locking design: code path and declarations

Reviewed-by: iustinp

15 years agolocking design: explain use of async mode
Guido Trotter [Tue, 30 Sep 2008 10:21:10 +0000 (10:21 +0000)]
locking design: explain use of async mode

Before we were discussing this possible future feature, and its
drawbacks, but not its usefulness. This patch corrects this.

Reviewed-by: iustinp

15 years agolocking design: talk about removing locks
Guido Trotter [Tue, 30 Sep 2008 10:20:58 +0000 (10:20 +0000)]
locking design: talk about removing locks

Reviewed-by: iustinp

15 years agoImport (and update) granular locking design doc
Guido Trotter [Tue, 30 Sep 2008 10:07:08 +0000 (10:07 +0000)]
Import (and update) granular locking design doc

Reviewed-by: iustinp

15 years agoAbstract the timestamp formatting into cli.py
Iustin Pop [Tue, 30 Sep 2008 09:36:49 +0000 (09:36 +0000)]
Abstract the timestamp formatting into cli.py

Currently we format the timestamp inside the gnt-job info function. We
will need this more times in the future, so move it to cli.py as a
separate, exported function.

Reviewed-by: imsnah

15 years agoAdd job queue design document
Michael Hanselmann [Mon, 29 Sep 2008 17:55:49 +0000 (17:55 +0000)]
Add job queue design document

Reviewed-by: iustinp

15 years agoAdd an 'index' of design documents
Iustin Pop [Mon, 29 Sep 2008 16:18:30 +0000 (16:18 +0000)]
Add an 'index' of design documents

This will be an overview document, enumerating the changes without going
into details and pointing to the actual documents.

Reviewed-by: ultrotter

15 years agoAdd opcode execution log in job info
Iustin Pop [Mon, 29 Sep 2008 15:38:40 +0000 (15:38 +0000)]
Add opcode execution log in job info

This patch adds the job execution log in “gnt-job info” and also allows
its selection in “gnt-job list” (however here it's not very useful as
it's not easy to parse). It does this by adding a new field in the query
job call, named ‘oplog’.

With this, one can get a very clear examination of the job. What remains
to be added would be timestamps for start/stop of the processing for the
job itself and its opcodes.

Reviewed-by: imsnah

15 years agoMove a hardcoded constant to constants.py
Iustin Pop [Mon, 29 Sep 2008 13:15:33 +0000 (13:15 +0000)]
Move a hardcoded constant to constants.py

For now we only use the ‘C’ protocol so we can put it in constants.py
instead of hardcoding it.

Reviewed-by: imsnah

15 years agoEnable the use of shared secrets
Iustin Pop [Mon, 29 Sep 2008 13:15:20 +0000 (13:15 +0000)]
Enable the use of shared secrets

This patch enables the use of the shared secrets for DRBD8 disks, using
(hardcoded in constants.py) the md5 digest algorithm.

For making this more flexible, either we implement a cluster parameter
(once the new model is in place), or we can make it ./configure-time
selectable.

Reviewed-by: imsnah

15 years agoExtend DRBD disks with shared secret attribute
Iustin Pop [Mon, 29 Sep 2008 13:15:08 +0000 (13:15 +0000)]
Extend DRBD disks with shared secret attribute

This patch, which is similar to r1679 (Extend DRBD disks with minors
attribute), extends the logical and physical id of the DRBD disks with a
shared secret attribute. This is generated at disk creation time and
saved in the config file.

The generation of the secret is done so that we don't have duplicates in
the configuration (otherwise the goal of preventing cross-connection
will not be reached), so we add to config.py more than just a simple
call to utils.GenerateSecret().

The patch does not yet enable the use of the secrets.

Reviewed-by: imsnah

15 years agoAdd a info subcommand to gnt-job
Iustin Pop [Mon, 29 Sep 2008 13:09:53 +0000 (13:09 +0000)]
Add a info subcommand to gnt-job

Currently, it is hard to examine a job in detail; the output of ‘gnt-job
list’ is not easy to parse.

The patch adds a ‘gnt-job info’ command that is (vaguely) similar to
‘gnt-instance info’ in that it shows in a somewhat easy to understand
format the details of a job.

The result formatter is the most complicated part, since the results are
not standardized; the code attempts to format nicely the most common
result types (as taken from a random job list), via a generic algorithm.

Reviewed-by: imsnah

15 years agoImplement job summary in gnt-job list
Iustin Pop [Mon, 29 Sep 2008 13:09:34 +0000 (13:09 +0000)]
Implement job summary in gnt-job list

It is not currently possibly to show a summary of the job in the output
of “gnt-job list”. The closes is listing the whole opcode(s), but that
is too verbose. Also, the default output (id, status) is not very
useful, unless one looks for (and knows about) an exact job ID.

The patch adds a “summary” description of a job composed of the list of
OP_ID of the individual opcodes. Moreover, if an opcode has a ‘logical’
target in a certain opcode field (e.g. start instance has the instance
name as the target), then it is included in the formatting also. It's
easier to explain via a sample output:

gnt-job list
ID Status  Summary
1  error   NODE_QUERY
2  success NODE_ADD(gnta2)
3  success CLUSTER_QUERY
4  success NODE_REMOVE(gnta2.example.com)
5  error   NODE_QUERY
6  success NODE_ADD(gnta2)
7  success NODE_QUERY
8  success OS_DIAGNOSE
9  success INSTANCE_CREATE(instance1.example.com)
10 success INSTANCE_REMOVE(instance1.example.com)
11 error   INSTANCE_CREATE(instance1.example.com)
12 success INSTANCE_CREATE(instance1.example.com)
13 success INSTANCE_SHUTDOWN(instance1.example.com)
14 success INSTANCE_ACTIVATE_DISKS(instance1.example.com)
15 error   INSTANCE_CREATE(instance2.example.com)
16 error   INSTANCE_CREATE(instance2.example.com)
17 success INSTANCE_CREATE(instance2.example.com)
18 success INSTANCE_ACTIVATE_DISKS(instance1.example.com)
19 success INSTANCE_ACTIVATE_DISKS(instance2.example.com)
20 success INSTANCE_SHUTDOWN(instance1.example.com)
21 success INSTANCE_SHUTDOWN(instance2.example.com)

This is done by a simple change to the opcode classes, which allows an
opcode to format itself. The additional function is small enough that it
can go in opcodes.py, where it could also be used by a client if needed.

Reviewed-by: imsnah

15 years agoNicely sort the job list
Iustin Pop [Mon, 29 Sep 2008 13:08:44 +0000 (13:08 +0000)]
Nicely sort the job list

Unless we decide to change the job identifiers to integer, we should at
least sort the list returned by _GetJobIDsUnlocked.

Reviewed-by: imsnah

15 years agoMove the pseudo-secret generation to utils.py
Iustin Pop [Sun, 28 Sep 2008 14:44:52 +0000 (14:44 +0000)]
Move the pseudo-secret generation to utils.py

The bootstrap code needs a pseudo-secret and this is currently generated
inside the InitGanetiServerSetup function. Since more users will need
this, move it to utils.py

Reviewed-by: ultrotter

15 years agoFix a bug related to static minors
Iustin Pop [Sun, 28 Sep 2008 14:43:30 +0000 (14:43 +0000)]
Fix a bug related to static minors

When the node does not yet have any minors allocated, the first minor
(0) will not be entered in the ConfigWriter._temporary_drbds structure.
This does not happen for our current usage, since we always ask for two
minors (so the next call will not match this case), but it will be
triggered if we only ask for one minor, and then ask again before adding
the instance to the config file.

Reviewed-by: ultrotter

15 years agoAdd checks for tcp/udp port collisions
Iustin Pop [Sat, 27 Sep 2008 20:45:01 +0000 (20:45 +0000)]
Add checks for tcp/udp port collisions

In case the config file is manually modified, or in case of bugs, the
tcp/udp ports could be reused, which will create various problems
(instances not able to start, or drbd disks not able to communicate).

This patch extends the ConfigWriter.VerifyConfig() method (which is used
in cluster verify) to check for duplicates between:
  - the ports used for DRBD disks
  - the ports used for network console
  - the ports marked as free in the config file

Also, if the cluster parameter ‘highest_used_port’ is actually lower
than the computed highest used port, this is also flagged as an error.

The output from gnt-cluster verify will show (output manually wrapped):

node1 # gnt-cluster verify
* Verifying global settings
  - ERROR: tcp/udp port 11006 has duplicates: instance3.example.com/network port,
instance2.example.com/drbd disk sda
  - ERROR: tcp/udp port 11017 has duplicates: instance3.example.com/drbd disk sda,
instance3.example.com/drbd disk sdb, cluster/port marked as free
  - ERROR: Highest used port mismatch, saved 11010, computed 11017
* Gathering data (2 nodes)
...

Reviewed-by: ultrotter

15 years agoUpdate the cluster serial_no on certain operations
Iustin Pop [Sat, 27 Sep 2008 15:58:51 +0000 (15:58 +0000)]
Update the cluster serial_no on certain operations

This patch adds update of the cluster serial number for:
  - add/remove node (as the cluster's node list is changed)
  - add/remove/rename instance (as the cluster's instance list is changed)
  - change the volume group name

The rule for updating this attribute is when cluster-wide properties are
changed, but not individual node/instance ones.

There are other remaining cases to handle, pending on the ssconf
changes.

Reviewed-by: ultrotter

15 years agoAllow listing of the serial_no via gnt-* list
Iustin Pop [Sat, 27 Sep 2008 15:58:41 +0000 (15:58 +0000)]
Allow listing of the serial_no via gnt-* list

This patch adds listing of the serial_no attribute in gnt-instance and
gnt-node list, and updates to the manpages to reflect the change.

Reviewed-by: ultrotter

15 years agoInitialize and update the serial_no on objects
Iustin Pop [Sat, 27 Sep 2008 15:58:22 +0000 (15:58 +0000)]
Initialize and update the serial_no on objects

This patch add initialization of the serial_no on instance and nodes,
and update of the field whenever an object is updated in the generic
case, via ConfigWriter.Update(obj) and in the specific case of
instances' state being modified manually.

Reviewed-by: ultrotter

15 years agoSwitch the global serial_no to the top object
Iustin Pop [Sat, 27 Sep 2008 15:58:13 +0000 (15:58 +0000)]
Switch the global serial_no to the top object

Currently the serial_no that is incremented every time the configuration
file is written is located on the 'cluster' object in the configuration
structure. However, this is wrong as the cluster serial_no should be
incremented only when the cluster state is changed (for whatever
definition of “changed” we will use), not simply because the
configuration file is written.

This patch changes so that the ConfigWriter._BumpSerialNo affects the
top-level ConfigData object.

Reviewed-by: ultrotter

15 years agoAdd serial_no attributes to objects
Iustin Pop [Sat, 27 Sep 2008 15:58:03 +0000 (15:58 +0000)]
Add serial_no attributes to objects

This patch adds the ‘serial_no’ attribute to the other top-level objects
(the configuration object itself, the nodes and the instances).

Reviewed-by: ultrotter

15 years agoReplace a cfg.AddInstance with UpdateInstance
Iustin Pop [Sat, 27 Sep 2008 15:57:52 +0000 (15:57 +0000)]
Replace a cfg.AddInstance with UpdateInstance

This seems to be the last (deprecated) use of AddInstance in order to
update an instance.

The patch also removes a whitespace-at-eol case.

Reviewed-by: ultrotter

15 years agoAdd design doc for the disk changes
Iustin Pop [Sat, 27 Sep 2008 11:32:52 +0000 (11:32 +0000)]
Add design doc for the disk changes

Reviewed-by: imsnah

15 years agoFix iallocator name
René Nussbaumer [Thu, 25 Sep 2008 09:40:13 +0000 (09:40 +0000)]
Fix iallocator name

port forward of patch from revision 1690 with following message:

Patch on revision 1686 used the wrong field: ial.name, which is the instance
name and not the iallocator name. self.op.iallocator is the right field.

Sorry for this inconvenience.

Reviewed-by: imsnah

15 years agoFix a broken format string
René Nussbaumer [Thu, 25 Sep 2008 08:42:14 +0000 (08:42 +0000)]
Fix a broken format string

This patch fixes a broken format string. It's expecting 3 parameters, but only
gets 2. This change will add the missing parameter. This is a forward-port
of the fix in Ganeti 1.2

Reviewed-by: imsnah

15 years agoDesign doc for the master daemon
Iustin Pop [Wed, 24 Sep 2008 17:35:31 +0000 (17:35 +0000)]
Design doc for the master daemon

It's not complete, but I hope it's up to date. It's restructured text,
but no make rules or such for html output are needed, it's readable
as-is.

Reviewed-by: imsnah

15 years agoSwitch config.py to logging
Iustin Pop [Wed, 24 Sep 2008 13:43:32 +0000 (13:43 +0000)]
Switch config.py to logging

A couple of more modules are using the obsolete logger functions, config
being one of them.

Reviewed-by: imsnah

15 years agoSwitch to static minors for DRBD
Iustin Pop [Tue, 23 Sep 2008 12:10:44 +0000 (12:10 +0000)]
Switch to static minors for DRBD

With some todos remaining, this patch switches the DRBD devices to use
the passed minors, and the cmdlib code (add instance and replace disks)
to request and assign minors to the DRBD disks.

Todos:
  - look at the disk RPC calls to see which can be optimized away, since
    we now know the minor beforehand
  - remove the _FindUnusedMinor usage from the few places it's still
    used (not for actual disks, but for temporary use in meta devs) and
    eventually replace with _CheckMinorUnused or such

Of course, this and/or the previous two patches break existing clusters.
Again.

Reviewed-by: imsnah

15 years agoImplement config support for drbd static minors
Iustin Pop [Tue, 23 Sep 2008 12:10:35 +0000 (12:10 +0000)]
Implement config support for drbd static minors

This patch adds support for allocating static minors.

Like for the LVM uuids, we add a new cache for the temporarily allocated
requests, and the users of the new methods must manually clear the
cache. If this doesn't happen, at worst we lose some minors.

Todos remaining:
  - implement duplicate check at configuration load, and at instance
    add/instance update
  - investigate automatically cleaning the cache on instance add/update
    if the minors/instance/node pairs match

Reviewed-by: imsnah

15 years agoFix disk replace secondary with static minors
Iustin Pop [Tue, 23 Sep 2008 12:10:26 +0000 (12:10 +0000)]
Fix disk replace secondary with static minors

The code in 'updating instance configuration' section of the replace
disks with change secondary node was setting a wrong new logical_id for
the drbd devices (only set the new node, not the new minor). The patch
fixes this by remembering the new logical_id that we use for activating
the drbd and reusing it (instead of recomputing).

Since the minors are not needed to be allocated before the LVs are
created, we also move the minor allocation step (currently as None)
after this step.

Reviewed-by: imsnah

15 years agoExtend DRBD disks with minors attribute
Iustin Pop [Mon, 22 Sep 2008 11:32:16 +0000 (11:32 +0000)]
Extend DRBD disks with minors attribute

This patch converts the DRBD disks to contain also a minor (per each
node) attribute. This minor is not yet used and is always initialized
with None, so the patch does not have any real-world impact - except for
automatically upgrading config files (it adds the minors as None, None).

Reviewed-by: imsnah

15 years agoApply filter properly in LUQuery{Nodes, Instances} v2.0.0alpha0
Guido Trotter [Thu, 18 Sep 2008 11:13:10 +0000 (11:13 +0000)]
Apply filter properly in LUQuery{Nodes, Instances}

Currently when not locking all nodes/instances are returned, regardless
if the user asked only for some of them. With this patch we return to
the previous behaviour:
  - if no names are specified return info on all current ones
  - if some names are specified and are not found give an error
  - otherwise return only info on the specified names

Reviewed-by: iustinp

15 years agoRemove auto_balance from burnin/cmdlib
Guido Trotter [Thu, 18 Sep 2008 11:12:50 +0000 (11:12 +0000)]
Remove auto_balance from burnin/cmdlib

There is no such feature in trunk yet.

Reviewed-by: iustinp

15 years agoAdd utils.ReadFile function
Michael Hanselmann [Wed, 17 Sep 2008 16:07:40 +0000 (16:07 +0000)]
Add utils.ReadFile function

It abstracts exception handling and is like a complement to
utils.WriteFile.

Reviewed-by: iustinp

15 years agodoc/locking.txt: Job queue functions can be called from LUs
Michael Hanselmann [Wed, 17 Sep 2008 14:51:49 +0000 (14:51 +0000)]
doc/locking.txt: Job queue functions can be called from LUs

The previous description was unclear. Reported by Guido Trotter.

Reviewed-by: ultrotter

15 years agoMake burnin aware of hvm device type flags.
Alexander Schreiber [Fri, 12 Sep 2008 08:23:09 +0000 (08:23 +0000)]
Make burnin aware of hvm device type flags.

Merged from branches/ganeti/ganeti-1.2 r1648
Use static values for new hvm instance flags

Reviewed-by: iustinp

15 years agoGetAllInstancesInfo, change internal iterator name
Guido Trotter [Thu, 11 Sep 2008 17:45:55 +0000 (17:45 +0000)]
GetAllInstancesInfo, change internal iterator name

GetAllInstancesInfo used "node" as an iterator name. Change it to
instance to make it less confusing.

Reviewed-by: iustinp

15 years agognt-instance: fix tags commands online help
Guido Trotter [Thu, 11 Sep 2008 17:45:39 +0000 (17:45 +0000)]
gnt-instance: fix tags commands online help

It used to refer to "nodes", which was confusing.

Reviewed-by: iustinp

15 years agoParallelize Tag operations
Guido Trotter [Thu, 11 Sep 2008 17:45:26 +0000 (17:45 +0000)]
Parallelize Tag operations

For now we lock the instance/node for adding/deleting tags from it, but
we could probably in the future do without, with more support from the
config for atomic operations.

Reviewed-by: iustinp

15 years agoParallelize LUSetClusterParams (and add a FIXME)
Guido Trotter [Thu, 11 Sep 2008 17:44:52 +0000 (17:44 +0000)]
Parallelize LUSetClusterParams (and add a FIXME)

Reviewed-by: imsnah

15 years agoFix a typo in gnt-instance.sgml
Guido Trotter [Thu, 11 Sep 2008 09:46:10 +0000 (09:46 +0000)]
Fix a typo in gnt-instance.sgml

Reviewed-by: imsnah

15 years agoParallelize LURemoveExport
Guido Trotter [Thu, 11 Sep 2008 09:44:58 +0000 (09:44 +0000)]
Parallelize LURemoveExport

Reviewed-by: imsnah

15 years agoParallelize LURemoveInstance
Guido Trotter [Thu, 11 Sep 2008 09:44:46 +0000 (09:44 +0000)]
Parallelize LURemoveInstance

Using the new add/remove infrastructure this becomes pretty easy! :)

Reviewed-by: imsnah

15 years agoParallelize LUCreateInstance
Guido Trotter [Thu, 11 Sep 2008 09:44:33 +0000 (09:44 +0000)]
Parallelize LUCreateInstance

Finally, instance create on different node, without iallocator, can run
in parallel. Iallocator usage still needs all nodes to be locked,
unfortunately. As a bonus most checks which could have been moved to
ExpandNames, before any locking is done.

Reviewed-by: imsnah

15 years agoImplement adding/removal of locks by declaration
Guido Trotter [Thu, 11 Sep 2008 09:44:21 +0000 (09:44 +0000)]
Implement adding/removal of locks by declaration

With this patch LUs can declare locks to be added when they start and/or
removed after they finish. For now locks can only be added in the
acquired state, and removed if owned, and added locks default to be
removed again, unless some action is taken.

Reviewed-by: imsnah

15 years agoLockSet: forbid add() on a partially owned set
Guido Trotter [Thu, 11 Sep 2008 09:44:08 +0000 (09:44 +0000)]
LockSet: forbid add() on a partially owned set

This patch bans add() on a half-acquired set. This behavior was
previously possible, but created a deadlock if someone tried to acquire
the set-lock in the meantime, and thus is now forbidden. The
testAddRemove unit test is fixed for this new behavior, and includes a
few more lines of testing and a new testConcurrentSetLockAdd function
tests its behavior in the concurrent case.

Reviewed-by: imsnah

15 years agoFix typo in a locking.py comment
Guido Trotter [Thu, 11 Sep 2008 09:43:54 +0000 (09:43 +0000)]
Fix typo in a locking.py comment

Reviewed-by: imsnah

15 years agoUse is_owned to determine whether to unlock
Guido Trotter [Thu, 11 Sep 2008 09:43:41 +0000 (09:43 +0000)]
Use is_owned to determine whether to unlock

Now that is_owned is public we don't need to play games at the end of an
LU. If we're still owning anything we just release it.

Reviewed-by: imsnah