With the penetration of Network Function Virtualization (NFV), network functions, traditionally deployed as proprietary physical equipment like firewalls, Network Address Translations (NATs), are gradually being implemented as software and deployed on standardized hardware. One of the crucial challenges in this paradigm is how to place the software implemented network functions to minimize the number of used physical servers. In this paper, we study the problem of how to optimally place Virtual Network Functions (VNFs) in networks where it is allowed to migrate already placed VNFs to decrease used servers. We first formulate the offline problem as an Integer Linear Programming (ILP) problem, and then propose a semi-online algorithm to solve the online variant of the problem. We name the proposed algorithm Semi-onlIne Vnf plAcement (SIVA). In particular, SIVA is based on a bin packing algorithm that solves online bin packing problem while taking care of migrations. According to our theoretical analysis, SIVA migrates at most $$\lambda$$ VNFs each step, and it has Asymptotic Competitive Ratio (ACR) of 3/2 if $$k \rightarrow \infty$$ , where $$\lambda = k \cdot |N|$$ , k is a tunable parameter, and $$|N|$$ is the the number of supported VNF types. We conduct extensive numerical simulations to evaluate the performances of SIVA. The experiment results validate the theoretical analysis and show that SIVA outperforms the state-of-the-art algorithms by achieving near-optimal performance with minor VNF migrations.