We have studied by means of ab initio calculations including electron correlation and cluster models the formation energies of a series of defects in bulk ${\mathrm{SiO}}_{2}$ and in silica glasses containing Ge impurities. The defects considered include oxygen vacancies, \ensuremath{\equiv}Si---Si\ensuremath{\equiv}, peroxyl linkages, \ensuremath{\equiv}Si---O---Si\ensuremath{\equiv}, peroxyl radicals, ${\mathrm{\ensuremath{\equiv}}\mathrm{Si}\mathrm{---}\mathrm{O}\mathrm{---}\mathrm{O}}^{\ifmmode\bullet\else\textbullet\fi{}},$ other radicals, ${\mathrm{\ensuremath{\equiv}}\mathrm{Si}\mathrm{---}\mathrm{O}}^{\mathrm{\ifmmode\bullet\else\textbullet\fi{}}}$ and ${\mathrm{\ensuremath{\equiv}}\mathrm{Si}}^{\mathrm{\ifmmode\bullet\else\textbullet\fi{}}},$ ${E}^{\ensuremath{'}}$ centers, $\ensuremath{\equiv}{\mathrm{Si}}^{\mathrm{\ifmmode\bullet\else\textbullet\fi{}}}{\mathrm{}}^{+}\mathrm{Si}\mathrm{\ensuremath{\equiv}},$ double oxygen vacancies, \ensuremath{\equiv}Si---Si---Si\ensuremath{\equiv}, Frenkel pairs, \ensuremath{\equiv}Si---Si---O---O---Si\ensuremath{\equiv}, etc. The corresponding analogs with Ge atoms replacing the network Si atoms have also been considered. We found that the formation of a single oxygen vacancy, defined as the energy required to remove and bring to infinity a neutral O atom, is 8.5 eV. This is consistent with the most recent thermodynamic estimates. The stability as well as the geometry of the other defects is discussed. It is shown that in the presence of Ge impurities the formation of oxygen deficient centers occurs at a lower energy cost.