2. If real numbers $a, b$ satisfy $\frac{1}{2} a - a b + b^{2} + 2 = 0$, then the range of values for $a$ is ( ).
(A) $a \leqslant -2$
(B) $a \leqslant -2$ or $a \geqslant 4$
(C) $a \geqslant 4$
(D) $-2 \leqslant a \leqslant 4$
2. B.

Since $b$ is a real number, the discriminant of the quadratic equation in $b$, $b^{2}-a b+\frac{1}{2} a+2=0$, is
$$
\Delta=(-a)^{2}-4 \times 1 \times\left(\frac{1}{2} a+2\right) \geqslant 0 .
$$

Solving this, we get $a \leqslant-2$ or $a \geqslant 4$.