Optimizing On-Demand Resource Deployment For Peer-Assisted Content Delivery