Network virtualization is a paradigm that allows for flexible and efficient allocation of the resources among multiple virtual networks (VNets). In this paper we deal with the problem of embedding dynamically arriving VNet requests. We describe a generic algorithm for the online VNet embedding problem and analyze its competitive ratio. This means that we compare the benefit accumulated by the algorithm with the benefit of an optimal offline algorithm. We prove that the competitive ratio of our online algorithm is, loosely speaking, logarithmic in the sum of the resources. Our algorithm is generic in the sense that it supports multiple traffic models, multiple routing models, and allows for nonuniform benefits and durations of VNet requests. Concretely, the routing models considered in this paper include: multipaths, single paths, and tree routing. For modeling traffic, we study the customer-pipe model, the hose model, and a new traffic model, called aggregate ingress model, t...