'Create a tenant private network/subnets.'

def _provision_tenant_private_network(self, context, tenant_id):

    network = None
    try:
        network_args = {'name': 'auto_allocated_network', 'admin_state_up': False, 'tenant_id': tenant_id, 'shared': False}
        network = p_utils.create_network(self.core_plugin, context, {'network': network_args})
        subnets = []
        for pool in self._get_supported_subnetpools(context):
            subnet_args = {'name': ('auto_allocated_subnet_v%s' % pool['ip_version']), 'network_id': network['id'], 'tenant_id': tenant_id, 'ip_version': pool['ip_version'], 'subnetpool_id': pool['id']}
            subnets.append(p_utils.create_subnet(self.core_plugin, context, {'subnet': subnet_args}))
        return subnets
    except (c_exc.SubnetAllocationError, ValueError, n_exc.BadRequest, n_exc.NotFound) as e:
        LOG.error(_LE('Unable    to    auto    allocate    topology    for    tenant    %(tenant_id)s    due    to    missing    or    unmet    requirements.    Reason:    %(reason)s'), {'tenant_id': tenant_id, 'reason': e})
        if network:
            self._cleanup(context, network['id'])
        raise exceptions.AutoAllocationFailure(reason=_('Unable    to    provide    tenant    private    network'))
    except Exception as e:
        network_id = (network['id'] if network else None)
        raise exceptions.UnknownProvisioningError(e, network_id=network_id)
