nodes
the names of the nodes to be evacuated
+nodegroups
+ a dictionary with the data for the cluster's node groups; it is keyed
+ on the group UUID, and the values are a dictionary with the following
+ keys:
+
+ name
+ the node group name
+
instances
a dictionary with the data for the current existing instance on the
cluster, indexed by instance name; the contents are similar to the
self.rpc.call_all_instances_info(node_list,
cluster_info.enabled_hypervisors)
+ data["nodegroups"] = self._ComputeNodeGroupData(cfg)
+
data["nodes"] = self._ComputeNodeData(cfg, node_data, node_iinfo, i_list)
data["instances"] = self._ComputeInstanceData(cluster_info, i_list)
self.in_data = data
@staticmethod
+ def _ComputeNodeGroupData(cfg):
+ """Compute node groups data.
+
+ """
+ ng = {}
+ for guuid, gdata in cfg.GetAllNodeGroupsInfo().items():
+ ng[guuid] = { "name": gdata.name }
+ return ng
+
+ @staticmethod
def _ComputeNodeData(cfg, node_data, node_iinfo, i_list):
"""Compute global node data.
return nodegroup.uuid
raise errors.OpPrereqError("Nodegroup '%s' not found", target)
+ @locking.ssynchronized(_config_lock, shared=1)
+ def GetAllNodeGroupsInfo(self):
+ """Get the configuration of all node groups.
+
+ """
+ return dict(self._config_data.nodegroups)
+
@locking.ssynchronized(_config_lock)
def AddInstance(self, instance, ec_id):
"""Add an instance to the config.