Making Datacenters Resilient and Efficient