In this paper we consider a system with two production operations (typically machines) and a buffer between them. Our objective is to determine the optimal buffer inventory level, b*, that triggers preventive maintenance on the first production operation. We assume that periodic preventive maintenance will, in the long run, decrease the first production operation's failure rate. A cost model for the system is specified that includes the costs of preventive maintenance and unscheduled repairs, starving the second production operation, and inventory. The cost model is dependent on the values of performance measures that are a function of b*, which defines the preventive maintenance policy. We model the stochastic buffer content process of this system and obtain the performance measures with an embedded absorbing Markov chain analysis. Under certain scenarios, the implementation of the preventive maintenance program is shown to decrease the system cost and the output process variation. Furthermore, our model can be used to indicate oversized buffers in such an environment.