We theoretically investigated the dynamics of oxygen vacancies (Vo’s) and the effect of changing their charge states by performing first-principles molecular dynamics simulations at a temperature of 1000 K. Calculations were performed for two structures of HfO2: a slab with (110) surfaces and a bulk single crystal. Our studies revealed that when the charge state of the Vo’s changed from neutral (VO0) to divalent (VO2+), Vo’s repelled each other and dispersed, in both the slab and bulk structures. In contrast, when the charge state of the Vo’s changed from VO2+ to VO0, the Vo’s attracted each other and resumed their original positions only in the slab structure. Therefore, the repeatable and reproducible formation/rupture of a VO filament can occur near the crystal surface, where the symmetry of the bulk crystal is broken. This result is consistent with the experimental results demonstrating that the resistive switching of the resistive random access memory develops in polycrystalline metal oxides rather than in single crystalline metal oxides.