4 # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 """RPC definitions for communication between master and node daemons.
23 RPC definition fields:
26 - L{SINGLE} for single-node calls, L{MULTI} for multi-node
27 - Name resolver option(s), can be callable receiving all arguments in a tuple
28 - Timeout (e.g. L{constants.RPC_TMO_NORMAL}), or callback receiving all
29 arguments in a tuple to calculate timeout
30 - List of arguments as tuples
33 - Argument kind used for encoding/decoding
34 - Description for docstring (can be C{None})
36 - Custom body encoder (e.g. for preparing per-node bodies)
37 - Return value wrapper (e.g. for deserializing into L{objects}-based objects)
38 - Short call description for docstring
42 from ganeti import constants
43 from ganeti import utils
44 from ganeti import objects
47 # Guidelines for choosing timeouts:
48 # - call used during watcher: timeout of 1min, constants.RPC_TMO_URGENT
49 # - trivial (but be sure it is trivial)
50 # (e.g. reading a file): 5min, constants.RPC_TMO_FAST
51 # - other calls: 15 min, constants.RPC_TMO_NORMAL
52 # - special calls (instance add, etc.):
53 # either constants.RPC_TMO_SLOW (1h) or huge timeouts
55 SINGLE = "single-node"
58 ACCEPT_OFFLINE_NODE = object()
60 # Constants for encoding/decoding
64 ED_INST_DICT_HVP_BEP_DP,
69 ED_FINALIZE_EXPORT_DISKS,
73 ED_SINGLE_DISK_DICT_DP,
74 ED_NIC_DICT) = range(1, 15)
78 """Converts list of calls to dictionary.
81 return utils.SequenceToDict(calls)
84 def _MigrationStatusPostProc(result):
85 """Post-processor for L{rpc.RpcRunner.call_instance_get_migration_status}.
88 if not result.fail_msg and result.payload is not None:
89 result.payload = objects.MigrationStatus.FromDict(result.payload)
93 def _BlockdevFindPostProc(result):
94 """Post-processor for L{rpc.RpcRunner.call_blockdev_find}.
97 if not result.fail_msg and result.payload is not None:
98 result.payload = objects.BlockDevStatus.FromDict(result.payload)
102 def _BlockdevGetMirrorStatusPostProc(result):
103 """Post-processor for L{rpc.RpcRunner.call_blockdev_getmirrorstatus}.
106 if not result.fail_msg:
107 result.payload = map(objects.BlockDevStatus.FromDict, result.payload)
111 def _BlockdevGetMirrorStatusMultiPreProc(node, args):
112 """Prepares the appropriate node values for blockdev_getmirrorstatus_multi.
115 # there should be only one argument to this RPC, already holding a
116 # node->disks dictionary, we just need to extract the value for the
118 assert len(args) == 1
119 return [args[0][node]]
122 def _BlockdevGetMirrorStatusMultiPostProc(result):
123 """Post-processor for L{rpc.RpcRunner.call_blockdev_getmirrorstatus_multi}.
126 if not result.fail_msg:
127 for idx, (success, status) in enumerate(result.payload):
129 result.payload[idx] = (success, objects.BlockDevStatus.FromDict(status))
134 def _NodeInfoPreProc(node, args):
135 """Prepare the exclusive_storage argument for node_info calls."""
136 assert len(args) == 3
137 # The third argument is either a dictionary with one value for each node, or
138 # a fixed value to be used for all the nodes
139 if type(args[2]) is dict:
140 return [args[0], args[1], args[2][node]]
145 def _OsGetPostProc(result):
146 """Post-processor for L{rpc.RpcRunner.call_os_get}.
149 if not result.fail_msg and isinstance(result.payload, dict):
150 result.payload = objects.OS.FromDict(result.payload)
154 def _ImpExpStatusPostProc(result):
155 """Post-processor for import/export status.
157 @rtype: Payload containing list of L{objects.ImportExportStatus} instances
158 @return: Returns a list of the state of each named import/export or None if
159 a status couldn't be retrieved
162 if not result.fail_msg:
165 for i in result.payload:
169 decoded.append(objects.ImportExportStatus.FromDict(i))
171 result.payload = decoded
176 def _TestDelayTimeout((duration, )):
177 """Calculate timeout for "test_delay" RPC.
180 return int(duration + 5)
183 _FILE_STORAGE_CALLS = [
184 ("file_storage_dir_create", SINGLE, None, constants.RPC_TMO_FAST, [
185 ("file_storage_dir", None, "File storage directory"),
186 ], None, None, "Create the given file storage directory"),
187 ("file_storage_dir_remove", SINGLE, None, constants.RPC_TMO_FAST, [
188 ("file_storage_dir", None, "File storage directory"),
189 ], None, None, "Remove the given file storage directory"),
190 ("file_storage_dir_rename", SINGLE, None, constants.RPC_TMO_FAST, [
191 ("old_file_storage_dir", None, "Old name"),
192 ("new_file_storage_dir", None, "New name"),
193 ], None, None, "Rename file storage directory"),
197 ("storage_list", MULTI, None, constants.RPC_TMO_NORMAL, [
198 ("su_name", None, None),
199 ("su_args", None, None),
200 ("name", None, None),
201 ("fields", None, None),
202 ], None, None, "Get list of storage units"),
203 ("storage_modify", SINGLE, None, constants.RPC_TMO_NORMAL, [
204 ("su_name", None, None),
205 ("su_args", None, None),
206 ("name", None, None),
207 ("changes", None, None),
208 ], None, None, "Modify a storage unit"),
209 ("storage_execute", SINGLE, None, constants.RPC_TMO_NORMAL, [
210 ("su_name", None, None),
211 ("su_args", None, None),
212 ("name", None, None),
214 ], None, None, "Executes an operation on a storage unit"),
218 ("instance_info", SINGLE, None, constants.RPC_TMO_URGENT, [
219 ("instance", None, "Instance name"),
220 ("hname", None, "Hypervisor type"),
221 ], None, None, "Returns information about a single instance"),
222 ("all_instances_info", MULTI, None, constants.RPC_TMO_URGENT, [
223 ("hypervisor_list", None, "Hypervisors to query for instances"),
225 "Returns information about all instances on the given nodes"),
226 ("instance_list", MULTI, None, constants.RPC_TMO_URGENT, [
227 ("hypervisor_list", None, "Hypervisors to query for instances"),
228 ], None, None, "Returns the list of running instances on the given nodes"),
229 ("instance_reboot", SINGLE, None, constants.RPC_TMO_NORMAL, [
230 ("inst", ED_INST_DICT, "Instance object"),
231 ("reboot_type", None, None),
232 ("shutdown_timeout", None, None),
233 ], None, None, "Returns the list of running instances on the given nodes"),
234 ("instance_shutdown", SINGLE, None, constants.RPC_TMO_NORMAL, [
235 ("instance", ED_INST_DICT, "Instance object"),
236 ("timeout", None, None),
237 ], None, None, "Stops an instance"),
238 ("instance_balloon_memory", SINGLE, None, constants.RPC_TMO_NORMAL, [
239 ("instance", ED_INST_DICT, "Instance object"),
240 ("memory", None, None),
241 ], None, None, "Modify the amount of an instance's runtime memory"),
242 ("instance_run_rename", SINGLE, None, constants.RPC_TMO_SLOW, [
243 ("instance", ED_INST_DICT, "Instance object"),
244 ("old_name", None, None),
245 ("debug", None, None),
246 ], None, None, "Run the OS rename script for an instance"),
247 ("instance_migratable", SINGLE, None, constants.RPC_TMO_NORMAL, [
248 ("instance", ED_INST_DICT, "Instance object"),
249 ], None, None, "Checks whether the given instance can be migrated"),
250 ("migration_info", SINGLE, None, constants.RPC_TMO_NORMAL, [
251 ("instance", ED_INST_DICT, "Instance object"),
253 "Gather the information necessary to prepare an instance migration"),
254 ("accept_instance", SINGLE, None, constants.RPC_TMO_NORMAL, [
255 ("instance", ED_INST_DICT, "Instance object"),
256 ("info", None, "Result for the call_migration_info call"),
257 ("target", None, "Target hostname (usually an IP address)"),
258 ], None, None, "Prepare a node to accept an instance"),
259 ("instance_finalize_migration_dst", SINGLE, None, constants.RPC_TMO_NORMAL, [
260 ("instance", ED_INST_DICT, "Instance object"),
261 ("info", None, "Result for the call_migration_info call"),
262 ("success", None, "Whether the migration was a success or failure"),
263 ], None, None, "Finalize any target-node migration specific operation"),
264 ("instance_migrate", SINGLE, None, constants.RPC_TMO_SLOW, [
265 ("instance", ED_INST_DICT, "Instance object"),
266 ("target", None, "Target node name"),
267 ("live", None, "Whether the migration should be done live or not"),
268 ], None, None, "Migrate an instance"),
269 ("instance_finalize_migration_src", SINGLE, None, constants.RPC_TMO_SLOW, [
270 ("instance", ED_INST_DICT, "Instance object"),
271 ("success", None, "Whether the migration succeeded or not"),
272 ("live", None, "Whether the user requested a live migration or not"),
273 ], None, None, "Finalize the instance migration on the source node"),
274 ("instance_get_migration_status", SINGLE, None, constants.RPC_TMO_SLOW, [
275 ("instance", ED_INST_DICT, "Instance object"),
276 ], None, _MigrationStatusPostProc, "Report migration status"),
277 ("instance_start", SINGLE, None, constants.RPC_TMO_NORMAL, [
278 ("instance_hvp_bep", ED_INST_DICT_HVP_BEP_DP, None),
279 ("startup_paused", None, None),
280 ], None, None, "Starts an instance"),
281 ("instance_os_add", SINGLE, None, constants.RPC_TMO_1DAY, [
282 ("instance_osp", ED_INST_DICT_OSP_DP, None),
283 ("reinstall", None, None),
284 ("debug", None, None),
285 ], None, None, "Starts an instance"),
289 ("import_start", SINGLE, None, constants.RPC_TMO_NORMAL, [
290 ("opts", ED_OBJECT_DICT, None),
291 ("instance", ED_INST_DICT, None),
292 ("component", None, None),
293 ("dest", ED_IMPEXP_IO, "Import destination"),
294 ], None, None, "Starts an import daemon"),
295 ("export_start", SINGLE, None, constants.RPC_TMO_NORMAL, [
296 ("opts", ED_OBJECT_DICT, None),
297 ("host", None, None),
298 ("port", None, None),
299 ("instance", ED_INST_DICT, None),
300 ("component", None, None),
301 ("source", ED_IMPEXP_IO, "Export source"),
302 ], None, None, "Starts an export daemon"),
303 ("impexp_status", SINGLE, None, constants.RPC_TMO_FAST, [
304 ("names", None, "Import/export names"),
305 ], None, _ImpExpStatusPostProc, "Gets the status of an import or export"),
306 ("impexp_abort", SINGLE, None, constants.RPC_TMO_NORMAL, [
307 ("name", None, "Import/export name"),
308 ], None, None, "Aborts an import or export"),
309 ("impexp_cleanup", SINGLE, None, constants.RPC_TMO_NORMAL, [
310 ("name", None, "Import/export name"),
311 ], None, None, "Cleans up after an import or export"),
312 ("export_info", SINGLE, None, constants.RPC_TMO_FAST, [
313 ("path", None, None),
314 ], None, None, "Queries the export information in a given path"),
315 ("finalize_export", SINGLE, None, constants.RPC_TMO_NORMAL, [
316 ("instance", ED_INST_DICT, None),
317 ("snap_disks", ED_FINALIZE_EXPORT_DISKS, None),
318 ], None, None, "Request the completion of an export operation"),
319 ("export_list", MULTI, None, constants.RPC_TMO_FAST, [], None, None,
320 "Gets the stored exports list"),
321 ("export_remove", SINGLE, None, constants.RPC_TMO_FAST, [
322 ("export", None, None),
323 ], None, None, "Requests removal of a given export"),
327 ("x509_cert_create", SINGLE, None, constants.RPC_TMO_NORMAL, [
328 ("validity", None, "Validity in seconds"),
329 ], None, None, "Creates a new X509 certificate for SSL/TLS"),
330 ("x509_cert_remove", SINGLE, None, constants.RPC_TMO_NORMAL, [
331 ("name", None, "Certificate name"),
332 ], None, None, "Removes a X509 certificate"),
336 ("bdev_sizes", MULTI, None, constants.RPC_TMO_URGENT, [
337 ("devices", None, None),
339 "Gets the sizes of requested block devices present on a node"),
340 ("blockdev_create", SINGLE, None, constants.RPC_TMO_NORMAL, [
341 ("bdev", ED_OBJECT_DICT, None),
342 ("size", None, None),
343 ("owner", None, None),
344 ("on_primary", None, None),
345 ("info", None, None),
346 ("exclusive_storage", None, None),
347 ], None, None, "Request creation of a given block device"),
348 ("blockdev_wipe", SINGLE, None, constants.RPC_TMO_SLOW, [
349 ("bdev", ED_SINGLE_DISK_DICT_DP, None),
350 ("offset", None, None),
351 ("size", None, None),
353 "Request wipe at given offset with given size of a block device"),
354 ("blockdev_remove", SINGLE, None, constants.RPC_TMO_NORMAL, [
355 ("bdev", ED_OBJECT_DICT, None),
356 ], None, None, "Request removal of a given block device"),
357 ("blockdev_pause_resume_sync", SINGLE, None, constants.RPC_TMO_NORMAL, [
358 ("disks", ED_DISKS_DICT_DP, None),
359 ("pause", None, None),
360 ], None, None, "Request a pause/resume of given block device"),
361 ("blockdev_assemble", SINGLE, None, constants.RPC_TMO_NORMAL, [
362 ("disk", ED_SINGLE_DISK_DICT_DP, None),
363 ("owner", None, None),
364 ("on_primary", None, None),
366 ], None, None, "Request assembling of a given block device"),
367 ("blockdev_shutdown", SINGLE, None, constants.RPC_TMO_NORMAL, [
368 ("disk", ED_SINGLE_DISK_DICT_DP, None),
369 ], None, None, "Request shutdown of a given block device"),
370 ("blockdev_addchildren", SINGLE, None, constants.RPC_TMO_NORMAL, [
371 ("bdev", ED_SINGLE_DISK_DICT_DP, None),
372 ("ndevs", ED_OBJECT_DICT_LIST, None),
374 "Request adding a list of children to a (mirroring) device"),
375 ("blockdev_removechildren", SINGLE, None, constants.RPC_TMO_NORMAL, [
376 ("bdev", ED_OBJECT_DICT, None),
377 ("ndevs", ED_OBJECT_DICT_LIST, None),
379 "Request removing a list of children from a (mirroring) device"),
380 ("blockdev_close", SINGLE, None, constants.RPC_TMO_NORMAL, [
381 ("instance_name", None, None),
382 ("disks", ED_OBJECT_DICT_LIST, None),
383 ], None, None, "Closes the given block devices"),
384 ("blockdev_getsize", SINGLE, None, constants.RPC_TMO_NORMAL, [
385 ("disks", ED_OBJECT_DICT_LIST, None),
386 ], None, None, "Returns the size of the given disks"),
387 ("drbd_disconnect_net", MULTI, None, constants.RPC_TMO_NORMAL, [
388 ("nodes_ip", None, None),
389 ("disks", ED_OBJECT_DICT_LIST, None),
390 ], None, None, "Disconnects the network of the given drbd devices"),
391 ("drbd_attach_net", MULTI, None, constants.RPC_TMO_NORMAL, [
392 ("nodes_ip", None, None),
393 ("disks", ED_DISKS_DICT_DP, None),
394 ("instance_name", None, None),
395 ("multimaster", None, None),
396 ], None, None, "Connects the given DRBD devices"),
397 ("drbd_wait_sync", MULTI, None, constants.RPC_TMO_SLOW, [
398 ("nodes_ip", None, None),
399 ("disks", ED_DISKS_DICT_DP, None),
401 "Waits for the synchronization of drbd devices is complete"),
402 ("blockdev_grow", SINGLE, None, constants.RPC_TMO_NORMAL, [
403 ("cf_bdev", ED_SINGLE_DISK_DICT_DP, None),
404 ("amount", None, None),
405 ("dryrun", None, None),
406 ("backingstore", None, None),
407 ], None, None, "Request growing of the given block device by a"
409 ("blockdev_export", SINGLE, None, constants.RPC_TMO_1DAY, [
410 ("cf_bdev", ED_SINGLE_DISK_DICT_DP, None),
411 ("dest_node", None, None),
412 ("dest_path", None, None),
413 ("cluster_name", None, None),
414 ], None, None, "Export a given disk to another node"),
415 ("blockdev_snapshot", SINGLE, None, constants.RPC_TMO_NORMAL, [
416 ("cf_bdev", ED_SINGLE_DISK_DICT_DP, None),
417 ], None, None, "Export a given disk to another node"),
418 ("blockdev_rename", SINGLE, None, constants.RPC_TMO_NORMAL, [
419 ("devlist", ED_BLOCKDEV_RENAME, None),
420 ], None, None, "Request rename of the given block devices"),
421 ("blockdev_find", SINGLE, None, constants.RPC_TMO_NORMAL, [
422 ("disk", ED_OBJECT_DICT, None),
423 ], None, _BlockdevFindPostProc,
424 "Request identification of a given block device"),
425 ("blockdev_getmirrorstatus", SINGLE, None, constants.RPC_TMO_NORMAL, [
426 ("disks", ED_DISKS_DICT_DP, None),
427 ], None, _BlockdevGetMirrorStatusPostProc,
428 "Request status of a (mirroring) device"),
429 ("blockdev_getmirrorstatus_multi", MULTI, None, constants.RPC_TMO_NORMAL, [
430 ("node_disks", ED_NODE_TO_DISK_DICT, None),
431 ], _BlockdevGetMirrorStatusMultiPreProc,
432 _BlockdevGetMirrorStatusMultiPostProc,
433 "Request status of (mirroring) devices from multiple nodes"),
434 ("blockdev_setinfo", SINGLE, None, constants.RPC_TMO_NORMAL, [
435 ("disk", ED_OBJECT_DICT, None),
436 ("info", None, None),
437 ], None, None, "Sets metadata information on a given block device"),
441 ("os_diagnose", MULTI, None, constants.RPC_TMO_FAST, [], None, None,
442 "Request a diagnose of OS definitions"),
443 ("os_validate", MULTI, None, constants.RPC_TMO_FAST, [
444 ("required", None, None),
445 ("name", None, None),
446 ("checks", None, None),
447 ("params", None, None),
448 ], None, None, "Run a validation routine for a given OS"),
449 ("os_get", SINGLE, None, constants.RPC_TMO_FAST, [
450 ("name", None, None),
451 ], None, _OsGetPostProc, "Returns an OS definition"),
455 ("node_has_ip_address", SINGLE, None, constants.RPC_TMO_FAST, [
456 ("address", None, "IP address"),
457 ], None, None, "Checks if a node has the given IP address"),
458 ("node_info", MULTI, None, constants.RPC_TMO_URGENT, [
460 "Names of the volume groups to ask for disk space information"),
462 "Names of the hypervisors to ask for node information"),
463 ("exclusive_storage", None,
464 "Whether exclusive storage is enabled"),
465 ], _NodeInfoPreProc, None, "Return node information"),
466 ("node_verify", MULTI, None, constants.RPC_TMO_NORMAL, [
467 ("checkdict", None, None),
468 ("cluster_name", None, None),
469 ], None, None, "Request verification of given parameters"),
470 ("node_volumes", MULTI, None, constants.RPC_TMO_FAST, [], None, None,
471 "Gets all volumes on node(s)"),
472 ("node_demote_from_mc", SINGLE, None, constants.RPC_TMO_FAST, [], None, None,
473 "Demote a node from the master candidate role"),
474 ("node_powercycle", SINGLE, ACCEPT_OFFLINE_NODE, constants.RPC_TMO_NORMAL, [
475 ("hypervisor", None, "Hypervisor type"),
476 ], None, None, "Tries to powercycle a node"),
480 ("lv_list", MULTI, None, constants.RPC_TMO_URGENT, [
481 ("vg_name", None, None),
482 ], None, None, "Gets the logical volumes present in a given volume group"),
483 ("vg_list", MULTI, None, constants.RPC_TMO_URGENT, [], None, None,
484 "Gets the volume group list"),
485 ("bridges_exist", SINGLE, None, constants.RPC_TMO_URGENT, [
486 ("bridges_list", None, "Bridges which must be present on remote node"),
487 ], None, None, "Checks if a node has all the bridges given"),
488 ("etc_hosts_modify", SINGLE, None, constants.RPC_TMO_NORMAL, [
490 "Mode to operate; currently L{constants.ETC_HOSTS_ADD} or"
491 " L{constants.ETC_HOSTS_REMOVE}"),
492 ("name", None, "Hostname to be modified"),
493 ("ip", None, "IP address (L{constants.ETC_HOSTS_ADD} only)"),
494 ], None, None, "Modify hosts file with name"),
495 ("drbd_helper", MULTI, None, constants.RPC_TMO_URGENT, [],
496 None, None, "Gets DRBD helper"),
497 ("restricted_command", MULTI, None, constants.RPC_TMO_SLOW, [
498 ("cmd", None, "Command name"),
499 ], None, None, "Runs restricted command"),
500 ("run_oob", SINGLE, None, constants.RPC_TMO_NORMAL, [
501 ("oob_program", None, None),
502 ("command", None, None),
503 ("remote_node", None, None),
504 ("timeout", None, None),
505 ], None, None, "Runs out-of-band command"),
506 ("hooks_runner", MULTI, None, constants.RPC_TMO_NORMAL, [
507 ("hpath", None, None),
508 ("phase", None, None),
510 ], None, None, "Call the hooks runner"),
511 ("iallocator_runner", SINGLE, None, constants.RPC_TMO_NORMAL, [
512 ("name", None, "Iallocator name"),
513 ("idata", None, "JSON-encoded input string"),
514 ], None, None, "Call an iallocator on a remote node"),
515 ("test_delay", MULTI, None, _TestDelayTimeout, [
516 ("duration", None, None),
517 ], None, None, "Sleep for a fixed time on given node(s)"),
518 ("hypervisor_validate_params", MULTI, None, constants.RPC_TMO_NORMAL, [
519 ("hvname", None, "Hypervisor name"),
520 ("hvfull", None, "Parameters to be validated"),
521 ], None, None, "Validate hypervisor params"),
522 ("get_watcher_pause", SINGLE, None, constants.RPC_TMO_URGENT, [],
523 None, None, "Get watcher pause end"),
524 ("set_watcher_pause", MULTI, None, constants.RPC_TMO_URGENT, [
525 ("until", None, None),
526 ], None, None, "Set watcher pause end"),
531 _Prepare(_IMPEXP_CALLS + _X509_CALLS + _OS_CALLS + _NODE_CALLS +
532 _FILE_STORAGE_CALLS + _MISC_CALLS + _INSTANCE_CALLS +
533 _BLOCKDEV_CALLS + _STORAGE_CALLS),
534 "RpcClientJobQueue": _Prepare([
535 ("jobqueue_update", MULTI, None, constants.RPC_TMO_URGENT, [
536 ("file_name", None, None),
537 ("content", ED_COMPRESS, None),
538 ], None, None, "Update job queue file"),
539 ("jobqueue_purge", SINGLE, None, constants.RPC_TMO_NORMAL, [], None, None,
541 ("jobqueue_rename", MULTI, None, constants.RPC_TMO_URGENT, [
542 ("rename", None, None),
543 ], None, None, "Rename job queue file"),
544 ("jobqueue_set_drain_flag", MULTI, None, constants.RPC_TMO_URGENT, [
545 ("flag", None, None),
546 ], None, None, "Set job queue drain flag"),
548 "RpcClientBootstrap": _Prepare([
549 ("node_start_master_daemons", SINGLE, None, constants.RPC_TMO_FAST, [
550 ("no_voting", None, None),
551 ], None, None, "Starts master daemons on a node"),
552 ("node_activate_master_ip", SINGLE, None, constants.RPC_TMO_FAST, [
553 ("master_params", ED_OBJECT_DICT, "Network parameters of the master"),
554 ("use_external_mip_script", None,
555 "Whether to use the user-provided master IP address setup script"),
557 "Activates master IP on a node"),
558 ("node_stop_master", SINGLE, None, constants.RPC_TMO_FAST, [], None, None,
559 "Deactivates master IP and stops master daemons on a node"),
560 ("node_deactivate_master_ip", SINGLE, None, constants.RPC_TMO_FAST, [
561 ("master_params", ED_OBJECT_DICT, "Network parameters of the master"),
562 ("use_external_mip_script", None,
563 "Whether to use the user-provided master IP address setup script"),
565 "Deactivates master IP on a node"),
566 ("node_change_master_netmask", SINGLE, None, constants.RPC_TMO_FAST, [
567 ("old_netmask", None, "The old value of the netmask"),
568 ("netmask", None, "The new value of the netmask"),
569 ("master_ip", None, "The master IP"),
570 ("master_netdev", None, "The master network device"),
571 ], None, None, "Change master IP netmask"),
572 ("node_leave_cluster", SINGLE, None, constants.RPC_TMO_NORMAL, [
573 ("modify_ssh_setup", None, None),
575 "Requests a node to clean the cluster information it has"),
576 ("master_info", MULTI, None, constants.RPC_TMO_URGENT, [], None, None,
577 "Query master info"),
579 "RpcClientDnsOnly": _Prepare([
580 ("version", MULTI, ACCEPT_OFFLINE_NODE, constants.RPC_TMO_URGENT, [], None,
581 None, "Query node version"),
583 "RpcClientConfig": _Prepare([
584 ("upload_file", MULTI, None, constants.RPC_TMO_NORMAL, [
585 ("file_name", ED_FILE_DETAILS, None),
586 ], None, None, "Upload a file"),
587 ("write_ssconf_files", MULTI, None, constants.RPC_TMO_NORMAL, [
588 ("values", None, None),
589 ], None, None, "Write ssconf files"),