Let $E$ be a smooth vector bundle over a manifold $M$, equipped with a connection $\nabla$. 


The set of $\nabla$-compatible metrics on $E$ forms a *convex cone*.
This cone can be empty, however (see [here](https://mathoverflow.net/questions/54434/when-can-a-connection-induce-a-riemannian-metric-for-which-it-is-the-levi-civita) and [here](https://math.stackexchange.com/a/517070/104576)).


"How big" can this cone be? Is it always (or ever) a manifold?
(in the finite dimensional setting [not every convex cone is a manifold, but *closed* ones are](https://math.stackexchange.com/a/1745846/104576)).


What is its **maximal** dimension (as a function of $\dim M,\dim E$)? Can this cone be infinite dimensional? non-zero but finite dimensional?


Also, it would be interesting to know what is the **minimal non-zero** dimension possible (is it greater than one?).


(To summarize, I am asking "which numbers" - including infinity - can be realized as dimensions of this cone).



How large can the cone of $\nabla$-compatible metrics be?
The $\nabla$-compatible metrics on $E$ are the positive-definite $\nabla'$-parallel sections of $S^2(E^\*)$, where $\nabla'$ is the connection on $S^2(E^\*)$ induced by $\nabla$. When $M$ is connected and $x\in M$ is fixed, the space of $\nabla'$-parallel sections of $S^2(E^\*)$ is isomorphic to the set $Q\_x(\nabla)\subset S^2(E^\*\_x)$ of quadratic forms on $E\_x$ that are invariant under the holonomy group $\mathrm{Hol}\_x(\nabla)\subset \mathrm{GL}(E\_x)$. 


*A priori*, the holonomy group $\mathrm{Hol}\_x(\nabla)$ could be just about any subgroup of $\mathrm{GL}(E\_x)$, so your question is really a linear algebra question of how many quadratic forms on a vector space $V$ are invariant under a given subgroup $H\subset\mathrm{GL}(V)$. The subset $Q^+\_x(\nabla)\subset Q\_x(\nabla)$ consisting of positive definite quadratic forms is a (possibly empty) open subset of $Q\_x(\nabla)$, so if it's not empty, then it has the same dimension as $Q\_x(\nabla)$. Note that $Q^+\_x(\nabla)$ is non-empty if and only if the closure of $\mathrm{Hol}\_x(\nabla)$ in $\mathrm{GL}(E\_x)$ is compact.


The main restriction on $\mathrm{Hol}\_x(\nabla)$ (when $\dim M \ge 2$) is that there has to be a surjective homomorphism 
$$
\pi\_1(M,x)\to \mathrm{Hol}\_x(\nabla)/\mathrm{Hol}^0\_x(\nabla),
$$
where $\mathrm{Hol}^0\_x(\nabla)\subset \mathrm{Hol}\_x(\nabla)$ is the identity component of the group $\mathrm{Hol}\_x(\nabla)$. [Of course, when $M\simeq \mathbb{R}$, the group $\mathrm{Hol}\_x(\nabla)$ is trivial, so $Q\_x=S^2(E^\*\_x)$,
and when $M\simeq S^1$, the group $\mathrm{Hol}\_x(\nabla)$ is the set of powers of a single element $h\in \mathrm{GL}(E\_x)$.]


In any case, the dimension of $Q\_x(\nabla)$ can be as low as $0$ and as high as $\tfrac12r(r{+}1)$, where $r$ is the rank of $E$ (i.e., the dimension of $E\_x$).


