diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 47a542a0d62a03dd780d1501fca967f49c574c3d..7cc79431b5839dba342d988755a17f1508e6f7ab 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -4767,42 +4767,6 @@ def _CheckNodesFreeDiskOnVG(lu, nodenames, vg, requested): errors.ECODE_NORES) -def _CheckNodesFreeDisk(lu, nodenames, requested): - """Checks if nodes have enough free disk space in the default VG. - - This function check if all given nodes have the needed amount of - free disk. In case any node has less disk or we cannot get the - information from the node, this function raise an OpPrereqError - exception. - - @type lu: C{LogicalUnit} - @param lu: a logical unit from which we get configuration data - @type nodenames: C{list} - @param nodenames: the list of node names to check - @type requested: C{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 - - """ - nodeinfo = lu.rpc.call_node_info(nodenames, lu.cfg.GetVGName(), - lu.cfg.GetHypervisorType()) - for node in nodenames: - info = nodeinfo[node] - info.Raise("Cannot get current information from node %s" % node, - prereq=True, ecode=errors.ECODE_ENVIRON) - vg_free = info.payload.get("vg_free", None) - if not isinstance(vg_free, int): - raise errors.OpPrereqError("Can't compute free disk space on node %s," - " result was '%s'" % (node, vg_free), - errors.ECODE_ENVIRON) - if requested > vg_free: - raise errors.OpPrereqError("Not enough disk space on target node %s:" - " required %d MiB, available %d MiB" % - (node, requested, vg_free), - errors.ECODE_NORES) - - class LUStartupInstance(LogicalUnit): """Starts an instance.