This paper shows that the oxygen vacancies observed experimentally in thin films of LaCoO3 subject to tensile strain are thermodynamically stable according to ab initio calculations. By using DFT calculations, we show that oxygen vacancies on the order of 6 % forming chains perpendicular to the (001) direction are more stable than the stoichiometric solution. These lead to magnetic Co2+ ions surrounding the vacancies that couple ferromagnetically. The remaining Co3+ cations in an octahedral environment are non magnetic. The gap leading to a ferromagnetic insulating phase occurs naturally and we provide a simple ionic picture to explain the resulting electronic structure.