Balancing between cost and availability for CDNaaS resource placement