Renamining space reporting for file storage
[ganeti-local] / lib / rpc_defs.py
index f5f1c34..07b4645 100644 (file)
@@ -142,6 +142,11 @@ def _NodeInfoPreProc(node, args):
     return args
 
 
+def _DrbdCallsPreProc(node, args):
+  """Add the target node UUID as additional field for DRBD related calls."""
+  return args + [node]
+
+
 def _OsGetPostProc(result):
   """Post-processor for L{rpc.RpcRunner.call_os_get}.
 
@@ -218,22 +223,27 @@ _INSTANCE_CALLS = [
   ("instance_info", SINGLE, None, constants.RPC_TMO_URGENT, [
     ("instance", None, "Instance name"),
     ("hname", None, "Hypervisor type"),
+    ("hvparams", None, "Hypervisor parameters"),
     ], None, None, "Returns information about a single instance"),
   ("all_instances_info", MULTI, None, constants.RPC_TMO_URGENT, [
     ("hypervisor_list", None, "Hypervisors to query for instances"),
+    ("all_hvparams", None, "Dictionary mapping hypervisor names to hvparams"),
     ], None, None,
    "Returns information about all instances on the given nodes"),
   ("instance_list", MULTI, None, constants.RPC_TMO_URGENT, [
     ("hypervisor_list", None, "Hypervisors to query for instances"),
+    ("hvparams", None, "Hvparams of all hypervisors"),
     ], None, None, "Returns the list of running instances on the given nodes"),
   ("instance_reboot", SINGLE, None, constants.RPC_TMO_NORMAL, [
     ("inst", ED_INST_DICT, "Instance object"),
     ("reboot_type", None, None),
     ("shutdown_timeout", None, None),
+    ("reason", None, "The reason for the reboot"),
     ], None, None, "Returns the list of running instances on the given nodes"),
   ("instance_shutdown", SINGLE, None, constants.RPC_TMO_NORMAL, [
     ("instance", ED_INST_DICT, "Instance object"),
     ("timeout", None, None),
+    ("reason", None, "The reason for the shutdown"),
     ], None, None, "Stops an instance"),
   ("instance_balloon_memory", SINGLE, None, constants.RPC_TMO_NORMAL, [
     ("instance", ED_INST_DICT, "Instance object"),
@@ -262,6 +272,7 @@ _INSTANCE_CALLS = [
     ("success", None, "Whether the migration was a success or failure"),
     ], None, None, "Finalize any target-node migration specific operation"),
   ("instance_migrate", SINGLE, None, constants.RPC_TMO_SLOW, [
+    ("cluster_name", None, "Cluster name"),
     ("instance", ED_INST_DICT, "Instance object"),
     ("target", None, "Target node name"),
     ("live", None, "Whether the migration should be done live or not"),
@@ -277,6 +288,7 @@ _INSTANCE_CALLS = [
   ("instance_start", SINGLE, None, constants.RPC_TMO_NORMAL, [
     ("instance_hvp_bep", ED_INST_DICT_HVP_BEP_DP, None),
     ("startup_paused", None, None),
+    ("reason", None, "The reason for the startup"),
     ], None, None, "Starts an instance"),
   ("instance_os_add", SINGLE, None, constants.RPC_TMO_1DAY, [
     ("instance_osp", ED_INST_DICT_OSP_DP, None),
@@ -381,23 +393,24 @@ _BLOCKDEV_CALLS = [
     ("instance_name", None, None),
     ("disks", ED_OBJECT_DICT_LIST, None),
     ], None, None, "Closes the given block devices"),
-  ("blockdev_getsize", SINGLE, None, constants.RPC_TMO_NORMAL, [
+  ("blockdev_getdimensions", SINGLE, None, constants.RPC_TMO_NORMAL, [
     ("disks", ED_OBJECT_DICT_LIST, None),
-    ], None, None, "Returns the size of the given disks"),
+    ], None, None, "Returns size and spindles of the given disks"),
   ("drbd_disconnect_net", MULTI, None, constants.RPC_TMO_NORMAL, [
     ("nodes_ip", None, None),
     ("disks", ED_OBJECT_DICT_LIST, None),
-    ], None, None, "Disconnects the network of the given drbd devices"),
+    ], _DrbdCallsPreProc, None,
+   "Disconnects the network of the given drbd devices"),
   ("drbd_attach_net", MULTI, None, constants.RPC_TMO_NORMAL, [
     ("nodes_ip", None, None),
     ("disks", ED_DISKS_DICT_DP, None),
     ("instance_name", None, None),
     ("multimaster", None, None),
-    ], None, None, "Connects the given DRBD devices"),
+    ], _DrbdCallsPreProc, None, "Connects the given DRBD devices"),
   ("drbd_wait_sync", MULTI, None, constants.RPC_TMO_SLOW, [
     ("nodes_ip", None, None),
     ("disks", ED_DISKS_DICT_DP, None),
-    ], None, None,
+    ], _DrbdCallsPreProc, None,
    "Waits for the synchronization of drbd devices is complete"),
   ("blockdev_grow", SINGLE, None, constants.RPC_TMO_NORMAL, [
     ("cf_bdev", ED_SINGLE_DISK_DICT_DP, None),
@@ -461,16 +474,19 @@ _NODE_CALLS = [
     ("address", None, "IP address"),
     ], None, None, "Checks if a node has the given IP address"),
   ("node_info", MULTI, None, constants.RPC_TMO_URGENT, [
-    ("vg_names", None,
-     "Names of the volume groups to ask for disk space information"),
-    ("hv_names", None,
-     "Names of the hypervisors to ask for node information"),
+    ("storage_units", None,
+     "List of tuples '<storage_type>,<key>' to ask for disk space"
+     " information"),
+    ("hv_specs", None,
+     "List of hypervisor specification (name, hvparams) to ask for 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),
+    ("checkdict", None, "What to verify"),
+    ("cluster_name", None, "Cluster name"),
+    ("all_hvparams", None, "Dictionary mapping hypervisor names to hvparams"),
     ], None, None, "Request verification of given parameters"),
   ("node_volumes", MULTI, None, constants.RPC_TMO_FAST, [], None, None,
    "Gets all volumes on node(s)"),
@@ -478,6 +494,7 @@ _NODE_CALLS = [
    "Demote a node from the master candidate role"),
   ("node_powercycle", SINGLE, ACCEPT_OFFLINE_NODE, constants.RPC_TMO_NORMAL, [
     ("hypervisor", None, "Hypervisor type"),
+    ("hvparams", None, "Hypervisor parameters"),
     ], None, None, "Tries to powercycle a node"),
   ]
 
@@ -585,8 +602,9 @@ CALLS = {
     ("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),
+      ("checkdict", None, "What to verify"),
+      ("cluster_name", None, "Cluster name"),
+      ("hvparams", None, "Dictionary mapping hypervisor names to hvparams"),
       ], None, None, "Request verification of given parameters"),
     ]),
   "RpcClientConfig": _Prepare([