Concept:
The midpoint formula in three dimensions is
\[
M\left(
\frac{x_1+x_2}{2},
\frac{y_1+y_2}{2},
\frac{z_1+z_2}{2}
\right).
\]
If the midpoint and one endpoint are known, the coordinates of the other endpoint can be found easily.
The distance between two points in three-dimensional geometry is
\[
d=
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2+(z_2-z_1)^2}.
\]
After obtaining all three side lengths, we add them to obtain the perimeter.
Step 1: Determine the coordinates of \(B\).
Given midpoint
\[
M(-1,2,1).
\]
Using midpoint formula,
\[
\left(
\frac{2+x_B}{2},
\frac{1+y_B}{2},
\frac{-3+z_B}{2}
\right)
=
(-1,2,1).
\]
Comparing coordinates,
\[
2+x_B=-2
\Rightarrow x_B=-4,
\]
\[
1+y_B=4
\Rightarrow y_B=3,
\]
\[
-3+z_B=2
\Rightarrow z_B=5.
\]
Hence
\[
B=(-4,3,5).
\]
Step 2: Calculate \(OA\).
\[
OA
=
\sqrt{2^2+1^2+(-3)^2}.
\]
\[
=
\sqrt{4+1+9}.
\]
\[
=
\sqrt{14}
=
\sqrt2\,\sqrt7.
\]
Step 3: Calculate \(OB\).
\[
OB
=
\sqrt{(-4)^2+3^2+5^2}.
\]
\[
=
\sqrt{16+9+25}.
\]
\[
=
\sqrt{50}
=
5\sqrt2.
\]
Step 4: Calculate \(AB\).
\[
AB
=
\sqrt{(-6)^2+2^2+8^2}.
\]
\[
=
\sqrt{36+4+64}.
\]
\[
=
\sqrt{104}.
\]
\[
=
2\sqrt{26}
=
2\sqrt2\,\sqrt{13}.
\]
Step 5: Find the perimeter.
\[
P
=
OA+OB+AB.
\]
\[
=
\sqrt2\sqrt7
+
5\sqrt2
+
2\sqrt2\sqrt{13}.
\]
Factor \(\sqrt2\),
\[
P
=
\sqrt2
\left(
5+\sqrt7+2\sqrt{13}
\right).
\]
Comparing with
\[
\sqrt2
\left(
k+l\sqrt7+m\sqrt{13}
\right),
\]
we get
\[
k=5,
\qquad
l=1,
\qquad
m=2.
\]
Step 6: Compute the required value.
\[
k+l+m
=
5+1+2.
\]
\[
=8.
\]
Step 7: Final Conclusion.
\[
\boxed{8}
\]
Hence the correct answer is
\[
\boxed{\text{Option (B)}}.
\]