As more uncontrollable renewable energy sources are present in the power generation portfolio, the need of more detailed and reliable tools for the optimal operation of energy systems has increased in the last years. This work presents a multi-stage stochastic Mixed Integer Linear Program with binary recourse for optimizing the day-ahead unit commitment of power plants and virtual power plants operating in the day-ahead and ancillary services markets. Scenarios reproduce the uncertainty of the ancillary services market requests, and production of photovoltaic panels. A novel decomposition algorithm is proposed to tackle the challenging multistage stochastic program. The methodology is tested on three types of large power plants: a natural gas-fired combined cycle, a combined heat and power combined cycle with thermal storage, and a virtual power plant integrating a combined cycle with battery and photovoltaic fields. Compared to the typical deterministic unit commitment approach, the proposed stochastic optimization approach allows to increase the revenues of the conventional power plant up to 13.58% and, for the combined heat and power and virtual power plant case, it allows finding a feasible and efficient operational scheduling.