def _check_destination_has_enough_memory(self):
    avail = self._get_compute_info(self.destination)['free_ram_mb']
    mem_inst = self.instance.memory_mb
    if ((not mem_inst) or (avail <= mem_inst)):
        instance_uuid = self.instance.uuid
        dest = self.destination
        reason = _('Unable to migrate %(instance_uuid)s to %(dest)s: Lack of memory(host:%(avail)s <= instance:%(mem_inst)s)')
        raise exception.MigrationPreCheckError(reason=(reason % dict(instance_uuid=instance_uuid, dest=dest, avail=avail, mem_inst=mem_inst)))
def _check_destination_has_enough_memory(self):
    avail = self._get_compute_info(self.destination)['free_ram_mb']
    mem_inst = self.instance.memory_mb
    if ((not mem_inst) or (avail <= mem_inst)):
        instance_uuid = self.instance.uuid
        dest = self.destination
        reason = _('Unable to migrate %(instance_uuid)s to %(dest)s: Lack of memory(host:%(avail)s <= instance:%(mem_inst)s)')
        raise exception.MigrationPreCheckError(reason=(reason % dict(instance_uuid=instance_uuid, dest=dest, avail=avail, mem_inst=mem_inst)))