diff --git a/daemons/ganeti-noded b/daemons/ganeti-noded index 76fcb1b42031d7f162f79ae339588535a8bce2ab..e40771cb651197ea465a1be4d0953ece57d22c31 100755 --- a/daemons/ganeti-noded +++ b/daemons/ganeti-noded @@ -844,7 +844,11 @@ def ExecNoded(options, _): """Main node daemon function, executed with the PID file held. """ - utils.Mlockall() + if options.mlock: + utils.Mlockall() + request_executor_class = MlockallRequestExecutor + else: + request_executor_class = http.server.HttpServerRequestExecutor # Read SSL certificate if options.ssl: @@ -863,7 +867,7 @@ def ExecNoded(options, _): mainloop = daemon.Mainloop() server = NodeHttpServer(mainloop, options.bind_address, options.port, ssl_params=ssl_params, ssl_verify_peer=True, - request_executor_class=MlockallRequestExecutor) + request_executor_class=request_executor_class) server.Start() try: mainloop.Run() @@ -879,6 +883,10 @@ def main(): usage="%prog [-f] [-d] [-p port] [-b ADDRESS]", version="%%prog (ganeti) %s" % constants.RELEASE_VERSION) + parser.add_option("--no-mlock", dest="mlock", + help="Do not mlock the node memory in ram", + default=True, action="store_false") + dirs = [(val, constants.RUN_DIRS_MODE) for val in constants.SUB_RUN_DIRS] dirs.append((constants.LOG_OS_DIR, 0750)) dirs.append((constants.LOCK_DIR, 1777)) diff --git a/man/ganeti-noded.sgml b/man/ganeti-noded.sgml index 2693700bb94eafa3797d285eea8a84268bae0a44..d590fe2de42b2a4abcf10066b1b5f452b5ae859f 100644 --- a/man/ganeti-noded.sgml +++ b/man/ganeti-noded.sgml @@ -52,6 +52,13 @@ responsible for the node functions in the ganeti system. </para> + <para> + By default, in order to be able to support features such as node + powercycling even on systems with a very damaged root disk, ganeti-noded + mlocks itself in ram. You can disable this feature by passing in the + <option>--no-mlock</option>. + </para> + <para> For testing purposes, you can give the <option>-f</option> option and the program won't detach from the running terminal.