  We investigate the entanglement of the ferromagnetic XY model in a random
magnetic field at zero temperature and in the uniform magnetic field at finite
temperatures. We use the concurrence to quantify the entanglement. We find
that, in the ferromagnetic region of the uniform magnetic field $h$, all the
concurrences are \textit{generated} by the random magnetic field and by the
thermal fluctuation. In one particular region of $h$, the next-nearest neighbor
concurrence is generated by the random field but not at finite temperatures. We
also find that the qualitative behavior of the maximum point of the
entanglement in the random magnetic field depends on whether the variance of
its distribution function is finite or not.
