hv_kvm: Add TODO regarding monitor commands
[ganeti-local] / lib / rpc_defs.py
index 20c349a..f5f1c34 100644 (file)
@@ -131,6 +131,17 @@ def _BlockdevGetMirrorStatusMultiPostProc(result):
   return result
 
 
+def _NodeInfoPreProc(node, args):
+  """Prepare the exclusive_storage argument for node_info calls."""
+  assert len(args) == 3
+  # The third argument is either a dictionary with one value for each node, or
+  # a fixed value to be used for all the nodes
+  if type(args[2]) is dict:
+    return [args[0], args[1], args[2][node]]
+  else:
+    return args
+
+
 def _OsGetPostProc(result):
   """Post-processor for L{rpc.RpcRunner.call_os_get}.
 
@@ -332,6 +343,7 @@ _BLOCKDEV_CALLS = [
     ("owner", None, None),
     ("on_primary", None, None),
     ("info", None, None),
+    ("exclusive_storage", None, None),
     ], None, None, "Request creation of a given block device"),
   ("blockdev_wipe", SINGLE, None, constants.RPC_TMO_SLOW, [
     ("bdev", ED_SINGLE_DISK_DICT_DP, None),
@@ -439,6 +451,11 @@ _OS_CALLS = [
     ], None, _OsGetPostProc, "Returns an OS definition"),
   ]
 
+_EXTSTORAGE_CALLS = [
+  ("extstorage_diagnose", MULTI, None, constants.RPC_TMO_FAST, [], None, None,
+   "Request a diagnose of ExtStorage Providers"),
+  ]
+
 _NODE_CALLS = [
   ("node_has_ip_address", SINGLE, None, constants.RPC_TMO_FAST, [
     ("address", None, "IP address"),
@@ -448,7 +465,9 @@ _NODE_CALLS = [
      "Names of the volume groups to ask for disk space information"),
     ("hv_names", None,
      "Names of the hypervisors to ask for node information"),
-    ], None, None, "Return node information"),
+    ("exclusive_storage", None,
+     "Whether exclusive storage is enabled"),
+    ], _NodeInfoPreProc, None, "Return node information"),
   ("node_verify", MULTI, None, constants.RPC_TMO_NORMAL, [
     ("checkdict", None, None),
     ("cluster_name", None, None),
@@ -516,7 +535,7 @@ CALLS = {
   "RpcClientDefault":
     _Prepare(_IMPEXP_CALLS + _X509_CALLS + _OS_CALLS + _NODE_CALLS +
              _FILE_STORAGE_CALLS + _MISC_CALLS + _INSTANCE_CALLS +
-             _BLOCKDEV_CALLS + _STORAGE_CALLS),
+             _BLOCKDEV_CALLS + _STORAGE_CALLS + _EXTSTORAGE_CALLS),
   "RpcClientJobQueue": _Prepare([
     ("jobqueue_update", MULTI, None, constants.RPC_TMO_URGENT, [
       ("file_name", None, None),
@@ -565,6 +584,10 @@ CALLS = {
   "RpcClientDnsOnly": _Prepare([
     ("version", MULTI, ACCEPT_OFFLINE_NODE, constants.RPC_TMO_URGENT, [], None,
      None, "Query node version"),
+    ("node_verify_light", MULTI, None, constants.RPC_TMO_NORMAL, [
+      ("checkdict", None, None),
+      ("cluster_name", None, None),
+      ], None, None, "Request verification of given parameters"),
     ]),
   "RpcClientConfig": _Prepare([
     ("upload_file", MULTI, None, constants.RPC_TMO_NORMAL, [