'Selects random destinations.'

def select_destinations(self, context, spec_obj, instance_uuids, alloc_reqs_by_rp_uuid, provider_summaries):

    num_instances = spec_obj.num_instances
    dests = []
    for i in range(num_instances):
        host = self._schedule(context, compute_rpcapi.RPC_TOPIC, spec_obj)
        host_state = self.host_manager.host_state_cls(host, None, None)
        dests.append(host_state)
    if (len(dests) < num_instances):
        reason = _('There    are    not    enough    hosts    available.')
        raise exception.NoValidHost(reason=reason)
    return dests
