Move OpCode processor callbacks into separate class
There are two major arguments for this:- There will be more callbacks (e.g. for lock debugging) and extending the parameter list is a lot of work.- In the jqueue module this allows us to keep per-job or per-opcode variables in...
Replace last hardcoded 'nodelist' with NV_NODELIST
LUAddNode has this usage remaining, as it's the only other LU to usecall_node_verify (beside LUVerifyCluster).
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Treat virtual LVs as inexistent
Currently, “gnt-cluster verify” and “gnt-cluster verify-disks” use thelist of LVs as returned by backend.GetVolumeList to determine whether anLV exists or not. However, LVs can also be ‘virtual’, which is handledcorrectly (i.e. as missing) by the bdev code, but not by this function....
locking: Acquire SharedLock in shared mode in separate function
This is for some more symetry withSharedLock.__exclusive_acquire.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
RpcResult: Fix cases where “failed” wouldn't be set to True
This broke “gnt-instance replace-disks --auto” when the instanceis down.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
locking: Add level name dict
Merge commit 'origin/next' into branch-2.1
Fix gnt-job info entry in gnt-job(8)
It currently reports "cancel" in its syntax, which is obviously acut&paste error.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix gnt-node modify online help
This completes what was began in commit862b1b2b4c698cec8ad816793172fac9aa7f4cdf
locking: Don't swallow exceptions
This is an indentation bug.
check-python-code: Report EOL whitespace
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
Check for tabs and long lines in Python code
.gitignore: Ignore distcheck directories
Wrap lines over 80 characters
cmdlib: Fix typo in variable name
Makefile: Move lengthy variable list to separate variable
Move LoadModule function to ganeti.build
It should only be used at build-time.
Add new ganeti.build namespace
This will be used to store build-time Python code.
upload: Use more compatible regular expression
mcpu: formatting/indenting fix
Small fix for a mistake done by bad editor settings.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Add check for duplicate MACs in instance add
Currently LUAddInstance doesn't check for duplicate MACs, and it failsduring the Exec() phase when trying to add the instance to the config(ConfigWriter checks for this). This patch copies the code fromLUModifyInstance (which already does it)....
scripts/gnt-node: fix a help string
gnt-node modify says it wants an "<instance>". Changing it to"<node_name>" as for the other commands.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Optimise multi-job submit
Currently, on multi-job submits we simply iterate over thesingle-job-submit function. This means we grab a new serial, write andreplicate (and wait for the remote nodes to ack) the serial file, andonly then create the job file; this is repeated N times, once for each...
Extend gnt-debug with more debugging options
This patch extends gnt-debug to be able to submit multiple copies of theinput jobs and job contents, in order to simplify testing. It also addsa timing mode, and splits the execution into separate submit and...
Add bash completion for --node node1[:node2]
Add more debugging to bash completion
Add simple unittest for manpages
Fix small error in gnt-job manpage
Add locking doc to Ganeti documentation
Add ipsec hook to .gitignore
Even more style fixes
KVM hypervisor: Use ReadFile
A few style fixes
Add RAPI resource to redistribute config
Add simple unittest for remote API docs
rapi doc: Add …/nodes/[name] and …/instances/[name]/reinstall
Add simple unittest for hooks documentation
Update hooks documentation
Move LoadModule function to utils
It can be used by unittests for daemons/* or scripts/*.
utils.CalculateDirectorySize: Don't redefine builtin
Use ReadFile/WriteFile in more places
This survived QA, burnin and unittests.
Makefile: add IPsec hook
Enable creation and dist for IPsec hook.
Example IPsec hook
This hook is a simple example which automatically configures a basic IPsec linkamong all the nodes of a cluster.
gnt-cluster watcher: Show more information
confd: add cluster master query
confd/querylib: fix docstrings
They were cut&paste from the first example queries, rather thandocumenting the current ones.
confd: avoid spamming the logfile
When confd is disabled we don't want to be noticed every timer interval.
Remove SimpleConfigReader.GetHypervisorType
We haven't had that config file entry for a while.
Conflicts: lib/cmdlib.py: Trivial
Replace BINDIR variable as well
Add bindir to the list of variables replaced at make time.
Signed-off-by: Luca Bigliardi <shammash@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Return cluster tags from LUQueryClusterInfo
devel/upload: Build in parallel
Merge branch 'next' into branch-2.1
Add more bash completion metadata for options
Bash completion: Implement dynamic option value completion
Bash completion: Add function to get all iallocators
Bash completion: Simplify option completion
This makes the output file quite a bit smaller and is neededin preparation for non-static option completion (e.g. list ofnodes).
Bash completion: Support for --foo=bar option format
That is with the equal sign.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Bash completion: Small optimizations
$2 doesn't contain the correct value when completing something like"--disk-template=…". Getting it via COMP_WORDS is better.
Short options (e.g. -I) can't have an equal sign.
Also add useful debugging commands for development....
Fix QA test for “gnt-node evacuate”
Before the arguments weren't valid.
Move SimpleConfigReader creation to ConfdProcessor
This will be useful to make ConfdProcessor aware of a config failure,without quitting confd.
ConfdProcessor: add disabled state
This is a state the processor will get in, if it fails to load theconfig.
confd: start in polling mode
This allows us not to enable the inotify handler immediately, and thusto make it easier for us should the config file not exist at all.
Confd: don't fail if the config doesn't load
Rather than quitting we'll just continue to poll the config at a slowrate, hoping that sooner or later we'll get it back. This allows alsoworking on non-MC nodes, and smoothly transitioning from MC to non-MC,...
confd: s/confd_event_handler/inotify_handler/
In a case we don't encounter frequently (file modified but notoverwritten) the notify handler we use is called with a wrong name.
Add script to clean archived jobs after 21 days
Implement timers in confd
Timers are used both for checking for inotify failures, and for polling,should inotify notices become too frequent.
constants: add confd reload and rate limit times
ConfdInotifyEventHandler.enable: use InotifyError
Rather than raising ConfdFatalError directlyConfdInotifyEventHandler.enable raises InotifyError should it not beable to configure inotify, allowing the caller to decide what to do.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Add errors.InotifyError
ConfdInotifyEventHandler, move to a callback
ConfdInotifyEventHandler used to reload the config whenever anotification arrived. Moving to a callback system, so thatConfdConfigurationReloader can be responsible for that functionality.
Additionally the inotify class no longer reenables itself automatically,...
Move creation of inotify handler to a new class
This class will be responsible for managing inotify notifications,timers, and rate-limiting reloads. For now none of these features isimplemented. :)
ConfdInotifyEventHandler: add enable/disable
Make possible to enable and disable the inotify event handler. Theinotify handler will remain enabled, unless explicitely told to disableitself.
SimpleConfigReader: handle stat() errors
Also, catch EnvironmentError, rather than IOError, when trying to readthe file.
Encode the actual exception raised by LU execution
Currently, the actual exception raised during an LU execution (one ofOpPrereqError, OpExecError, HooksError, etc.) is lost because thejqueue.py code simply sets that to a str(err), and the code in cli.py...
Move the luxi error handling into errors.py
Currently the luxi error handling is hardcoded as special encoding onthe masterd-side and special decoding on the client side. This patchmoves it to errors.py such that other parts of the code can reuse thesame encoding....
Remove watcher pause file 1h past end time
ganeti-watcher: Don't run if paused
gnt-cluster: Add CLI for watcher pause
Add file to pause watcher for a certain duration
This can be used during maintenance work.
cli._Argument: Remove unused, optional “suggest” parameter
bash completion: Allow arguments with min < max arguments
ganeti-masterd: Master voting in separate process
One shouldn't fork a Python process after using threads. Mastervoting is done before forking (utils.Daemonize), but it also usesthreads. Hence it's now called from a separate process.
This patch also fixes the check function to actually exit if...
ganeti-masterd: Add helper to run function in separate process
This will be used to do the master voting.
GenerateSecret: specify the length of the secret
Add a parameter to specify the length of the bytes sequence represented by thereturned hex string. Defaulting to 20 so it's compatible with previous SHA1hash.
Signed-off-by: Luca Bigliardi <shammash@google.com>...
cmdlib: Add some messages to LUExportInstance
Style fixes for ganeti-*
ganeti-noded: Close listening socket in child
LUDestroyCluster: hooks support
We're going to call hooks from its Exec method so LUDestroyCluster has tosupport them.
LUDestroyCluster: run hooks
Run post hooks on master node before it's removed.
Signed-off-by: Luca Bigliardi <shammash@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Document cluster destroy hook
Add documentation about new cluster-destroy-post hook.
Run unittests in a temporary directory
Fix building in a different directory
Also add build-bash-completion to EXTRA_DIST.
Add script to run build commands in temporary directory
Python always compiles imported modules. By running these targetsin a temporary directory we don't pollute the source tree.
Makefile: Use BUILT_SOURCES
These are always built before anything else.
Simplify manpage building
This eliminates one temporary directory in the process.
Makefile: Fix docbook2man error message
Handle more errors in bash completion
Don't print error messages if cluster hasn't been initialized yet.
HooksMaster: fix RunPhase logging
In case of complete failure results is empty, return immediately(tnx unittests).
LURemoveNode: no logs running post on removed node
Do not log results from hooks ran on the removed node as now it's done byRunPhase.