Content Delivery Networks (CDNs) emerged to manage the great amount of content, as well as the transmissions over long distances. In recent years, this concept proves to be a promising solution for emergent enterprises. In this paper, we present a Content Delivery Network as a Service (CDNaaS) platform which can create virtual machines (VMs) through a network of data centers and provide a customized slice of CDN to users. CDNaaS manages a great number of videos by means of caches, transcoders, and streamers hosted in different VMs. However, an optimal placement of VMs with adequate flavors for the different images is required to obtain an efficient slice of CDN. In this work, we argue the need to find a convenient slice for the CDN owner while respecting his performance requirements and minimizing as much as possible the incurred cost. We first formulate the VMs placement problem as two Linear Integer problem solutions, aiming at minimizing the cost and maximizing the quality of experience of streaming. Then, extensive simulation results are presented to illustrate the effectiveness of the proposed models.