+def _PerformNodeInfoCall(lu, node_uuids, vg):
+ """Prepares the input and performs a node info call.
+
+ @type lu: C{LogicalUnit}
+ @param lu: a logical unit from which we get configuration data
+ @type node_uuids: list of string
+ @param node_uuids: list of node UUIDs to perform the call for
+ @type vg: string
+ @param vg: the volume group's name
+
+ """
+ lvm_storage_units = [(constants.ST_LVM_VG, vg)]
+ storage_units = rpc.PrepareStorageUnitsForNodes(lu.cfg, lvm_storage_units,
+ node_uuids)
+ hvname = lu.cfg.GetHypervisorType()
+ hvparams = lu.cfg.GetClusterInfo().hvparams
+ nodeinfo = lu.rpc.call_node_info(node_uuids, storage_units,
+ [(hvname, hvparams[hvname])])
+ return nodeinfo
+
+
+def _CheckVgCapacityForNode(node_name, node_info, vg, requested):
+ """Checks the vg capacity for a given node.
+
+ @type node_info: tuple (_, list of dicts, _)
+ @param node_info: the result of the node info call for one node
+ @type node_name: string
+ @param node_name: the name of the node
+ @type vg: string
+ @param vg: volume group name
+ @type requested: int
+ @param requested: the amount of disk in MiB to check for
+ @raise errors.OpPrereqError: if the node doesn't have enough disk,
+ or we cannot check the node