Iustin Pop [Mon, 26 Nov 2007 08:39:02 +0000 (08:39 +0000)]
Drop the Rename method of DRBD8 devices
Since we now do changes of remote peers in two steps (Attach with no
network information and then Attach with the new peer's data), we don't
need this operation anymore.
Reviewed-by: imsnah
Iustin Pop [Mon, 26 Nov 2007 08:38:47 +0000 (08:38 +0000)]
Split the change of peer in secondary replace in two operations
This patch splits the single operation of replace peer into two distinct
phases, in order to make a single change to the instance configuration:
- detach from network
- if at least one drbd device succeeded, make one change to the
instance, pointing all disks to the new peer
- attach to the new peer
This should eliminate the case when a failure in the second reattach can
leave the instance with two secondaries.
Reviewed-by: imsnah
Iustin Pop [Mon, 26 Nov 2007 08:38:32 +0000 (08:38 +0000)]
Relax even more the identification of DRBD8 devices
This patch adds a new success condition for identifying DRBD8 devices:
if the local device is correct, but the network peer is not, we shutdown
the network and attach to the correct one (this also handles going to
standalone mode).
This new check (and its actions) is based on the fact that we don't pass
incorrect data from the master to the node (otherwise we could start
syncing with an incorrect peer.
Reviewed-by: imsnah
Iustin Pop [Mon, 26 Nov 2007 08:38:12 +0000 (08:38 +0000)]
Add support for DRBD8 devices to work standalone
This patch adds a check in _AssembleNet so that if we are passed None
value in the unique_id, we instead switch to standalone mode.
Reviewed-by: imsnah
Michael Hanselmann [Thu, 22 Nov 2007 14:11:26 +0000 (14:11 +0000)]
Call more hooks during QA tests.
Reviewed-by: schreiberal
Michael Hanselmann [Thu, 22 Nov 2007 14:10:53 +0000 (14:10 +0000)]
Sort list returned by ListVisibleFiles.
If we didn't sort this list, files would be in arbitrary order.
Reviewed-by: iustinp
Iustin Pop [Thu, 22 Nov 2007 13:51:35 +0000 (13:51 +0000)]
Add man page for the ganeti-master script
This patch adds a simple man page for the master startup script and
modifies the footer.sgml fragment to include it.
Reviewed-by: imsnah
Iustin Pop [Thu, 22 Nov 2007 13:51:17 +0000 (13:51 +0000)]
Create /var/run/ganeti before noded startup
The /var/run directory can be a tmpfs mount, so even if we make it at
install time (or include it in the package) it can go away. Therefore,
test for its existence and create it in the startup script.
Reviewed-by: imsnah
Iustin Pop [Thu, 22 Nov 2007 13:51:02 +0000 (13:51 +0000)]
Remove extra docdir variable from Makefile.am
The docdir variable is defined by autoconf, so we don't need to define
it ourselves. This way, the target documentation directory can
be changed via ./configure instead of patching Makefile.am.
In truth, we should install the pdf and html files using the pdf and
html targets, since configure defines pdfdir=htmldir=docdir; but
installing them in docdir is good enough.
Reviewed-by: imsnah
Michael Hanselmann [Thu, 22 Nov 2007 12:17:07 +0000 (12:17 +0000)]
List loading hooks in QA.
Reviewed-by: schreiberal
Michael Hanselmann [Thu, 22 Nov 2007 11:25:45 +0000 (11:25 +0000)]
Add hook for logging.
This may help to debug problems in QA tests.
Reviewed-by: schreiberal
Michael Hanselmann [Wed, 21 Nov 2007 16:58:01 +0000 (16:58 +0000)]
Abort if tests for disk templates remote_raid1 and drbd are enabled.
Reviewed-by: iustinp
Michael Hanselmann [Wed, 21 Nov 2007 16:57:28 +0000 (16:57 +0000)]
Flush stdout after printing a message during burnin.
Reviewed-by: iustinp
Michael Hanselmann [Wed, 21 Nov 2007 16:56:49 +0000 (16:56 +0000)]
Implement disk templates for burnin from QA.
Reviewed-by: iustinp
Michael Hanselmann [Wed, 21 Nov 2007 16:55:48 +0000 (16:55 +0000)]
Replace disk template drbd8 with drbd where missing.
Reviewed-by: iustinp
Michael Hanselmann [Wed, 21 Nov 2007 15:29:43 +0000 (15:29 +0000)]
Code style fixes for burnin.
Reviewed-by: iustinp
Michael Hanselmann [Wed, 21 Nov 2007 15:29:13 +0000 (15:29 +0000)]
Add two comments to qa-sample.yaml.
Reviewed-by: iustinp
Iustin Pop [Wed, 21 Nov 2007 11:34:36 +0000 (11:34 +0000)]
Fix logging in drbd _ShutdownNet method
We didn't test for failure, just always logged the output.
Reviewed-by: imsnah
Iustin Pop [Wed, 21 Nov 2007 09:36:42 +0000 (09:36 +0000)]
Correct the -s parameter in gnt-node output
This fixed the previous commit (-s => -s ip).
Reviewed-by: ultrotter
Iustin Pop [Wed, 21 Nov 2007 09:15:39 +0000 (09:15 +0000)]
Add the -s option in the output of 'gnt-node'
Since on dual-homed clusters one always needs to add '-s' to the
gnt-node add command, make this appear in the output of 'gnt-node' (when
run without arguments).
Reviewed-by: imsnah
Michael Hanselmann [Tue, 20 Nov 2007 14:49:34 +0000 (14:49 +0000)]
Add description of “gnt-instance startup --force” to manpage.
This was reported by Henning Sprang in issue #14. Also add a missing word
in the description of “gnt-instance reboot”.
Reviewed-by: iustinp
Michael Hanselmann [Tue, 20 Nov 2007 09:18:27 +0000 (09:18 +0000)]
Make sure aliases written to /etc/hosts are unique.
Reviewed-by: iustinp
Michael Hanselmann [Tue, 20 Nov 2007 09:17:58 +0000 (09:17 +0000)]
Add function to return list with unique elements.
Reviewed-by: ultrotter
Michael Hanselmann [Mon, 19 Nov 2007 18:38:14 +0000 (18:38 +0000)]
Add basic QA tests for DRBD 8.
Reviewed-by: schreiberal
Guido Trotter [Fri, 16 Nov 2007 18:36:23 +0000 (18:36 +0000)]
Fix a typo in a warning message
Reviewed-by: schreiberal
Michael Hanselmann [Fri, 16 Nov 2007 14:28:53 +0000 (14:28 +0000)]
Don't remove master's hostname from /etc/hosts on cluster destroy.
This fixes issue #13.
Reviewed-by: schreiberal
Michael Hanselmann [Fri, 16 Nov 2007 14:28:14 +0000 (14:28 +0000)]
Use spaces to indent and fix typo in tag.
Reviewed-by: schreiberal
Michael Hanselmann [Fri, 16 Nov 2007 12:43:14 +0000 (12:43 +0000)]
Fix typo in function name.
Reviewed-by: schreiberal
Guido Trotter [Thu, 15 Nov 2007 06:08:35 +0000 (06:08 +0000)]
Suggest disabling of automatic xen domain save
By default xen tries to save running virtual machines at system shutdown and
restore them at reboot. Make sure we suggest to disable this feature in the
installation manual.
Reviewed-by: iustinp
Guido Trotter [Thu, 15 Nov 2007 06:04:31 +0000 (06:04 +0000)]
Complete the apt-get list in the install manual
The install manual was missing python-pyparsing and python-simplejson from the
apt-get install list. Adding them.
Thanks to Henning Sprang for spotting this issue.
Reviewed-by: iustinp
Guido Trotter [Wed, 14 Nov 2007 21:52:44 +0000 (21:52 +0000)]
When an assembly error occurs log it too
Right now an assembly error produces an exception but not a log message. This
is bad because the exception suggests looking at the log, but the log itself
has a lot of errors which are not really a problem and only some which really
is. In order to make it clear where in the log the problem occurred we log a
message too, before raising the exception.
Reviewed-by: iustinp
Michael Hanselmann [Wed, 14 Nov 2007 15:56:03 +0000 (15:56 +0000)]
Use setUp/tearDown for tests using temporary files.
Reviewed-by: schreiberal
Michael Hanselmann [Wed, 14 Nov 2007 15:55:38 +0000 (15:55 +0000)]
Wrap line longer than 80 characters.
Reviewed-by: ultrotter
Michael Hanselmann [Wed, 14 Nov 2007 15:55:13 +0000 (15:55 +0000)]
Compare file contents directly in unittests.
Reviewed-by: schreiberal, ultrotter
Michael Hanselmann [Wed, 14 Nov 2007 14:05:26 +0000 (14:05 +0000)]
Give more details on errors when trying to run “lvdisplay”.
Reviewed-by: schreiberal
Michael Hanselmann [Wed, 14 Nov 2007 14:05:08 +0000 (14:05 +0000)]
Create /var/run/ganeti directory on “make install”.
Reviewed-by: schreiberal
Michael Hanselmann [Tue, 13 Nov 2007 23:03:20 +0000 (23:03 +0000)]
Bump version numbers.
Reviewed-by: iustinp
Michael Hanselmann [Tue, 13 Nov 2007 19:31:54 +0000 (19:31 +0000)]
Run ganeti-watcher script from QA code instead of cron.
This makes the tests much more reliably because it avoids race conditions.
It also helps to speed them up a lot.
Reviewed-by: iustinp
Michael Hanselmann [Tue, 13 Nov 2007 19:31:25 +0000 (19:31 +0000)]
Small changes and fixes in ganeti-watcher.
- Use constants for keys.
- Fix bug through which automatic instance restarts wouldn't be limited
Reviewed-by: iustinp
Michael Hanselmann [Tue, 13 Nov 2007 19:30:52 +0000 (19:30 +0000)]
Fix call to TestInstanceConsecutiveFailures.
Reviewed-by: iustinp
Michael Hanselmann [Tue, 13 Nov 2007 15:39:49 +0000 (15:39 +0000)]
Fix unittests broken by revision 360.
Reviewed-by: schreiberal
Michael Hanselmann [Tue, 13 Nov 2007 15:04:01 +0000 (15:04 +0000)]
Fix --node option for “gnt-backup list”.
Reviewed-by: iustinp
Iustin Pop [Mon, 12 Nov 2007 23:11:48 +0000 (23:11 +0000)]
Fix a wrong comparison in _RecursiveAssembleBD
We want to prevent sending too many 'None' children to a device.
However, the test as it is today is wrong, as we want to test the
situation after adding a new child, and not before. This patch fixes
this by testing greater-or-equal instead of just greater.
Reviewed-by: imsnah
Iustin Pop [Mon, 12 Nov 2007 23:11:25 +0000 (23:11 +0000)]
Fix another breakage in SetEtcHostsEntry
The code assumes all lines have at least two elements which are
whitespace separated - i.e. it does not deal with empty lines or comment
lines with no spaces. This patch fixes this.
Also, the patch replaces the blank between IP and the canonical name
with a tab (restoring previous behaviour).
Reviewed-by: imsnah
Michael Hanselmann [Mon, 12 Nov 2007 17:10:18 +0000 (17:10 +0000)]
Call fsync() after modifying /etc/hosts.
This is a critical file. Breaking it would be very bad. Thus, if the system
crashes before the data is synched to the disk, it should have the complete
file afterwards.
Reviewed-by: iustinp
Michael Hanselmann [Mon, 12 Nov 2007 17:09:49 +0000 (17:09 +0000)]
Fix functions for /etc/hosts.
- Combine hostname and aliases on one line
- Fix bug with wrongfully removed newline characters
- Use wrapper for SetEtcHostsEntry in cmdlib
Reviewed-by: iustin
Michael Hanselmann [Mon, 12 Nov 2007 17:03:50 +0000 (17:03 +0000)]
Rollback commit 356.
Michael Hanselmann [Mon, 12 Nov 2007 16:44:28 +0000 (16:44 +0000)]
Add functions for known_hosts files.
Reviewed-by: TODO
Michael Hanselmann [Mon, 12 Nov 2007 10:57:07 +0000 (10:57 +0000)]
Add missing descriptions to {Add,Remove}EtcHostsEntry.
Reviewed-by: schreiberal
Iustin Pop [Mon, 12 Nov 2007 03:56:03 +0000 (03:56 +0000)]
Relax replace_disks_all meaning for drbd8
In order to make the replace secondary action to be done via the same
opcode parameters for both remote_raid1 and drbd, we must allow the
LUReplaceDisks to change replace_disks_all for drbd with non-empty
remote_node into replace_disks_sec.
This fixes gnt-node evacuate and also allows gnt-instace replace-disks
to have the same syntax for both remote_raid1 and drbd (when replacing
the secondary).
Reviewed-by: ultrotter
Guido Trotter [Mon, 12 Nov 2007 03:36:06 +0000 (03:36 +0000)]
Change --nodes to --node
The --nodes option in gnt-backup really accepts only one node at a time.
Change it to --node, for added clarity and consistency with a similar
option in gnt-cluster. This patch also updates the relevant man page.
Reviewed-By: iustinp
Iustin Pop [Mon, 12 Nov 2007 01:19:50 +0000 (01:19 +0000)]
Update documentation for drbd8 and beta2 release
This patch does:
- add drbd8 information to the docs (the new disk template, examples,
etc.)
- fixes a section header to make it more clear
- update the NEWS file by changing format (format taken by looking at
/usr/sharea/doc/*/NEWS.gz) and adding more information on changes
since beta1
Reviewed-by: ultrotter
Iustin Pop [Sat, 10 Nov 2007 18:05:56 +0000 (18:05 +0000)]
Fix gnt-instance man page for replace-disks
This patch documents the new syntax for disk changes with the drbd disk
template.
Reviewed-by: ultrotter
Iustin Pop [Sat, 10 Nov 2007 17:54:39 +0000 (17:54 +0000)]
Improve the man pages
This patch does some small fixes to the man pages and adds descriptions
for a few missing options.
Reviewed-by: ultrotter
Iustin Pop [Fri, 9 Nov 2007 20:13:33 +0000 (20:13 +0000)]
Soften the requirements for hooks execution
Currently, an unreachable node (or one that return undetermined failure)
in the hooks pre-phase will abort the curren operation. This is not
good, as a down node could prevent many operation on the cluster.
This patch changes a RPC-level failure (and not a hook execution
failure) into a warning. It also modifies the related test cases.
This fixes issue 11.
Reviewed-by: ultrotter
Michael Hanselmann [Fri, 9 Nov 2007 14:54:29 +0000 (14:54 +0000)]
Use new functions to modify /etc/hosts.
Reviewed-by: schreiberal
Michael Hanselmann [Fri, 9 Nov 2007 14:53:53 +0000 (14:53 +0000)]
Add functions to modify /etc/hosts.
Reviewed-by: schreiberal
Michael Hanselmann [Fri, 9 Nov 2007 14:52:35 +0000 (14:52 +0000)]
Cleanup temporary file in RemoveAuthorizedKey.
Reviewed-by: schreiberal
Michael Hanselmann [Fri, 9 Nov 2007 13:03:22 +0000 (13:03 +0000)]
Fix usage of wrong variable in doc/examples/Makefile.am.
This makes “make distcheck” work again.
Reviewed-by: schreiberal
Iustin Pop [Thu, 8 Nov 2007 19:04:43 +0000 (19:04 +0000)]
Simplify burnin output
Currently, the burnin output is very verbose (we log the entire output
from LU feedback) and duplicate in some cases (as we enable debugging).
This patch disables debugging and only logs the burnin output when an
error occurs.
Reviewed-by: imsnah
Iustin Pop [Thu, 8 Nov 2007 19:04:23 +0000 (19:04 +0000)]
Changes related to logging
This patch modifes:
- mcpu.Processor.LogWarning to have its 'hint' parameter as optional
and only log it if not None
- cmdlib._WaitForSync to not log directly to stdout/stderr but via the
proc.Log(Info|Warning) methods
- the LU attribute 'processor' is renamed to 'proc' to shorten the
name
Reviewed-by: imsnah
Iustin Pop [Thu, 8 Nov 2007 19:02:42 +0000 (19:02 +0000)]
Refactor burnin to improve disk replacement
This patch changes the burnin:
- split the code into functions
- add replace2 (replace the secondary) for remote_raid1
- add replace1/2 for drbd8
Reviewed-by: imsnah
Michael Hanselmann [Thu, 8 Nov 2007 11:51:36 +0000 (11:51 +0000)]
Insert hook calls.
Reviewed-by: schreiberal
Michael Hanselmann [Thu, 8 Nov 2007 11:51:03 +0000 (11:51 +0000)]
Implement sample hook.
Reviewed-by: schreiberal
Michael Hanselmann [Thu, 8 Nov 2007 11:50:30 +0000 (11:50 +0000)]
Implement hooks infrastructure.
Reviewed-by: schreiberal
Iustin Pop [Wed, 7 Nov 2007 15:53:50 +0000 (15:53 +0000)]
Enhance secondary node replace for drbd8
This (big) patch does two things:
- add "local disk status" to the block device checks
(BlockDevice.GetSyncStatus and the rpc calls that call this
function, and therefore cmdlib._CheckDiskConsistency)
- improve the drbd8 secondary replace operation using the above
functionality
The "local disk status" adds a new variable to the result of
GetSyncStatus that shows the degradation of the local storage of the
device. Of course, not all device support this - for now, we only modify
LogicalVolumes and DRBD8 to return degraded in some cases, other devices
always return non-degraded. This variable should be a subset of
is_degraded - whenever this variable is true, the is_degraded should
also be true.
The drbd8 secondary replace uses this variable as we don't care if the
primary drbd device is network-degraded, only if it has good local disk
data (ldisk is False).
The patch also increases the protocol version (due to rpc changes).
Reviewed-by: imsnah
Michael Hanselmann [Wed, 7 Nov 2007 14:33:09 +0000 (14:33 +0000)]
Indentation fixes for docs.
Reviewed-by: schreiberal
Michael Hanselmann [Wed, 7 Nov 2007 12:39:20 +0000 (12:39 +0000)]
Update docs for the removed --secondary-node option.
Reviewed-by: ultrotter
Michael Hanselmann [Wed, 7 Nov 2007 11:48:30 +0000 (11:48 +0000)]
Check whether init.d script is executable.
Reviewed-by: schreiberal
Michael Hanselmann [Tue, 6 Nov 2007 17:04:58 +0000 (17:04 +0000)]
Adapt QA tests for removed --secondary-node option.
Michael Hanselmann [Tue, 6 Nov 2007 17:04:16 +0000 (17:04 +0000)]
Remove --secondary-node option.
Replace --secondary-node option with an optional parameter for --node.
Iustin Pop [Tue, 6 Nov 2007 17:01:42 +0000 (17:01 +0000)]
Enhance DBRD8 disk replacement (same nodes)
This patch adds enhanced reporting and much more checks to the disk
replacement (when not switching the secondary).
Reviewed-by: imsnah
Iustin Pop [Tue, 6 Nov 2007 17:01:32 +0000 (17:01 +0000)]
Implement degraded status for logical volumes
Logical volumes can be 'degraded' in a similar way to mirrored devices,
when their underlying storage has gone away (i.e. after a physical disk
failure and 'vgreduce --removemissing'). If we can detect this, we can
prevent mistaken replaces of disks that would use this LV (or its
parent) as source data.
This patch adds support for computing the degraded attribute and
modifies gnt-instance to warn if the LV is virtual.
Reviewed-by: imsnah
Iustin Pop [Tue, 6 Nov 2007 17:01:20 +0000 (17:01 +0000)]
Add better error logging functions for LUs
Currently, some LUs use logger.Error, others just feedback_fn, etc. This
patch adds three functions to mcpu.Processor than can be used to log
messages to both the log and to the user.
These function will be used to enhance the output of replace-disks for
drbd8 (at least).
Reviewed-by: imsnah
Iustin Pop [Tue, 6 Nov 2007 17:01:07 +0000 (17:01 +0000)]
Enhance mirror operations for DRBD8
Currently, the mirror operations (add and remove children) test against
the instance's attributes. This patch changes the check tests to work
against the actual status of the device (i.e. live data) which is more
realistic.
The changes are:
- allow add children if the device doesn't have local storage (even if
we believe it has)
- early return from remove children if the device is already without
local storage
Reviewed-by: imsnah
Iustin Pop [Tue, 6 Nov 2007 17:00:38 +0000 (17:00 +0000)]
Allow DRBD8 operation without backing storage
This patch adds the following functionality:
- DRBD8 devices can assemble without local storage (done by allowing
None in the list of children, and making DRBD8 to ignore all
children if any is None)
- DRBD8 devices can attach (i.e. identify a device) which is not
connected to backing storage but to the correct network ports; this
is a rare case in normal operation (it's what would happen if one
manually detaches the local disk, and the backing LV still exists)
Reviewed-by: imsnah
Iustin Pop [Tue, 6 Nov 2007 17:00:24 +0000 (17:00 +0000)]
Make DRBD8 disks show 'degraded' status if diskless
This patch enables the bdev.DRBD8 class report a degraded status if the
local disk is missing. This allows `gnt-instance info` to report the
actual situation in this case.
Note that DRBD7 should also behave like this, however the diskless case
is less often met there and we also don't want to change behaviour.
The patch also fixes some docstrings for the GetSyncStatus methods.
Reviewed-by: imsnah
Iustin Pop [Tue, 6 Nov 2007 17:00:13 +0000 (17:00 +0000)]
Change the way remove children is called in bdev
For some cases, we don't have to have access to the children of a device
in order to remove them (e.g. md over lvs, or drbd over lvs). In order
to ease the removal process, skip over finding the child if it provides
a static dev path.
This is needed in order to support removal of children when the
underlying storage has gone away.
Reviewed-by: imsnah
Iustin Pop [Tue, 6 Nov 2007 16:55:28 +0000 (16:55 +0000)]
Add a support function to objects.Disk
This patch adds a function returning the device path if it is computable
from the disk object (and we don't need to instantiate a bdev object on
the target node in order to compute this). Only LVs support this.
Reviewed-by: imsnah
Iustin Pop [Mon, 5 Nov 2007 21:22:22 +0000 (21:22 +0000)]
Small cleanup for error formatting
Reviewed-by: ultrotter
Iustin Pop [Mon, 5 Nov 2007 17:59:53 +0000 (17:59 +0000)]
Handle missing init script at cluster init
This patch adds a check in the prereq of LUInitCluster for the existence
of the init script. This allows a clean abort instead of a stack dump.
Based on a report by admin@steibei.net
Reviewed-by: ultrotter
Iustin Pop [Mon, 5 Nov 2007 15:08:25 +0000 (15:08 +0000)]
Fix a unhandled error case in device creation
The block device creation process is the following:
- device create
- device assembly (on primary or depending on dev_type, on secondary
too)
- set sync speed
- return
The problem is that device assembly after creation was not checked for
errors, and as this is a very unusual case, we did not have problems
with it (or we didn't detect them). The recent DevCacheManager however
tripped on this case (because the dev_path of the device is None if the
assembly fails) and the creation aborted with an unclear error message.
The patch adds a check for the assembly success and aborts the creation
of the device in this case - the error is quite clear in the instance
add, for example. The patch also changes DevCacheManager to log the
cases when dev_path is None but not raise an error (keeping consistent
with the goal that the cache manager should be transparent to the code).
For the record, this error case was detected with a mismatch between
drbd kernel module and utilities.
Reviewed-by: imsnah
Iustin Pop [Mon, 5 Nov 2007 15:06:24 +0000 (15:06 +0000)]
Miscellaneous style fixes
This patch fixes some minor pylint warnings (unused variables, wrong
indentation, etc.) and a real bug in the recovery for drbd8 rename
procedure.
Reviewed-by: imsnah
Michael Hanselmann [Mon, 5 Nov 2007 12:19:31 +0000 (12:19 +0000)]
Test tag functionality.
Reviewed-by: schreiberal
Michael Hanselmann [Mon, 5 Nov 2007 12:18:49 +0000 (12:18 +0000)]
Merge three small cluster tests into one.
Reviewed-by: schreiberal
Michael Hanselmann [Mon, 5 Nov 2007 12:14:00 +0000 (12:14 +0000)]
Rename utils.GetUUID to utils.NewUUID.
Reviewed-by: schreiberal
Guido Trotter [Mon, 5 Nov 2007 00:44:11 +0000 (00:44 +0000)]
Bump protocol version up
The OS cleanup patches change the wire protocol. Increment the protocol number
by one.
Reviewed-By: iustinp
Guido Trotter [Mon, 5 Nov 2007 00:43:55 +0000 (00:43 +0000)]
Convert os_get to use OS rather than InvalidOS
In order to do this for simplicity we leave the OSFromDisk function as-is and
we convert the eventual exception to an OS object in ganeti-noded. The
unmangling gets simplified and so does the code for checking whether the OS is
valid.
Reviewed-By: iustinp
Guido Trotter [Mon, 5 Nov 2007 00:43:34 +0000 (00:43 +0000)]
Simplify diagnose mangling/unmangling functions
The functions in ganeti-noded and rpc.py still deal with the fact that an
InvalidOS error could be returned by DiagnoseOS. As this is not the case
anymore simplify their code for the current behavior.
Reviewed-By: iustinp
Guido Trotter [Mon, 5 Nov 2007 00:43:14 +0000 (00:43 +0000)]
Make DiagnoseOS use the modified OS objects
Modify backend.py so that DiagnoseOS only returns OS objects rather than
InvalidOS errors, and make sure gnt-os understands the new objects. Also delete
the deprecated helper functions from gnt-os.
Reviewed-By: iustinp
Guido Trotter [Mon, 5 Nov 2007 00:42:50 +0000 (00:42 +0000)]
Create OS from an InvalidOS error
Add a new FromInvalidOS static function to objects.OS that makes it easy to
create an object representing a broken OS starting from the relevant exception.
Reviewed-By: iustinp
Guido Trotter [Mon, 5 Nov 2007 00:42:03 +0000 (00:42 +0000)]
Make the OS object able to represent broken OSes
Till now the OS object just represents a correct OS instance. Change it so it
can represent a broken one too, by adding a "status" field: if this field is
different from the OS_VALID_STATUS constant the object is considered to be an
invalid OS, the "status" field to be a debugging message, and its boolean
status is set to false.
Reviewed-By: iustinp
Iustin Pop [Sun, 4 Nov 2007 23:26:43 +0000 (23:26 +0000)]
Add option to burnin only a given set of nodes
This patch adds a '-n' option to burnin that takes a comma-separated
list of nodes to perform the burnin on.
Reviewed-by: ultrotter
Guido Trotter [Sun, 4 Nov 2007 04:10:44 +0000 (04:10 +0000)]
Make call_os_get a single node function
call_os_get is never called with a real list of nodes, so there's no point in
it being multi-node. Making it single-node till a usage for multi-node call is
found.
Reviewed-By: iustinp
Guido Trotter [Sun, 4 Nov 2007 03:37:15 +0000 (03:37 +0000)]
Fix two typos in a doc string
Remove a wrong "i" and add a missing ")" to the DiagnoseOS function doc string.
Reviewed-By: iustinp
Iustin Pop [Sat, 3 Nov 2007 06:55:50 +0000 (06:55 +0000)]
Implement tag searching
This patch adds a search command for locating tags on all objects of the
cluster using a regex pattern.
Reviewed-by: aat
Michael Hanselmann [Fri, 2 Nov 2007 15:51:35 +0000 (15:51 +0000)]
Test “gnt-cluster command”.
Also check whether file contents are correct for both “gnt-cluster command” and
“gnt-cluster copyfile”.
Reviewed-by: iustinp
Iustin Pop [Fri, 2 Nov 2007 13:44:29 +0000 (13:44 +0000)]
Implement device to instance mapping cache
Currently, troubleshooting DRBD problems involves a manual process of going
backwards from the DRBD device to the instance that owns it.
This patch adds a weak (i.e. not guaranteed to be correct or up-to-date)
cache of device to instance. The cache should be, in normal operation,
having correct information as the only time when devices change paths
are when they are started/stopped, and the code in backend.py adds cache
updates to exactly these operations.
The only drawback of this implementation is that we don't fully update
the cache on renames of devices (we clean the old entries but we don't
add new ones). Since the rename changes the path only for LVs (and not
drbd and md), this is less of a problem as the target of this code is
debugging DRBD and MD issues.
The patch writes files named bdev_drbd<N> (or bdev_md<N>,
bdev_xenvg_...) in /var/run/ganeti (more exactly, LOCALSTATEDIR/ganeti).
The files start with 'bdev_' and continue with the path of the device
under /dev/ (this prefix stripped), and contain the following values,
space separated:
- instance name
- primary or secondary (depending on how the device is on the primary
or secondary node)
- instance visible name: sda or sdb or not_visible, the latter case
when the device is not the top-level device (i.e. remote_raid1
templates will have sd[ab] for the md, but not_visible for drbd and
logical volumes)
The cache is designed to not raise any errors, if there is an I/O error
it will only be logged in the node daemon log file. This is in order to
reduce the possible impact of the cache on the block device activation
and shutdown code.
Reviewed-by: imsnah
Iustin Pop [Fri, 2 Nov 2007 13:43:51 +0000 (13:43 +0000)]
Improve burnin with regard to drbd8
Allow burnin to use the new drbd8 template (for which case one needs to
disable replacement of disks, burnin does yet support that with drbd8).
The patch also changes do-replace[12] to no-replace[12] as that is what
they actually do.
Reviewed-by: imsnah
Iustin Pop [Fri, 2 Nov 2007 13:43:29 +0000 (13:43 +0000)]
Update the dev_path on LVs on rename
When renaming a logical volume, we should change the dev_path (and other
internal variables) in order to be consistent.
Reviewed-by: imsnah