In a highly technology-dependent society, processing large amounts of data has become essential, resulting in a growing number of data centers. The global data center industry accounts for a significant proportion of the world’s energy consumption. A partial or total transition of the energy sources that power the operation of data centers to cleaner energy, particularly onsite renewable technologies, will help to achieve the greenhouse gas emission reduction goals established in international agreements. However, integrating such technologies is difficult due to the intermittency and availability of renewable sources. Nevertheless, temporal and geographical flexibility for processing part of the data centers’ workload provides an opportunity to efficiently integrate these renewable energy sources. In this paper, we develop an operational scheme for a network of interconnected data centers with a significant electricity supply from onsite technologies consisting of (i) an optimal job migration and scheduling policy for data centers to match their operation and the availability of renewable energy under an emissions cap-and-trade program; (ii) an energy management system to control the data centers’ onsite renewable and grid energy resources; and (iii) a robust optimization approach to account for the intermittency of the renewables and to identify the optimal migration and scheduling policies under the worst-case scenario. A case study is carried out to assess the economic and environmental impacts. The results indicate that the installation of onsite technologies and an optimal migration policy reduce the operational costs and the greenhouse gas emissions of the networks of data centers.