Ronaldo was set to start the 3-1 victory against Espanyol before exiting during the pre-game warmup because of tightness in his leg.
Ancelotti says ''he didn't feel comfortable and we decided to take him out to avoid any risk. If today had been the final, of course Cristiano would have risked it and played but we didn't need to do that today.''
Madrid plays city rival Atletico Madrid in the final of the European showpiece on May 24.
Madrid striker Karim Benzema also limped off with a left leg injury at the Santiago Bernabeu Stadium.