'Calls allocate_fixed_ip once for each network.'

def _allocate_fixed_ips(self, context, instance_id, host, networks, **kwargs):

    green_threads = []
    vpn = kwargs.get('vpn')
    requested_networks = kwargs.get('requested_networks')
    addresses_by_network = {}
    if (requested_networks is not None):
        for request in requested_networks:
            addresses_by_network[request.network_id] = request.address
    for network in networks:
        if (('uuid' in network) and (network['uuid'] in addresses_by_network)):
            address = addresses_by_network[network['uuid']]
        else:
            address = None
        if (not network['multi_host']):
            host = network['host']
        if (host is None):
            host = self.network_rpcapi.set_network_host(context, network)
        if (host != self.host):
            green_threads.append(utils.spawn(self.network_rpcapi._rpc_allocate_fixed_ip, context, instance_id, network['id'], address, vpn, host))
        else:
            self.allocate_fixed_ip(context, instance_id, network, vpn=vpn, address=address)
    for gt in green_threads:
        gt.wait()
