ganeti-local
15 years agoFix gnt-cluster init without cluster parameters
Alexander Schreiber [Fri, 7 Nov 2008 11:32:52 +0000 (11:32 +0000)]
Fix gnt-cluster init without cluster parameters

Reviewed-by: imsnah

15 years agoAdd new HTTP client class
Michael Hanselmann [Thu, 6 Nov 2008 11:25:10 +0000 (11:25 +0000)]
Add new HTTP client class

It is based on the WorkerPool class which is already used for the job
queue and master daemon. Each request must be encapsulated in an
instance of HttpClientRequest, which will then be passed to
HttpClientManager for processing. Upon completion, the request object
contains the response or error message.

While not yet enabled, the HTTP client implementation has been designed
with HTTP/1.1 and keep-alive in mind. For now it only uses HTTP/1.0,
though.

HttpClientManager will likely need more changes when integrating with
the RPC layer. SSL will also be integrated in a second step.

Reviewed-by: iustinp, ultrotter

15 years agoganeti.http: Use 411 Length Required in server code
Michael Hanselmann [Thu, 6 Nov 2008 11:24:49 +0000 (11:24 +0000)]
ganeti.http: Use 411 Length Required in server code

Reviewed-by: iustinp

15 years agoUpdate LUGrowDisk _WaitForSync call
Guido Trotter [Wed, 5 Nov 2008 16:37:51 +0000 (16:37 +0000)]
Update LUGrowDisk _WaitForSync call

The _WaitForSync call changed in r1794 but the GrowDisk call wasn't updated
then. This makes GrowDisk work in trunk.

Reviewed-by: iustinp

15 years agoganeti.http: Add more constants
Michael Hanselmann [Wed, 5 Nov 2008 14:04:04 +0000 (14:04 +0000)]
ganeti.http: Add more constants

As a preparation for the new HTTP client class, add more constants
to ganeti.http.

Reviewed-by: iustinp

15 years agoSmall documentation updates for workerpool.py
Iustin Pop [Mon, 27 Oct 2008 23:21:29 +0000 (23:21 +0000)]
Small documentation updates for workerpool.py

Reviewed-by: imsnah

15 years agoDocumentation updates for jqueue.py
Iustin Pop [Mon, 27 Oct 2008 23:21:11 +0000 (23:21 +0000)]
Documentation updates for jqueue.py

Reviewed-by: imsnah

15 years agoYet another bug found while reviewing docs
Iustin Pop [Mon, 27 Oct 2008 23:20:57 +0000 (23:20 +0000)]
Yet another bug found while reviewing docs

The newer_than variable can be either None or an int, and we normalize
it to an integer previously and save it in the 'serial' variable, which
should be used instead.

Reviewed-by: imsnah

15 years agoDocumentation updates for utils.py
Iustin Pop [Mon, 27 Oct 2008 23:20:25 +0000 (23:20 +0000)]
Documentation updates for utils.py

Reviewed-by: imsnah

15 years agoDocumentation updates for gnt-debug and gnt-os
Iustin Pop [Mon, 27 Oct 2008 23:20:10 +0000 (23:20 +0000)]
Documentation updates for gnt-debug and gnt-os

Reviewed-by: imsnah

15 years agoDocumentation updates for gnt-job
Iustin Pop [Mon, 27 Oct 2008 23:19:58 +0000 (23:19 +0000)]
Documentation updates for gnt-job

Reviewed-by: imsnah

15 years agoDocumentation updates for gnt-backup
Iustin Pop [Mon, 27 Oct 2008 23:19:45 +0000 (23:19 +0000)]
Documentation updates for gnt-backup

Reviewed-by: imsnah

15 years agoChange exit code of gnt-backup list
Iustin Pop [Mon, 27 Oct 2008 23:19:22 +0000 (23:19 +0000)]
Change exit code of gnt-backup list

Currently gnt-backup list exits with the same error code even if can't
contact som nodes for backup information.

The patch changes it to return 1 instead in this case.

Reviewed-by: imsnah

15 years agoDocumentation updates for gnt-node
Iustin Pop [Mon, 27 Oct 2008 23:18:45 +0000 (23:18 +0000)]
Documentation updates for gnt-node

The patch also adds a 'return 0' to a function that was missing it.

Reviewed-by: imsnah

15 years agoDocumentation updates for gnt-cluster
Iustin Pop [Mon, 27 Oct 2008 23:18:26 +0000 (23:18 +0000)]
Documentation updates for gnt-cluster

Reviewed-by: imsnah

15 years agoDocumentation updates for gnt-instance
Iustin Pop [Mon, 27 Oct 2008 23:18:11 +0000 (23:18 +0000)]
Documentation updates for gnt-instance

Reviewed-by: imsnah

15 years agoUpdate backend.py docstrings
Iustin Pop [Sat, 25 Oct 2008 00:37:25 +0000 (00:37 +0000)]
Update backend.py docstrings

This patch converts all of backend.py to epydoc formatting.

Reviewed-by: imsnah

15 years agoFix another error handling case
Iustin Pop [Sat, 25 Oct 2008 00:37:16 +0000 (00:37 +0000)]
Fix another error handling case

The return from this error path is a dict, but the actual return value
(on the non-error handling) is a list of dicts. Change accordingly.

Reviewed-by: imsnah

15 years agoFix an error handling case
Iustin Pop [Fri, 24 Oct 2008 16:14:48 +0000 (16:14 +0000)]
Fix an error handling case

Found while reviewing documentation.

Reviewed-by: ultrotter

15 years agoOSFromDisk remove superfluous empty line
Guido Trotter [Fri, 24 Oct 2008 15:23:36 +0000 (15:23 +0000)]
OSFromDisk remove superfluous empty line

Reviewed-by: iustinp

15 years agodesign-2.0-os-interface: update import/export
Guido Trotter [Fri, 24 Oct 2008 15:23:21 +0000 (15:23 +0000)]
design-2.0-os-interface: update import/export

In the end we ended up taking a slightly different approach for
import/export than the one discussed in the design doc, after
trying/talking about a few more alternatives. Document this in the
document.

Reviewed-by: iustinp

15 years agoSome documentation updates
Iustin Pop [Fri, 24 Oct 2008 14:44:15 +0000 (14:44 +0000)]
Some documentation updates

This fixes a few doc issues and converts a few docstrings to epydoc.

Reviewed-by: imsnah

15 years agoModify utils.RunCmd to write output to file
Iustin Pop [Fri, 24 Oct 2008 14:43:58 +0000 (14:43 +0000)]
Modify utils.RunCmd to write output to file

Currently we launch processes via the shell in a few places only to
redirect standard output and error to a log file ("&> $file"). It is
better to do such redirection from within RunCmd itself.

This patch splits RunCmd in two parts, the setup and the execution part,
the latter being implemented in two different functions depending on
whether we write to a file or not.

We also update the unittests with this new case.

Reviewed-by: imsnah

15 years agoganeti.http: Implement SSL certificates
Michael Hanselmann [Fri, 24 Oct 2008 11:49:01 +0000 (11:49 +0000)]
ganeti.http: Implement SSL certificates

Reviewed-by: killerfoxi

15 years agoDocument HttpServer.__init__
Michael Hanselmann [Fri, 24 Oct 2008 11:31:29 +0000 (11:31 +0000)]
Document HttpServer.__init__

At the same time, simplify the interface a bit by not using a tuple.

Reviewed-by: killerfoxi, ultrotter

15 years agoUpdate gnt-cluster man page, sections modify and queue.
Alexander Schreiber [Thu, 23 Oct 2008 16:41:24 +0000 (16:41 +0000)]
Update gnt-cluster man page, sections modify and queue.

Document the new options for gnt-cluster modify and the new queue
command.

Reviewed-by: imsnah

15 years agoUpdate gnt-cluster man page with current options.
Alexander Schreiber [Thu, 23 Oct 2008 15:13:27 +0000 (15:13 +0000)]
Update gnt-cluster man page with current options.

This patch updates the gnt-cluster man page to reflect the current
changes to gnt-cluster.

Reviewed-by: imsnah

15 years agoFix use of ToStderr in gnt-cluster
Alexander Schreiber [Thu, 23 Oct 2008 15:01:51 +0000 (15:01 +0000)]
Fix use of ToStderr in gnt-cluster

Reviewed-by: imsnah

15 years agoFix gnt-* command with --submit
Iustin Pop [Thu, 23 Oct 2008 14:19:13 +0000 (14:19 +0000)]
Fix gnt-* command with --submit

Currently we don't catch the JobSubmittedException (although the code to
format it nicely is there). The patch adds the exception name to the
catch list and makes --submit work.

Reviewed-by: imsnah

15 years agoExport the disk index in the import/export scripts
Iustin Pop [Thu, 23 Oct 2008 14:19:05 +0000 (14:19 +0000)]
Export the disk index in the import/export scripts

We want to export the disk index as some OSes will only want to export
the first disk (or the second one, etc.), even if we have multiple
disks.

The patch also updates the backend.ExportSnapshot docstring.

Reviewed-by: ultrotter

15 years agoFix leftover of hypervisor attribute rename
Iustin Pop [Thu, 23 Oct 2008 14:18:53 +0000 (14:18 +0000)]
Fix leftover of hypervisor attribute rename

Reviewed-by: imsnah

15 years agoconvert remaining print statements to ToStderr in gnt-cluster
Alexander Schreiber [Thu, 23 Oct 2008 11:58:44 +0000 (11:58 +0000)]
convert remaining print statements to ToStderr in gnt-cluster

Reviewed-by: imsnah

15 years agohttp library: Always fork before reading request
Michael Hanselmann [Thu, 23 Oct 2008 11:58:16 +0000 (11:58 +0000)]
http library: Always fork before reading request

It turned out that clients not sending a full request will stop
us from responding to further requests. This patch leverages the
situation a bit by always forking before handling the request,
but we still have DoS situations.

Reviewed-by: ultrotter

15 years agodaemon.py: Don't wake up every second
Michael Hanselmann [Thu, 23 Oct 2008 11:58:03 +0000 (11:58 +0000)]
daemon.py: Don't wake up every second

We don't have timers yet, hence waking up is not needed at all.

Reviewed-by: ultrotter

15 years agoRAPI: Export beparams as dict. The patch also enables LUQueryInstances to accept...
Oleksiy Mishchenko [Wed, 22 Oct 2008 22:41:03 +0000 (22:41 +0000)]
RAPI: Export beparams as dict. The patch also enables LUQueryInstances to accept beparams as valid field.

Reviewed-by: iustinp

15 years agoRAPI: Forgoten in r1923 instance add change.
Oleksiy Mishchenko [Wed, 22 Oct 2008 20:54:58 +0000 (20:54 +0000)]
RAPI: Forgoten in r1923 instance add change.

Reviewed-by: iustinp

15 years agoLUCreateInstance: import multiple disks
Guido Trotter [Wed, 22 Oct 2008 14:09:38 +0000 (14:09 +0000)]
LUCreateInstance: import multiple disks

Previously we used to handle only one disk. Now we'll import all the
ones present in the export, in order, on the instance's disks. Any disk
which was present on the original instance but wasn't exported is just
skipped in the target instance.

Reviewed-by: iustinp

15 years agoConvert ImportOSIntoInstance to OS API 10
Guido Trotter [Wed, 22 Oct 2008 14:09:26 +0000 (14:09 +0000)]
Convert ImportOSIntoInstance to OS API 10

- Change ImportOSIntoInstance not to get any "os_disk" and "swap_disk"
  arguments but to accept multiple target images to import, and to
  return a list of booleans with the result of each import
- Change the relevant rpc call and the only caller to conform
- Pass arguments to the import script through the environment
- Run one import os script for each disk image, passing an IMPORT_DEVICE

Reviewed-by: iustinp

15 years agoConvert ExportSnapshot to OS API 10
Guido Trotter [Wed, 22 Oct 2008 14:09:11 +0000 (14:09 +0000)]
Convert ExportSnapshot to OS API 10

We pass the data via the environment rather than on the command line, as
API 10 says. All the rest remains the same, and we export just one disk,
as the master calls this function for every snapshotted disk.

Reviewed-by: iustinp

15 years agoLUExportInstance: snapshot all disks
Guido Trotter [Wed, 22 Oct 2008 14:08:58 +0000 (14:08 +0000)]
LUExportInstance: snapshot all disks

Rather than just snapshotting the "sda" disk, we'll snapshot all of the
instance disks. If we can't snapshot a disk for any reason we'll log an
error and proceed anyway: in this case the resulting export will miss a
disk. This also changes all the warning messages to self.LogWarning().

Reviewed-by: iustinp

15 years agoConvert SnapshotBlockDevice's docstring to epydoc
Guido Trotter [Wed, 22 Oct 2008 14:08:31 +0000 (14:08 +0000)]
Convert SnapshotBlockDevice's docstring to epydoc

Reviewed-by: iustinp

15 years agoPass request headers in to RAPI handlers.
Oleksiy Mishchenko [Tue, 21 Oct 2008 20:32:37 +0000 (20:32 +0000)]
Pass request headers in to RAPI handlers.

Reviewed-by: iustinp

15 years agoMove some LU logging to use proc.Log*
Iustin Pop [Tue, 21 Oct 2008 17:54:15 +0000 (17:54 +0000)]
Move some LU logging to use proc.Log*

We change some messages which are obviously intended for the user to use
the proc.Log* functions instead of (only) the logging ones.

We also fix some wrong uses of feedback_fn.

Reviewed-by: imsnah

15 years agoImprove the mcpu.Processor logging routines
Iustin Pop [Tue, 21 Oct 2008 15:45:28 +0000 (15:45 +0000)]
Improve the mcpu.Processor logging routines

As discussed previously, many of the routinges in cmdlib.py are using
logging functions as a carry-over from 1.2 (when these also showed the
message on stderr/to the user), instead of actually warning the user.

This patch extends the syntax for Processor.LogInfo/LogWarning in order
to be easier to use them.

Reviewed-by: imsnah

15 years agoFix whitespace-at-EOL
Iustin Pop [Tue, 21 Oct 2008 13:02:05 +0000 (13:02 +0000)]
Fix whitespace-at-EOL

Please configure your editors to strip it, or enable your git hooks...

Reviewed-by: ultrotter

15 years agoGeneralize the reading of test file data
Iustin Pop [Mon, 20 Oct 2008 18:01:28 +0000 (18:01 +0000)]
Generalize the reading of test file data

Currently we have two methods in ganeti.bdev_unittest.py of computing
the test data file name - and, of course, they don't give the same
results.

The patch moves the functions to compute the test file name and reading
of its contents to the GanetiTestCase class in testutils, which allows
running the tests from the command line as well.

We also change assertFileContent to use utils.ReadFile.

Reviewed-by: imsnah

15 years agoSet default hypervisor at cluster init
Alexander Schreiber [Mon, 20 Oct 2008 16:38:28 +0000 (16:38 +0000)]
Set default hypervisor at cluster init

During cluster init, set the default hypervisor to be used for instances.
Ensure that the default hypervisor belongs to the set enabled hypervisors
for this cluster. Also fix a small bug with setting the default enabled
hypervisor list.

Reviewed-by: imsnah

15 years agoConvert the job queue rpcs to address-based
Iustin Pop [Mon, 20 Oct 2008 14:47:17 +0000 (14:47 +0000)]
Convert the job queue rpcs to address-based

The two main multi-node job queue RPC calls (jobqueue_update,
jobqueue_rename) are converted to address-based calls, in order to speed
up queue changes. For this, we need to change the _nodes attribute on
the jobqueue to be a dict {name: ip}, instead of a set.

Reviewed-by: imsnah

15 years agoConvert rpc.call_upload_file to use addresses
Iustin Pop [Mon, 20 Oct 2008 14:47:07 +0000 (14:47 +0000)]
Convert rpc.call_upload_file to use addresses

This patch allows rpc.call_upload_file to use addresses (if passed), and
also converts the ConfigWriter._DistributeConfig to pass them, since
this is an often-done operation.

Reviewed-by: imsnah

15 years agoConvert non-static rpc calls to use addresses
Iustin Pop [Mon, 20 Oct 2008 14:47:00 +0000 (14:47 +0000)]
Convert non-static rpc calls to use addresses

This patch converts all non-staticmethods rpc calls to pass addresses to
the Client calls.

This is done via two new small helpers. These functions also deal with
nodes that are not (yet) in the configuration file, and pass None for
the address instead (which allow NodeControllers to do resolving).

Reviewed-by: imsnah

15 years agoAdd infrastructure for using addresses in rpc.py
Iustin Pop [Mon, 20 Oct 2008 14:46:52 +0000 (14:46 +0000)]
Add infrastructure for using addresses in rpc.py

The patch adds support for passing node addresses to NodeController
objects, which should speed up the connect sequence.

The patch also adds another very small optimization of computing the
content-length header value in the parent Client class instead of each
NodeController.

Reviewed-by: imsnah

15 years agoImprove conformance with the style guide for rpc.py
Iustin Pop [Mon, 20 Oct 2008 14:46:44 +0000 (14:46 +0000)]
Improve conformance with the style guide for rpc.py

This patch renames some internal function to camel case, for compliance
with the style guide.

It also fixes the module docstring (how old was that?).

Reviewed-by: imsnah

15 years agoUse constants.VALUE_AUTO for ip comparison too
Guido Trotter [Mon, 20 Oct 2008 13:44:45 +0000 (13:44 +0000)]
Use constants.VALUE_AUTO for ip comparison too

Forward-port-of: r1889, Reviewed-by: imsnah

Reviewed-by: imsnah

15 years agoDocument mac option for gnt-backup import
Guido Trotter [Mon, 20 Oct 2008 13:44:32 +0000 (13:44 +0000)]
Document mac option for gnt-backup import

Forward-port-of: (r1888, r1891), Reviewed-by: (iustinp, imsnah)

Reviewed-by: imsnah

15 years agoLUCreateInstance: reuse mac address on import
Guido Trotter [Mon, 20 Oct 2008 13:44:19 +0000 (13:44 +0000)]
LUCreateInstance: reuse mac address on import

When importing an instance with the same name as the exported one if the
mac address is "auto" we try to reuse the previous mac address. One can
still force generation of a new one with mac="generate".

Forward-port-of: r1887, Reviewed-by: iustinp

Reviewed-by: imsnah

15 years agoLUCreateInstance: accept mac = VALUE_GENERATE
Guido Trotter [Mon, 20 Oct 2008 13:44:06 +0000 (13:44 +0000)]
LUCreateInstance: accept mac = VALUE_GENERATE

VALUE_GENERATE is handled exactly the same as VALUE_AUTO and the mac
address is generated randomly.

Forward-port-of: r1886, Reviewed-by: iustinp

Reviewed-by: imsnah

15 years agoAdd mac option to gnt-backup import
Guido Trotter [Mon, 20 Oct 2008 13:43:54 +0000 (13:43 +0000)]
Add mac option to gnt-backup import

Before 'auto' was the only allowed possibility

Forward-port-of: r1885, Reviewed-by: iustinp

Reviewed-by: imsnah

15 years agoAdd VALUE_AUTO and VALUE_GENERATE constants
Guido Trotter [Mon, 20 Oct 2008 13:43:34 +0000 (13:43 +0000)]
Add VALUE_AUTO and VALUE_GENERATE constants

'auto' is used in multiple place in the code with a meaning similar to
'default', 'generate' will be used to force generation of mac addresses
when the default would be to reuse an old one.

Forward-port-of: r1884, Reviewed-by: iustinp

Reviewed-by: imsnah

15 years agoRemove the logger.py module
Iustin Pop [Mon, 20 Oct 2008 12:50:50 +0000 (12:50 +0000)]
Remove the logger.py module

Since now we use only one function from the logger module
(SetupLogging), we move it to utils.py (which is already imported by all
users of this function), and we remove the module.

Reviewed-by: imsnah

15 years agoConvert http.py to use the logging module
Iustin Pop [Mon, 20 Oct 2008 12:50:37 +0000 (12:50 +0000)]
Convert http.py to use the logging module

Reviewed-by: imsnah

15 years agoConvert cmdlib.py to use the logging module
Iustin Pop [Mon, 20 Oct 2008 12:50:29 +0000 (12:50 +0000)]
Convert cmdlib.py to use the logging module

Note that many uses of logger.Error were used in 1.2 for their
side-effect of logging to stderr, where the user will see the messages,
and not for having the entry in the log. As such, we need to go over and
review every use of logging.* and decide if it should use feedback_fn
instead of being a logging call.

Reviewed-by: imsnah

15 years agoConvert hv_xen.py to use the logging module
Iustin Pop [Mon, 20 Oct 2008 12:50:22 +0000 (12:50 +0000)]
Convert hv_xen.py to use the logging module

Reviewed-by: imsnah

15 years agoConvert mcpu.py to use the logging module
Iustin Pop [Mon, 20 Oct 2008 12:50:14 +0000 (12:50 +0000)]
Convert mcpu.py to use the logging module

Reviewed-by: imsnah

15 years agoConvert ssh.py to use the logging module
Iustin Pop [Mon, 20 Oct 2008 12:50:06 +0000 (12:50 +0000)]
Convert ssh.py to use the logging module

Reviewed-by: imsnah

15 years agoConvert rpc.py to use the logging module
Iustin Pop [Mon, 20 Oct 2008 12:49:59 +0000 (12:49 +0000)]
Convert rpc.py to use the logging module

Reviewed-by: imsnah

15 years agoFix some pylint-detected issues on the scripts
Iustin Pop [Mon, 20 Oct 2008 12:33:35 +0000 (12:33 +0000)]
Fix some pylint-detected issues on the scripts

Some names were wrong, and similar stuff detected by pylint.
gnt-debug.GenericOpCode is still broken.

Reviewed-by: imsnah

15 years agoConvert the gnt scripts to ToStdout/err
Iustin Pop [Mon, 20 Oct 2008 12:33:25 +0000 (12:33 +0000)]
Convert the gnt scripts to ToStdout/err

Currently the gnt-* scripts are using a mix of print, logger.ToStd* and
sys.stderr.write. We convert them all to using cli.ToStdout/err. This
way, we can easily change the implementation for all at once.

Reviewed-by: imsnah

15 years agoConvert cli.py to logging
Iustin Pop [Mon, 20 Oct 2008 12:33:15 +0000 (12:33 +0000)]
Convert cli.py to logging

We also add two function for printing messages, so that scripts won't
have to import logger to get these. They are a simple extension over the
logger ones, as they accept the call style from logging:
 ToStdout("Message: %s", msg)
(instead of requiring formatting by the client.

Reviewed-by: imsnah

15 years agoFix gnt-instance modify with beparams
Iustin Pop [Mon, 20 Oct 2008 12:16:38 +0000 (12:16 +0000)]
Fix gnt-instance modify with beparams

The gnt-instance modify didn't work correctly w.r.t the be parameters.
There was also a typo in the corresponding LU.

Reviewed-by: imsnah

15 years agoUpdate gnt-cluster man page for removal of --hypervisor-type.
Alexander Schreiber [Mon, 20 Oct 2008 11:09:11 +0000 (11:09 +0000)]
Update gnt-cluster man page for removal of --hypervisor-type.

We no longer use a single, cluster-wide hypervisor, but configure the
actual to be used hypervisor on the instance level. The option has already
been removed from gnt-cluster.

Reviewed-by: imsnah

15 years agoRemove old HTTP server code
Michael Hanselmann [Mon, 20 Oct 2008 11:04:11 +0000 (11:04 +0000)]
Remove old HTTP server code

All users of this code have been migrated to the new and shiny HttpServer
class.

It also fixes a typo in the ApacheLogfile unittests. It has not yet been
decided whether we should keep ApacheLogfile or not, hence leaving it in.

Reviewed-by: ultrotter

15 years agoRemove --hypervisor-type from gnt-cluster.
Alexander Schreiber [Mon, 20 Oct 2008 10:47:06 +0000 (10:47 +0000)]
Remove --hypervisor-type from gnt-cluster.

We no longer use a single, cluster-wide hypervisor, but configure the
actual to be used hypervisor on the instance level.

Reviewed-by: imsnah

15 years agoFix gnt-cluster init to set cluster defaults.
Alexander Schreiber [Sat, 18 Oct 2008 22:27:43 +0000 (22:27 +0000)]
Fix gnt-cluster init to set cluster defaults.

Reviewed-by: iustinp

15 years agoAdd constants for cluster defaults
Alexander Schreiber [Sat, 18 Oct 2008 22:26:56 +0000 (22:26 +0000)]
Add constants for cluster defaults

Reviewed-by: iustinp

15 years agoCleanup os_add/rename rpc for OS API 10
Guido Trotter [Fri, 17 Oct 2008 14:37:00 +0000 (14:37 +0000)]
Cleanup os_add/rename rpc for OS API 10

- remove now unused osdev and swapdev arguments from backend, noded,
  rpc, cmdlib
- convert docstrings to epydoc

Reviewed-by: iustinp

15 years agoTemporarily explicitely break import/export
Guido Trotter [Fri, 17 Oct 2008 14:36:45 +0000 (14:36 +0000)]
Temporarily explicitely break import/export

Since they're not converted to API 10 yet, we temporarily disable the
import/export functions.

Reviewed-by: iustinp

15 years agoAddOSToInstance: convert to api10
Guido Trotter [Fri, 17 Oct 2008 14:36:35 +0000 (14:36 +0000)]
AddOSToInstance: convert to api10

Reviewed-by: iustinp

15 years agoRunRenameInstance: convert to api10
Guido Trotter [Fri, 17 Oct 2008 14:36:23 +0000 (14:36 +0000)]
RunRenameInstance: convert to api10

Reviewed-by: iustinp

15 years agoAdd new OSEnvironment function
Guido Trotter [Fri, 17 Oct 2008 14:36:12 +0000 (14:36 +0000)]
Add new OSEnvironment function

This function calculates the basic environment for OS scripts in API
version 10.

Reviewed-by: iustinp

15 years agoBump up the OS API version
Guido Trotter [Fri, 17 Oct 2008 14:35:59 +0000 (14:35 +0000)]
Bump up the OS API version

Reviewed-by: iustinp

15 years agoOSFromDisk: use script names from constants
Guido Trotter [Fri, 17 Oct 2008 14:35:43 +0000 (14:35 +0000)]
OSFromDisk: use script names from constants

Reviewed-by: iustinp

15 years agoChange OSFromDisk's docstring to epydoc
Guido Trotter [Fri, 17 Oct 2008 14:35:31 +0000 (14:35 +0000)]
Change OSFromDisk's docstring to epydoc

Plus update it with the real variable name

Reviewed-by: iustinp

15 years agoAdd LDS_BLOCK for block device backed dev types
Guido Trotter [Fri, 17 Oct 2008 14:35:17 +0000 (14:35 +0000)]
Add LDS_BLOCK for block device backed dev types

Reviewed-by: iustinp

15 years agoCreate constants to replace os scripts names
Guido Trotter [Fri, 17 Oct 2008 14:35:04 +0000 (14:35 +0000)]
Create constants to replace os scripts names

Reviewed-by: iustinp

15 years agoETag passing support.
Oleksiy Mishchenko [Fri, 17 Oct 2008 13:06:04 +0000 (13:06 +0000)]
ETag passing support.

Reviewed-by: imsnah

15 years agoMainloop: handle sigterm
Guido Trotter [Fri, 17 Oct 2008 11:08:10 +0000 (11:08 +0000)]
Mainloop: handle sigterm

This fixes removals of the pid files and clean exit in the init script

Reviewed-by: iustinp

15 years agoMainloop: init sigchld_handler as None
Guido Trotter [Fri, 17 Oct 2008 11:07:57 +0000 (11:07 +0000)]
Mainloop: init sigchld_handler as None

There is no point in initializing sigchld_handler as an empty dict, when
it will be overwritten by an instance of utils.SignalHandler
immediately after.

Reviewed-by: iustinp

15 years agoFix remote API unittest
Michael Hanselmann [Fri, 17 Oct 2008 09:47:44 +0000 (09:47 +0000)]
Fix remote API unittest

I broke it with rev 1864. This patch also removes whitespace at
line endings.

Reviewed-by: amishchenko

15 years agoEnable gnt-cluster modify to hv/beparams
Iustin Pop [Thu, 16 Oct 2008 20:39:38 +0000 (20:39 +0000)]
Enable gnt-cluster modify to hv/beparams

This patch enables the cluster modify to change:
  - enabled hypervisor list
  - hvparams (per hypervisor)
  - beparams (only the default group)

Syntax:
  gnt-cluster modify -B vcpus=3 -H xen-pvm:no_initrd_path

Validation for parameters is somewhat missing - the individual
hypervisors will be checked for syntax and validation, but beparams
doesn't have validation yes (nowhere), it should be added here once we
have a global method (will come soon).

Reviewed-by: imsnah

15 years agorapi: Convert to new HTTP server class
Michael Hanselmann [Thu, 16 Oct 2008 16:54:02 +0000 (16:54 +0000)]
rapi: Convert to new HTTP server class

Requests are no longer logged to a separate file.

Reviewed-by: amishchenko

15 years agodesign-2.0-cluster-parameters: escape final _
Guido Trotter [Thu, 16 Oct 2008 16:38:32 +0000 (16:38 +0000)]
design-2.0-cluster-parameters: escape final _

In rst a final _ is used for linking. Escaping it prevents an error at
compile time on design-2.0-cluster-parameters.rst

Reviewed-by: iustinp

15 years agoShow the cluster parametrs in gnt-cluster info
Iustin Pop [Thu, 16 Oct 2008 16:26:04 +0000 (16:26 +0000)]
Show the cluster parametrs in gnt-cluster info

This is just a raw update without any special formatting.

Reviewed-by: imsnah

15 years agoRAPI: Instance add/delete implementation.
Oleksiy Mishchenko [Thu, 16 Oct 2008 14:40:33 +0000 (14:40 +0000)]
RAPI: Instance add/delete implementation.

Reviewed-by: iustinp

15 years agoOS Design: invert new and old name
Guido Trotter [Thu, 16 Oct 2008 13:35:15 +0000 (13:35 +0000)]
OS Design: invert new and old name

Internally in ganeti we already have renamed the instance, so it's
better to pass the new name in INSTANCE_NAME and the old one in
OLD_INSTANCE_NAME rather than the old name in INSTANCE_NAME and the new
one in NEW_INSTANCE_NAME as this reflects what the cluster thinks.

Reviewed-by: iustinp

15 years agoReally fix with the zombie test (hopefully)
Iustin Pop [Thu, 16 Oct 2008 13:05:18 +0000 (13:05 +0000)]
Really fix with the zombie test (hopefully)

So, instead of any timeouts for synchronization, we move to actual
events. We still have one (huge) timeout for pathological cases (just to
cleanup), but we don't sleep at all in normal usage.

The patch moves the zombie/cleaned up child creation out from setUp(),
and to on-demand by the functions. We remove all signal handler usage,
instead we rely on the fact that when a process is cleaned up, its FDs
are closed, so the read end of a pipe will get an event.

Reviewed-by: imsnah

15 years agoFix job queue behaviour when loading jobs
Iustin Pop [Thu, 16 Oct 2008 12:08:47 +0000 (12:08 +0000)]
Fix job queue behaviour when loading jobs

Currently, if loading a job fails, the job queue code raises an
exception and prevents the proper processing of the jobs in the queue.
We change this so that unparseable jobs are instead archived (if not
already).

Reviewed-by: imsnah

15 years agoPrevent master failover if we have wrong data
Iustin Pop [Thu, 16 Oct 2008 11:36:52 +0000 (11:36 +0000)]
Prevent master failover if we have wrong data

If we don't actually know the current master (as determined via voting),
we prevent the failover.

The patch also changes some messages (capitalization, typos).

Reviewed-by: ultrotter

15 years agoImprovements to the master startup checks
Iustin Pop [Thu, 16 Oct 2008 11:36:17 +0000 (11:36 +0000)]
Improvements to the master startup checks

In order to account for future improvements to master failover, we move
the actual data gathering capabilities from ganeti-masterd into
bootstrap.py, and we leave only the verification into masterd.

The verification procedure is then changed to retry multiple times (up
to one minute) in case most nodes do not respond, and also the algorithm
is changed to require at least half (but not half+1) votes, since our
vote also should count (and we vote for ourselves).

Example for consistent (config-wise) cluster:
  - 5 node cluster, 2 nodes down: still start
  - 4 node cluster, 2 nodes down: retry for one minute, abort

Reviewed-by: ultrotter

15 years agoProvide example for backend parameters
René Nussbaumer [Thu, 16 Oct 2008 08:37:14 +0000 (08:37 +0000)]
Provide example for backend parameters

Update the design about cluster parameters and provide
some example of backend parameters. By now this includes
all supported parameters.

Reviewed-by: iustinp, ultrotter

15 years agoAdd an interface for the drain flag changes/query
Iustin Pop [Thu, 16 Oct 2008 08:37:00 +0000 (08:37 +0000)]
Add an interface for the drain flag changes/query

This adds the set/reset in the jqueue and luxi modules, and a way to
query it in OpQueryConfigValues, and also the comand line interface for
it:
$ gnt-cluster queue info
The drain flag is unset
$ gnt-cluster queue drain
$ gnt-cluster queue info
The drain flag is set
$ gnt-cluster queue undrain
$ gnt-cluster queue info
The drain flag is unset

The choice of making the setting via luxi and not an opcode is that
opcodes can't be executed when drained, but we don't query via luxi
since in the future it might become a cluster property as opposed to a
node one.

Reviewed-by: imsnah