In order to improve the energy efficiency of optical interconnection network among datacenters, an energy-efficient hybrid routing algorithm with holding time awareness for anycast service is proposed in this paper. It gives priority to the single path transmission which aims at reducing new established light paths and working components; and the multipath transmission based on minimizing energy consumption will be used if traffic congestion occurs. In addition to that, the traffic grooming strategy based on spectrum reservation is also introduced to reduce the overheads involving in bandwidth and transponder. The simulation results show that the proposed algorithm can significantly reduce the network energy consumption and avoid the excessive increase of traffic blocking rate compared with the conventional energy-efficient routing algorithm. The balance of network energy consumption and performance is realized.