We study a variational problem whose critical point determines the Reeb vector field for a SasakiEinstein manifold. This extends our previous work on Sasakian geometry by lifting the condition that the manifolds are toric. We show that the EinsteinHilbert action, restricted to a space of Sasakian metrics on a link <i>L</i> in a CalabiYau cone <i>X</i>, is the volume functional, which in fact is a function on the space of Reeb vector fields. We relate this function both to the DuistermaatHeckman formula and also to a limit of a certain equivariant index on <i>X</i> that counts holomorphic functions. Both formulae may be evaluated by localisation. This leads to a general formula for the volume function in terms of topological fixed point data. As a result we prove that the volume of a SasakiEinstein manifold, relative to that of the round sphere, is always an algebraic number. In complex dimension <i>n</i>=3 these results provide, via AdS