GO:0072507: divalent inorganic cation homeostasis
Any process involved in the maintenance of an internal steady state of divalent cations within an organism or cell.