Recently, a lot of research efforts have been made to optimize the large amounts of energy consumed by different devices in data centers, including servers, cooling, and the data center network (DCN). Unfortunately, current research addresses these devices mostly in a separate manner, leading to inferior optimization results. This paper proposes PowerNetS, a power optimization framework that coordinates servers and DCN, as well as cooling, for minimized power consumption of a data center. PowerNetS leverages workload correlation analysis for more energy savings during server and traffic consolidations. More importantly, PowerNetS tries to change the DCN topology during server consolidation, in order to have more intra-server traffic and shorter flows that go through fewer switches. For example, two virtual machines previously located on two different servers can now be migrated to the same server, so that the flow between them no longer needs to use switches, which allows more devices to sleep for energy savings without network performance degradation. PowerNetS has been implemented on a physical testbed with 6 servers and 10 virtual switches that are configured using a production 48-port OpenFlow switch. Our evaluation with Wikipedia, Yahoo!, and IBM traces shows that PowerNetS can save up to 51.6% of energy by coordinating servers and DCN, which is 44.3% and 15.8% more than two state-of-the-art baselines, respectively. By further coordinating with cooling to utilize different cooling efficiencies at different locations within a data center, PowerNetS can achieve 8.8% to 14.6% additional energy savings.