From 46c8a6ab3f78eb552beb77e2bc2f0ab45461e47e Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Thu, 14 Oct 2010 10:44:22 +0200 Subject: [PATCH] Add a new watcher option --ignore-pause MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During cluster maintenance, when the watcher is disabled, it's useful to run it just once. This is incovenient to do currently, as the watcher needs to be unpaused, then run, then paused again. This patch adds an option β--ignore-pauseβ that can be used to ignore the cluster-level setting. Also the man page is updated as it was missing the options available. Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Michael Hanselmann <hansmi@google.com> --- daemons/ganeti-watcher | 4 +++- man/ganeti-watcher.sgml | 29 +++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/daemons/ganeti-watcher b/daemons/ganeti-watcher index b2a995ba5..2b65dcdf2 100755 --- a/daemons/ganeti-watcher +++ b/daemons/ganeti-watcher @@ -671,6 +671,8 @@ def ParseOptions(): parser.add_option("-A", "--job-age", dest="job_age", help="Autoarchive jobs older than this age (default" " 6 hours)", default=6*3600) + parser.add_option("--ignore-pause", dest="ignore_pause", default=False, + action="store_true", help="Ignore cluster pause setting") options, args = parser.parse_args() options.job_age = cli.ParseTimespec(options.job_age) return options, args @@ -692,7 +694,7 @@ def main(): utils.SetupLogging(constants.LOG_WATCHER, debug=options.debug, stderr_logging=options.debug) - if ShouldPause(): + if ShouldPause() and not options.ignore_pause: logging.debug("Pause has been set, exiting") sys.exit(constants.EXIT_SUCCESS) diff --git a/man/ganeti-watcher.sgml b/man/ganeti-watcher.sgml index 8a0241736..d78725392 100644 --- a/man/ganeti-watcher.sgml +++ b/man/ganeti-watcher.sgml @@ -41,6 +41,10 @@ <cmdsynopsis> <command>&dhpackage; </command> + <arg><option>--debug</option></arg> + <arg><option>--job-age=<replaceable>age</replaceable></option></arg> + <arg><option>--ignore-pause</option></arg> + </cmdsynopsis> </refsynopsisdiv> <refsect1> @@ -53,6 +57,20 @@ and another one that runs on every node. </para> + <para> + If the watcher is disabled at cluster level (via + the <command>gnt-cluster watcher pause</command> command), it + will exit without doing anything. The cluster-level pause can be + overriden via the <option>--ignore-pause</option> option, for + example if during a maintenance the watcher needs to be disabled + in general, but the administrator wants to run it just once. + </para> + + <para> + The <option>--debug</option> option will increase the verbosity + of the watcher and also activate logging to the standard error. + </para> + <refsect2> <title>Master operations</title> @@ -63,11 +81,18 @@ </para> <para> - Its other function is to <quote>repair</quote> DRBD links by + Another function is to <quote>repair</quote> DRBD links by reactivating the block devices of instances which have secondaries on nodes that have been rebooted. </para> + <para> + The watcher will also archive old jobs (older than the age + given via the <option>--job-age</option> option, which + defaults to 6 hours), in order to keep the job queue + manageable. + </para> + </refsect2> <refsect2> @@ -96,7 +121,7 @@ <para> The watcher does synchronous queries but will submit jobs for executing the changes. Due to locking, it could be that the jobs - execute much later than the watcher executes them. + execute much later than the watcher submits them. </para> </refsect2> -- GitLab