In the winter of 208 Cao Cao led a large army on a southern campaign. The allied armies of Sun Quan and Liu Bei were massed on the south bank of the Yangtze River. They planned to attack the warships of Cao Cao with blazing barges. When all the preparations for the attack were completed, they called to mind that the wind in winter always blew from the northwest, and so would blow the fire barges back toward their own ships. So an east wind was needed for the attack. Zhuge Liang said that he could summon an east wind, and he did so... The result was that Cao Cao's ships were burnt to ashes.
Later, the phrase came to be used to describe a situation in which all is ready except what is crucial for the fulfillment of an undertaking.
This allusion is taken from The Romance of the Three Kingdoms.