In this paper, we present a methodology for the optimal sizing of the Battery Energy Storage Systems (BESS) in Data Centers (DC) to provide Frequency Containment Reserve (FCR) or Primary Control Reserve (PCR). In this context, the BESS can offer ancillary services to the grid without disrupting the normal operation of the DC. By taking into consideration the requirements in terms of backup power provision to the DC as well as the FCR, along with the investment and operating costs, the optimal sizing of the BESS is determined. The results obtained from the DC's simulation show the economic benefits of providing FCR to the grid using Li-Ion Lead-Acid BESSs, which in turn helps generate additional revenues for the DC operators and reduce the operating costs without hampering the necessary uptime requirements and the normal operation of the DC.