Optimal operation of large-scale heating, ventilation, and air conditioning (HVAC) systems requires many discrete-valued decisions. For example, in large heating and cooling plants, operators must choose which combination of equipment to activate to meet a given load. Such discrete decisions are typically made by operators using heuristics, which can lead to suboptimal performance. In this paper, we discuss how relevant HVAC decision problems can be transcribed into mixed-integer linear programming (MILP) formulations. We first present the general modeling framework we adopt, which is very similar to the resource task network framework adopted in chemical production scheduling. Second, we discuss a series of reformulations, including linearizations of complex unit models. Third, we present solution methods, including decomposition approaches and the employment of surrogate models to approximate the performance of the system over a long planning horizon. Finally, we demonstrate how the resulting optimization problems can be solved online in closed loop to improve system performance.