ganeti-local
16 years agoAdd a custom str() method for objects.Disk
Iustin Pop [Fri, 26 Oct 2007 10:25:18 +0000 (10:25 +0000)]
Add a custom str() method for objects.Disk

This is done in order to easy debugging of disk-related issues.

Reviewed-by: imsnah

16 years agoModify two mirror-device related rpc calls
Iustin Pop [Thu, 25 Oct 2007 11:22:39 +0000 (11:22 +0000)]
Modify two mirror-device related rpc calls

The two calls mirror_addchild and mirror_removechild take only one child
for addition/removal. While this is enough for our md usage, for local
disk replacement in drbd8, we need to be able to specify both the data
and metadata device. This patch modifies these two rpc calls (and their
backend implementation and their usage in cmdlib) to take a list of
children to add/remove.

Reviewed-by: imsnah

16 years agoInitial implementation of drbd8 template type
Iustin Pop [Wed, 24 Oct 2007 14:43:24 +0000 (14:43 +0000)]
Initial implementation of drbd8 template type

This is a partially working drbd8 template type. It does:
  - add/remove
  - startup/failover/shutdown

Not working is replace disks, which needs custom code for this template.

Reviewed-by: imsnah

16 years agoAllow DRBD8 to sync after sb1-pri with no changes
Iustin Pop [Wed, 24 Oct 2007 14:41:54 +0000 (14:41 +0000)]
Allow DRBD8 to sync after sb1-pri with no changes

Currently the way we shutdown or startup disks seems to make DRBD8
unhappy. Until we rewrite the sequence of (de)activation, allow DRBD to
connect after a sb1-pri condition with no changes to the data.

Reviewed-by: imsnah

16 years agoFix a disk handling bug triggered by failover
Iustin Pop [Wed, 24 Oct 2007 14:23:41 +0000 (14:23 +0000)]
Fix a disk handling bug triggered by failover

This leaves an instance's disks configured for the primary node as after
disk activation we want to start the instance anyway. As such,
_GatherBlockDevs in backend.py will need the disks configured for the
primary.

Reviewed-by: imsnah

16 years agoAdd DRBD8 class for handling drbd version 8.x
Iustin Pop [Wed, 24 Oct 2007 13:30:40 +0000 (13:30 +0000)]
Add DRBD8 class for handling drbd version 8.x

This duplicates some code from the DRBDev class, but not very much, and
it will be expanded with the new functionality available for the 8.x
version. Currently the code is not accessible outside the module.

This patch introduces a dependency on the pyparsing module.

Reviewed-by: imsnah

16 years agoMove/rename _IsValidMeta to base drbd class
Iustin Pop [Wed, 24 Oct 2007 13:30:17 +0000 (13:30 +0000)]
Move/rename _IsValidMeta to base drbd class

The DRBDev._IsValidMeta only checks for the metadata device size. Since
this is a useful check (but not complete) for DRBD8, move it to the base
class and name it _CheckMetaSize.

Reviewed-by: imsnah

16 years agoMore abstractions from DRBD7 to base class
Iustin Pop [Wed, 24 Oct 2007 13:24:20 +0000 (13:24 +0000)]
More abstractions from DRBD7 to base class

This moves the _SetFromMinor and _MassageProcData to the base class.

Reviewed-by: imsnah

16 years agoImprove out-of-minors handling
Iustin Pop [Wed, 24 Oct 2007 13:24:02 +0000 (13:24 +0000)]
Improve out-of-minors handling

Currently, the out-of-minors handling is not very good: though both MD
and DRBD functions for finding an unused minor can return None, only the
DRBD code checks for this case.

This patch improves this by making the functions _FindUnusedMinor raise
an error instead of None, and gets rid of the one manual check for the
return value.

Reviewed-by: imsnah

16 years agoMove some methods from DRBDev to BaseDRBD
Iustin Pop [Wed, 24 Oct 2007 13:23:35 +0000 (13:23 +0000)]
Move some methods from DRBDev to BaseDRBD

Since some of the methods and constants are valid for both 0.7 and 8.x
versions, we move them to the base class.

Reviewed-by: imsnah

16 years agoSome tiny style fixes
Iustin Pop [Fri, 19 Oct 2007 11:49:19 +0000 (11:49 +0000)]
Some tiny style fixes

Reviewed-by: imsnah

16 years agoSplit some DRBD functionality based on versions
Iustin Pop [Fri, 19 Oct 2007 11:48:17 +0000 (11:48 +0000)]
Split some DRBD functionality based on versions

This is a small split of some functionality from the DRBDev class into a
base drbd class that holds just a few things, in order to make migration
to drbd 8.x easier.

Reviewed-by: imsnah

16 years agoAbstract more strings values into constants
Iustin Pop [Fri, 19 Oct 2007 11:48:00 +0000 (11:48 +0000)]
Abstract more strings values into constants

Currently, the disk types are defined using constants in the code.
Convert those into constants so that we can easily find them and check
their usage.

Note that we don't rename the values of the constants as they are used
in the configuration file, and as such it's best to leave them as they
are.

Reviewed-by: imsnah

16 years agoImplement disk failure QA test.
Michael Hanselmann [Thu, 18 Oct 2007 13:02:03 +0000 (13:02 +0000)]
Implement disk failure QA test.

Testing failure on the primary node is currently disabled due to drbd problems.

Reviewed-by: iustinp

16 years agoPatch series for reboot feature, part 3
Alexander Schreiber [Thu, 18 Oct 2007 10:26:34 +0000 (10:26 +0000)]
Patch series for reboot feature, part 3

This patch series implements the reboot command for gnt-instance. It
supports three types of reboot: soft (hypervisor reboot), hard (instance
config rebuild and reboot) and full (full instance shutdown and startup
again).

This patch contains the gnt-instance script and the man page for it.

Reviewed-by: iustinp

16 years agoPatch series for reboot feature, part 2
Alexander Schreiber [Thu, 18 Oct 2007 10:25:50 +0000 (10:25 +0000)]
Patch series for reboot feature, part 2

This patch series implements the reboot command for gnt-instance. It
supports three types of reboot: soft (hypervisor reboot), hard (instance
config rebuild and reboot) and full (full instance shutdown and startup
again).

This patch contains the opcode and lu part.

Reviewed-by: iustinp

16 years agoPatch series for reboot feature, part 1
Alexander Schreiber [Wed, 17 Oct 2007 15:00:59 +0000 (15:00 +0000)]
Patch series for reboot feature, part 1

This patch series implements the reboot command for gnt-instance. It
supports three types of reboot: soft (hypervisor reboot), hard (instance
config rebuild and reboot) and full (full instance shutdown and startup
again).

This patch contains the backend and rpc part of the patch.

Reviewed-by: iustinp

16 years agoFix unit tests for hooks.
Alexander Schreiber [Wed, 17 Oct 2007 14:36:02 +0000 (14:36 +0000)]
Fix unit tests for hooks.

Reviewed-by: imsnah

16 years agoMake “gnt-cluster verify” exit 0 if there's no problem with instances.
Michael Hanselmann [Tue, 16 Oct 2007 15:27:07 +0000 (15:27 +0000)]
Make “gnt-cluster verify” exit 0 if there's no problem with instances.

Reviewed-by: schreiberal

16 years agotiny typing fixup
Alexander Schreiber [Tue, 16 Oct 2007 14:45:32 +0000 (14:45 +0000)]
tiny typing fixup

Reviewed-by: imsnah

16 years agoAdd the number of VCPUs in gnt-instance info
Iustin Pop [Tue, 16 Oct 2007 14:30:24 +0000 (14:30 +0000)]
Add the number of VCPUs in gnt-instance info

Reviewed-by: imsnah

16 years agoAllow force removal of instances
Iustin Pop [Tue, 16 Oct 2007 13:51:51 +0000 (13:51 +0000)]
Allow force removal of instances

This patch adds a new option to the instance removal command
"--ignore-failures" that forces the removal of the instance from the
configuration even if the removal process encounters errors.

In order to be able to do this when the remote node(s) is(are) down, we
need to restrict the execution of the instance removal hook to the
master only. I think this is a reasonable trade-off (but I'm not sure).

Reviewed-by: imsnah

16 years agoReplace more ssh paths with proper constants
Iustin Pop [Tue, 16 Oct 2007 08:28:26 +0000 (08:28 +0000)]
Replace more ssh paths with proper constants

The node's ssh keys filenames are now provided as constants; this should
allow easier customization.

Also, the user's ssh key computing has been abstracted into ssh.py

Reviewed-by: imsnah

16 years agoTrivial typing fixups.
Alexander Schreiber [Mon, 15 Oct 2007 13:06:15 +0000 (13:06 +0000)]
Trivial typing fixups.

Reviewed-by: iustinp

16 years agoFix node daemon log file permissions
Iustin Pop [Mon, 15 Oct 2007 13:04:35 +0000 (13:04 +0000)]
Fix node daemon log file permissions

The creation of the log file for the node daemon lacks the mode
parameter, so after applying the current umask, the file got 0700
permissions. Restrict this to the correct 0600.

Reviewed-by: schreiberal

16 years agoDo QA tests on “gnt-os“, including partially valid OSes.
Michael Hanselmann [Mon, 15 Oct 2007 12:16:17 +0000 (12:16 +0000)]
Do QA tests on “gnt-os“, including partially valid OSes.

Reviewed-by: iustinp

16 years agoDon't take unused parameter in qa_utils.py:Print{Info,Error}.
Michael Hanselmann [Mon, 15 Oct 2007 12:08:43 +0000 (12:08 +0000)]
Don't take unused parameter in qa_utils.py:Print{Info,Error}.

Reviewed-by: iustinp

16 years agoMake “gnt-os diagnose” exit 1 if not all OSes are valid.
Michael Hanselmann [Mon, 15 Oct 2007 11:45:13 +0000 (11:45 +0000)]
Make “gnt-os diagnose” exit 1 if not all OSes are valid.

Reviewed-by: iustinp

16 years agoSmall wording changes and fix checks.
Michael Hanselmann [Fri, 12 Oct 2007 15:41:12 +0000 (15:41 +0000)]
Small wording changes and fix checks.

Reviewed-by: iustinp

16 years agoRemove some hardcoded names/paths from backend.py
Iustin Pop [Fri, 12 Oct 2007 14:53:16 +0000 (14:53 +0000)]
Remove some hardcoded names/paths from backend.py

This patch does the following:
  - add constants.GANETI_RUNAS = "root", which is used to compute
    the homedir (and thus the .ssh directory) instead of hardcoding
    "/root/.ssh" in backend.AddNode and backend.LeaveCluster
  - add constants.SSH_CONFIG_DIR (currently hardcoded to /etc/ssh) that
    is used in backend instead of hardcoding it (preparation for
    selecting that at ./configure time)
  - some more internal cleanup in backend.AddNode

Reviewed-by: imsnah

16 years agoTest “gnt-node evacuate” and “gnt-node failover” in QA.
Michael Hanselmann [Fri, 12 Oct 2007 14:33:26 +0000 (14:33 +0000)]
Test “gnt-node evacuate” and “gnt-node failover” in QA.

Reviewed-by: schreiberal

16 years agoAdd a generic write file function
Iustin Pop [Fri, 12 Oct 2007 13:02:15 +0000 (13:02 +0000)]
Add a generic write file function

Currently there are a few version of "write a file safely" in the code.
This patch adds a generic function that should be able to replace all
the other versions.

The "take attributes from the target file" option, while useful, is not
implemented by this patch.

Reviewed-by: imsnah,ultrotter

16 years agoDo not walk the whole DATA_DIR on node leave
Iustin Pop [Fri, 12 Oct 2007 12:30:42 +0000 (12:30 +0000)]
Do not walk the whole DATA_DIR on node leave

Since we remove only files from DATA_DIR and not from subdirectories,
let's not walk the entire tree, a simple listdir suffices. Also switch
to utils.RemoveFile from simple os.unlink.

Reviewed-by: imsnah

16 years agoEnhance GetHomeDir to accept either names or UIDs
Iustin Pop [Fri, 12 Oct 2007 12:27:11 +0000 (12:27 +0000)]
Enhance GetHomeDir to accept either names or UIDs

Currently GetHomeDir accepts UIDs only. Enhance it to accept either a
user name or a user id, to allow for nicer usage.

Reviewed-by: imsnah

16 years agoReorder gnt-os simplify _GetAllOS and call it _DiagnoseByOS
Guido Trotter [Fri, 12 Oct 2007 12:26:30 +0000 (12:26 +0000)]
Reorder gnt-os simplify _GetAllOS and call it _DiagnoseByOS

Put some order in gnt-os putting helper functions above and command functions
below. Also add a new _DiagnoseOSName() function and use it to make _GetAllOS
simplier to understand. Change its name to _DiagnoseByOS which makes more clear
what it does.

Reviewed-by: iustinp

16 years agoFix ListOS which was broken
Guido Trotter [Fri, 12 Oct 2007 11:19:15 +0000 (11:19 +0000)]
Fix ListOS which was broken

To do this we abstract the creation of the all_os dictionary, which was
produced in DiagnoseOS and use it both for listing and diagnosing.

Reviewed-by: iustinp

16 years agoSome small improvements to the hooks environment
Iustin Pop [Thu, 11 Oct 2007 15:23:31 +0000 (15:23 +0000)]
Some small improvements to the hooks environment

For the configuration update hook, it's useful to have a consistent name
for the target of the operation. As such, the LU code is modified to
include an GANETI_OP_TARGET that points either to the cluster (name),
node name or instance name depending on the opcode.

Also, the NoHooksLU is modified such that its build env method returns
an empty (but conformant) result. This should improve things in case by
mistake this class' BuildHooksEnv is called.

Reviewed-by: imsnah

16 years agoImplement post-configuration-update hook
Iustin Pop [Thu, 11 Oct 2007 15:23:06 +0000 (15:23 +0000)]
Implement post-configuration-update hook

This patch adds a special hook: the post-configuration update hook. This
hook has only a post phase that runs after a top-level LU that modified
the configuration.

Since the hook is a post-phase one, no error checking is done on the
results. The hook runs only on the master.

Reviewed-by: imsnah

16 years agoSplit the hooks env building in two parts
Iustin Pop [Thu, 11 Oct 2007 15:00:50 +0000 (15:00 +0000)]
Split the hooks env building in two parts

This patch moves some of the environment processing from _BuildEnv to a
new _RunWrapper command which does the stringification and adds the
sstore variables.

The reasoning is that the sstore can be fresher than before the
execution (e.g.  in case of cluster init).

In order to support thise, we also need to modify cmdlib.LUInitCluster:
  - memorize the sstore and cfgw newly created in the Exec function
  - no need to build the custom environment in the BuildHooks

16 years agoMove hook execution decision to HooksMaster
Iustin Pop [Thu, 11 Oct 2007 15:00:16 +0000 (15:00 +0000)]
Move hook execution decision to HooksMaster

Currently, the HooksMaster creation and execution decision is in the
Processor class. This is not optimal, so we change to always create a
hooks master and instead make the decision inside that class, by
creating empty node lists for both pre and post if the lu doesn't
support hooks. This way, hooks decisions are moved to HooksMaster (where
they belong).

Reviewed-by: imsnah

16 years agoRemove cfg and sstore parameters to HooksMaster
Iustin Pop [Thu, 11 Oct 2007 14:59:49 +0000 (14:59 +0000)]
Remove cfg and sstore parameters to HooksMaster

The HooksMaster class doesn't use the cfg parameter, and it's better to
use it from the LU anyway (if needed). Let's remove it.

Also, the sstore of the LU can be fresher than the sstore we got at init
time, so use that instead and remove our own.

Reviewed-by: imsnah

16 years agoEnable the ConfigWriter to keep track of updates
Iustin Pop [Thu, 11 Oct 2007 14:55:10 +0000 (14:55 +0000)]
Enable the ConfigWriter to keep track of updates

This allows external callers to determine if the configuration has been
changed.

Reviewed-by: imsnah

16 years agoDocstring correction
Oleksiy Mishchenko [Thu, 11 Oct 2007 14:47:00 +0000 (14:47 +0000)]
Docstring correction

Reviewed-by: iustinp

16 years agoInfrastructure for detailed instance restarts, part one
Alexander Schreiber [Thu, 11 Oct 2007 13:39:28 +0000 (13:39 +0000)]
Infrastructure for detailed instance restarts, part one

The beginning of the infrastructure for detailed instance restarts. Does
not affect behaviour if code yet.

Reviewed-by: iustinp

16 years agoUse the kernel's ability to generate UUIDs.
Michael Hanselmann [Thu, 11 Oct 2007 12:04:44 +0000 (12:04 +0000)]
Use the kernel's ability to generate UUIDs.

This removes the dependency on either the uuid module or e2fsprogs' uuidgen.

Reviewed-by: iustinp

16 years agoAdd small function to read the homedir of a user
Iustin Pop [Thu, 11 Oct 2007 08:02:46 +0000 (08:02 +0000)]
Add small function to read the homedir of a user

This can be used to replace hardcoded "/root/" paths.

Reviewed-by: imsnah

16 years agoRemove fping as a dependency for Ganeti.
Alexander Schreiber [Wed, 10 Oct 2007 17:20:21 +0000 (17:20 +0000)]
Remove fping as a dependency for Ganeti.

This patch completely  gets rid of fping
 - replace all fping invocations with TcpPing calls
 - update documentation accordingly.
 - associated cleanups (use constant for localhost IP, use more sensible
   defaults for TcpPing and _use_ those)

Reviewed-by: iustinp

16 years agoColours and warnings.
Michael Hanselmann [Wed, 10 Oct 2007 15:51:44 +0000 (15:51 +0000)]
Colours and warnings.

- Implement colours in qa_utils.
- Print warning for cron script.

Reviewed-by: iustinp

16 years agoSome small fixes to utils.GenerateTable
Iustin Pop [Wed, 10 Oct 2007 15:06:21 +0000 (15:06 +0000)]
Some small fixes to utils.GenerateTable

This adds:
  - fix the case when a dumb caller didn't stringify its values
  - explicitly raise a ProgrammerError in case a field is missing from
    the headers dictionary

Reviewed-by: imsnah

16 years agoFix AskUser to not die on extra input
Iustin Pop [Wed, 10 Oct 2007 14:04:51 +0000 (14:04 +0000)]
Fix AskUser to not die on extra input

Currently, AskUser dies with -ESPIPE if the user gives more than one
character plus newline. This is because the python library, while
returning only two chars from the readline(2) call, will cache the rest
of the input, and when we do a write, it will try to seek back to just
after the last returned char. This fails on /dev/tty, so an exception is
raised. However, then opening the file descriptor in O_APPEND mode,
python will not issue such seeks, thereby fixing this problem.

The other alternative, opening in unbuffered mode, is not as good, since
then python will issue one-byte reads at a time, but the tty will read
the entire line, so at the next readline call, whatever remained in the
descriptor buffer is returned from the kernel to python, and the user
doesn't get a chance to enter something at all.

Reviewed-by: imsnah

16 years agoExit ganeti-watcher cleanly when there's no configuration.
Michael Hanselmann [Wed, 10 Oct 2007 13:05:29 +0000 (13:05 +0000)]
Exit ganeti-watcher cleanly when there's no configuration.

Reviewed-by: iustinp

16 years agoImplement gnt-node evacuate
Iustin Pop [Wed, 10 Oct 2007 11:10:07 +0000 (11:10 +0000)]
Implement gnt-node evacuate

This patch adds a new 'evacuate' subcommand to gnt-node. The command
will do a replace disks for all instances having that node as secondary
with the new target being the new node given.

The syntax is:
  gnt-node evacuate src_node target_node

The command by itself doesn't do any resource checks, and instead relies
on the LUFailoverInstance code to do that.

Reviewed-by: imsnah

16 years agoMake Xen DomU kernel and initrd configurable at build time.
Michael Hanselmann [Wed, 10 Oct 2007 10:58:48 +0000 (10:58 +0000)]
Make Xen DomU kernel and initrd configurable at build time.

Reviewed-by: iustinp

16 years agoAdd preliminary developer notes.
Michael Hanselmann [Wed, 10 Oct 2007 10:09:14 +0000 (10:09 +0000)]
Add preliminary developer notes.

Reviewed-by: iustinp

16 years agoRemove the shebang from modules
Iustin Pop [Wed, 10 Oct 2007 10:00:06 +0000 (10:00 +0000)]
Remove the shebang from modules

Since modules are not directly executables, remove the shebang from
them. This helps with lintian warnings.

Also make the autogenerated _autoconf.py contain two comment lines at
the beginning, like the other modules.

Reviewed-by: ultrotter

16 years agoDetect node restarts and reactivate disks.
Michael Hanselmann [Wed, 10 Oct 2007 08:12:21 +0000 (08:12 +0000)]
Detect node restarts and reactivate disks.

- Change format of watcher state file to JSON.
- Move log path for watcher script to constants.py.

Reviewed-by: iustinp

16 years agoImplement node failover
Iustin Pop [Tue, 9 Oct 2007 13:48:12 +0000 (13:48 +0000)]
Implement node failover

This patch implements a simple failover command for failing over all
primary instances. This is just a batched form of gnt-instance failover.

Reviewed-by: imsnah

16 years agoDo not install init script in PREFIX/bin.
Michael Hanselmann [Tue, 9 Oct 2007 13:01:20 +0000 (13:01 +0000)]
Do not install init script in PREFIX/bin.

Reviewed-by: ultrotter

16 years agoRefactor DiagnoseOS
Guido Trotter [Tue, 9 Oct 2007 11:15:23 +0000 (11:15 +0000)]
Refactor DiagnoseOS

The new version debugs Hidden OSes as well.

Reviewed-by: iustinp

16 years agoFix a wrong exception name
Iustin Pop [Tue, 9 Oct 2007 09:13:56 +0000 (09:13 +0000)]
Fix a wrong exception name

This was introduced in rev 208.

Reviewed-by: imsnah

16 years agoSeparate error formatting out of cli.GenericMain
Iustin Pop [Tue, 9 Oct 2007 09:13:38 +0000 (09:13 +0000)]
Separate error formatting out of cli.GenericMain

This patch moves the error formatting into a separate function that will
be exported so that scripts that execute multiple opcodes can create the
same output as for GenericMain. Also, GenericMain becomes more readable.

Reviewed-by: imsnah

16 years agoRevert a debugging 'raise' from rev 195
Iustin Pop [Tue, 9 Oct 2007 07:42:30 +0000 (07:42 +0000)]
Revert a debugging 'raise' from rev 195

As far as I understand, this was just a debugging aid. Remove it so that
configuration errors are nicely handled.

Reviewed-by: imsnah

16 years agoEnhance cli.SubmitOpcode to use custom parameters
Iustin Pop [Tue, 9 Oct 2007 07:39:34 +0000 (07:39 +0000)]
Enhance cli.SubmitOpcode to use custom parameters

This patch allows the SubmitOpcode function to take a pre-created
Processor instance and a different feedback function. This is helpful
when submitting more than one opcode from a shell script.

Reviewed-by: imsnah

16 years agoAdd boot id to “gnt-node list”.
Michael Hanselmann [Mon, 8 Oct 2007 15:18:54 +0000 (15:18 +0000)]
Add boot id to “gnt-node list”.

Reviewed-by: iustinp

16 years agoAdd handler for errors.TagError
Iustin Pop [Mon, 8 Oct 2007 15:12:28 +0000 (15:12 +0000)]
Add handler for errors.TagError

This patch adds a simple handler for TagError that prints the error
(better than having a stack dump).

Reviewed-by: imsnah

16 years agoAdd source file option for {add,remove}-tags
Iustin Pop [Mon, 8 Oct 2007 15:12:11 +0000 (15:12 +0000)]
Add source file option for {add,remove}-tags

This patch adds a '--from' option to the {add,remove}-tags commands that
allows the command to read from a file or from stdin (when passing a
dash for the filename).

Reviewed-by: imsnah

16 years agoUpdate man pages for the tags operations
Iustin Pop [Mon, 8 Oct 2007 15:11:45 +0000 (15:11 +0000)]
Update man pages for the tags operations

This adds documentation on the {list,add,remove}-tags commands to the
gnt-{cluster,node,instance} man pages.

Reviewed-by: imsnah

16 years agoChange gnt-cluster.sgml to use refsect2
Iustin Pop [Mon, 8 Oct 2007 15:11:28 +0000 (15:11 +0000)]
Change gnt-cluster.sgml to use refsect2

This brings this man page in conformity to gnt-node and (partially) to
gnt-instance.

Reviewed-by: imsnah

16 years agoImplement command-line tags support
Iustin Pop [Mon, 8 Oct 2007 15:11:14 +0000 (15:11 +0000)]
Implement command-line tags support

This patch adds generic functions for tag manipulations to cli.py and
modifies gnt-{cluster,node,instance} to export {list,add,remove}-tags
commands that use those.

Reviewed-by: imsnah

16 years agoChange tags add/remove to process multiple tags
Iustin Pop [Mon, 8 Oct 2007 15:10:52 +0000 (15:10 +0000)]
Change tags add/remove to process multiple tags

This patch changes the tags opcodes to work with multiple tags at once
instead of only one. As such, the opcodes and some parameters are
renamed.

Reviewed-by: imsnah

16 years agoFix super() calls for objects.Cluster
Iustin Pop [Mon, 8 Oct 2007 15:10:34 +0000 (15:10 +0000)]
Fix super() calls for objects.Cluster

Reviewed-by: imsnah

16 years agoFix tags operations for instances
Iustin Pop [Mon, 8 Oct 2007 15:10:18 +0000 (15:10 +0000)]
Fix tags operations for instances

Reviewed-by: imsnah

16 years agoExtend GenericMain with a way to override options
Iustin Pop [Mon, 8 Oct 2007 14:42:03 +0000 (14:42 +0000)]
Extend GenericMain with a way to override options

This allows scripts to pass options to generic functions (options that
are not visible in the command line).

Reviewed-by: imsnah

16 years agoDon't remove Makefile.in when doing maintainer-clean.
Michael Hanselmann [Mon, 8 Oct 2007 14:26:53 +0000 (14:26 +0000)]
Don't remove Makefile.in when doing maintainer-clean.

Reviewed-by: iustinp

16 years agoUse indenting if supported by simplejson.
Michael Hanselmann [Mon, 8 Oct 2007 10:48:35 +0000 (10:48 +0000)]
Use indenting if supported by simplejson.

Reviewed-by: iustinp

16 years agoFix “make distcheck”.
Michael Hanselmann [Mon, 8 Oct 2007 10:03:17 +0000 (10:03 +0000)]
Fix “make distcheck”.

- Move symlink to “ganeti” to top dir
- Add ganeti.config_unittest.py to tests to be run
- Make sure everything is built before tests are run

Reviewed-by: iustinp

16 years agoAdd function to list files in a directory, excluding those beginning with a
Michael Hanselmann [Mon, 8 Oct 2007 08:59:26 +0000 (08:59 +0000)]
Add function to list files in a directory, excluding those beginning with a
dot.

Reviewed-by: iustinp

16 years agoRemove redundant check.
Guido Trotter [Thu, 4 Oct 2007 15:49:40 +0000 (15:49 +0000)]
Remove redundant check.

This isdir() check leads to a broken error message. Even fixing it creates some
cases in which the error message is nebulous and unclear while removing it
makes this situation be dealt with a lot better by the _OSOndiskVersion checks.

Reviewed-by: iustinp

16 years agoForgotten files from last commit, NEWS and Makefile.am.
Michael Hanselmann [Thu, 4 Oct 2007 12:40:57 +0000 (12:40 +0000)]
Forgotten files from last commit, NEWS and Makefile.am.

Reviewed-by: iustinp, ultrotter

16 years agoShip (and display) path for InvalidOS errors too.
Guido Trotter [Thu, 4 Oct 2007 11:51:25 +0000 (11:51 +0000)]
Ship (and display) path for InvalidOS errors too.

- Document the expected change to errors.InvalidOS
- Always pass the additional argument
- Modify DiagnoseOS output to show the path

Reviewed-by: iustinp, imsnah

16 years agoChange configuration storage format from Pickle to JSON.
Michael Hanselmann [Thu, 4 Oct 2007 11:33:32 +0000 (11:33 +0000)]
Change configuration storage format from Pickle to JSON.

- Add NEWS file with major changes between versions.
- Bump RPC version number
- No longer serialize in RPC, but just convert to dict

Old Pickle based configuration files can be converted using the cfgupgrade
utility.

Reviewed-by: iustinp, ultrotter

16 years agoFix OS Diagnose in light of the new OS Search path (Part One).
Guido Trotter [Thu, 4 Oct 2007 10:41:28 +0000 (10:41 +0000)]
Fix OS Diagnose in light of the new OS Search path (Part One).

As of now only the last OS was taken into consideration by diagnose, fix by
storing them all and displaying for now only the first. Also display the source
path for valid OSes.

Reviewed-by: imsnah

16 years agoSecond part of the OS search path cleanup
Guido Trotter [Wed, 3 Oct 2007 14:11:44 +0000 (14:11 +0000)]
Second part of the OS search path cleanup

Abstract the _OSSearch function, to look for an OS in the search path
Make OSFromDisk accept an optional base_dir, rather than the os_dir itself

Reviewed-by: iustinp

16 years agoMake parameter os_dir mandatory for _OSOndiskversion.
Guido Trotter [Wed, 3 Oct 2007 11:21:14 +0000 (11:21 +0000)]
Make parameter os_dir mandatory for _OSOndiskversion.

First part of the OS search path cleanup. _OSOndiskversion is only ever called
once, and with that argument set, so let's make it mandatory.

Reviewed-by: iustinp

16 years agoAdd warning on gnt-node add operation.
Guido Trotter [Tue, 2 Oct 2007 12:50:59 +0000 (12:50 +0000)]
Add warning on gnt-node add operation.

People might not have read all the documentation and might not expect their ssh configuration
and specially keys to be changed. Adding this warning will inform them before it happens.

Reviewed-by: iustinp

16 years agoPrint automake warnings.
Michael Hanselmann [Tue, 2 Oct 2007 07:41:01 +0000 (07:41 +0000)]
Print automake warnings.

Reviewed-by: ultrotter

16 years agoImport utils into unittest.
Michael Hanselmann [Mon, 1 Oct 2007 14:31:28 +0000 (14:31 +0000)]
Import utils into unittest.

Reviewed-by: schreiberal

16 years agoChange constants.OS_DIR with constants.OS_SEARCH_PATH which includes all the
Guido Trotter [Fri, 28 Sep 2007 09:39:15 +0000 (09:39 +0000)]
Change constants.OS_DIR with constants.OS_SEARCH_PATH which includes all the
directories which can contain OS scripts.

The list defaults to the current one but can be changed at configure time.

Reviewed-by: imsnah

16 years agoMake the default export path configurable.
Guido Trotter [Thu, 27 Sep 2007 16:02:57 +0000 (16:02 +0000)]
Make the default export path configurable.

This is needed to improve FHS compliance for distribution integration.
The need was discussed on the alioth pkg-ganeti project.

Reviewed-by: imsnah

16 years agoPrevent race condition in CreateBackup().
Michael Hanselmann [Thu, 27 Sep 2007 13:03:08 +0000 (13:03 +0000)]
Prevent race condition in CreateBackup().

Reviewed-by: ultrotter

16 years agoAdd more QA tests.
Michael Hanselmann [Thu, 27 Sep 2007 13:00:10 +0000 (13:00 +0000)]
Add more QA tests.

Added tests:
- “gnt-cluster getmaster”
- “gnt-cluster version”
- “gnt-instance list”
- “gnt-instance reinstall”

Reviewed-by: schreiberal

16 years agoSpecify in the helpstring that --with-ssh-initscripts expects an argument
Guido Trotter [Thu, 27 Sep 2007 12:20:13 +0000 (12:20 +0000)]
Specify in the helpstring that --with-ssh-initscripts expects an argument

Reviewed-by: imsnah

16 years agoPass required ip_check parameter to OpCreateInstance in gnt-backup.
Michael Hanselmann [Thu, 27 Sep 2007 12:18:30 +0000 (12:18 +0000)]
Pass required ip_check parameter to OpCreateInstance in gnt-backup.

Reviewed-by: ultrotter

16 years agoEnhance QA.
Michael Hanselmann [Wed, 26 Sep 2007 18:27:58 +0000 (18:27 +0000)]
Enhance QA.

- Test “gnt-backup export” and “gnt-backup import”.
- Move “ResolveInstanceName” to qa_utils.py.
- Fix tests for “ganeti-watcher”.
- Make instance shutdown and startup configurable.

Reviewed-by: schreiberal

16 years agoIntegrate Leonardo's LSB init script patch
Guido Trotter [Tue, 25 Sep 2007 14:22:41 +0000 (14:22 +0000)]
Integrate Leonardo's LSB init script patch

Reviewed-By: imsnah

16 years agoRename constants for SSH init script by Iustin's request.
Michael Hanselmann [Tue, 25 Sep 2007 13:04:25 +0000 (13:04 +0000)]
Rename constants for SSH init script by Iustin's request.

Reviewed-by: iustinp

16 years agoIgnore man/*.in.
Michael Hanselmann [Tue, 25 Sep 2007 11:41:53 +0000 (11:41 +0000)]
Ignore man/*.in.

Reviewed-by: ultrotter

16 years agoAdd configure option for init.d/ssh script. This is useful for distributions
Michael Hanselmann [Tue, 25 Sep 2007 11:41:20 +0000 (11:41 +0000)]
Add configure option for init.d/ssh script. This is useful for distributions
with the script named differently than Debian.

Reviewed-by: ultrotter

16 years agoRemove mkdir from man/Makefile.am because mktemp creates the directory before.
Guido Trotter [Mon, 24 Sep 2007 15:03:14 +0000 (15:03 +0000)]
Remove mkdir from man/Makefile.am because mktemp creates the directory before.

Thanks to Christoph Rauch for reporting the problem.

Reviewed-By: iustinp

16 years agoReplace paths in ganeti-watcher.sgml.
Michael Hanselmann [Mon, 24 Sep 2007 12:03:14 +0000 (12:03 +0000)]
Replace paths in ganeti-watcher.sgml.

Reviewed-by: iustinp