A finite-capacity storage model is considered. The random inputs (negative inputs represent demands) are of various types, determined by a Markov chain, and occur at discrete times. Under suitable assumptions on the costs involved, including a penalty cost for unmet demand, an optimal control policy is determined for the releases from the storage facility, when operated over a finite horizon. Stationary control policies for the unbounded horizon are also determined and conditions for their optimality are discussed. Finally, a few simple examples are considered.