Revision 3a7c308e

b/lib/cmdlib.py
2059 2059
      raise errors.OpPrereqError, ("Instance '%s' not known" %
2060 2060
                                   self.op.instance_name)
2061 2061

  
2062
    # check memory requirements on the secondary node
2063
    target_node = instance.secondary_nodes[0]
2064
    nodeinfo = rpc.call_node_info([target_node], self.cfg.GetVGName())
2065
    info = nodeinfo.get(target_node, None)
2066
    if not info:
2067
      raise errors.OpPrereqError, ("Cannot get current information"
2068
                                   " from node '%s'" % nodeinfo)
2069
    if instance.memory > info['memory_free']:
2070
      raise errors.OpPrereqError, ("Not enough memory on target node %s."
2071
                                   " %d MB available, %d MB required" %
2072
                                   (target_node, info['memory_free'],
2073
                                    instance.memory))
2074

  
2062 2075
    # check bridge existance
2063 2076
    brlist = [nic.bridge for nic in instance.nics]
2064 2077
    if not rpc.call_bridges_exist(instance.primary_node, brlist):

Also available in: Unified diff