Commit 6180d6bb authored by Dmitry Chernyak's avatar Dmitry Chernyak Committed by Iustin Pop
Browse files

Removed _CheckNodesFreeDisk function



Was substituted by _CheckNodesFreeDiskPerVG.
Signed-off-by: default avatarDmitry Chernyak <dmi.chernyak@gmail.com>
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 03941a26
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment