'Only return hosts with sufficient available RAM.'

def host_passes(self, host_state, spec_obj):

    requested_ram = spec_obj.memory_mb
    free_ram_mb = host_state.free_ram_mb
    total_usable_ram_mb = host_state.total_usable_ram_mb
    if (not (total_usable_ram_mb >= requested_ram)):
        LOG.debug('%(host_state)s    does    not    have    %(requested_ram)s    MB    usable    ram    before    overcommit,    it    only    has    %(usable_ram)s    MB.', {'host_state': host_state, 'requested_ram': requested_ram, 'usable_ram': total_usable_ram_mb})
        return False
    ram_allocation_ratio = self._get_ram_allocation_ratio(host_state, spec_obj)
    memory_mb_limit = (total_usable_ram_mb * ram_allocation_ratio)
    used_ram_mb = (total_usable_ram_mb - free_ram_mb)
    usable_ram = (memory_mb_limit - used_ram_mb)
    if (not (usable_ram >= requested_ram)):
        LOG.debug('%(host_state)s    does    not    have    %(requested_ram)s    MB    usable    ram,    it    only    has    %(usable_ram)s    MB    usable    ram.', {'host_state': host_state, 'requested_ram': requested_ram, 'usable_ram': usable_ram})
        return False
    host_state.limits['memory_mb'] = memory_mb_limit
    return True
