Stochastic planning for content delivery: Unveiling the benefits of network functions virtualization