Episodic ejection of plasma blobs have been observed in many black hole systems. While steady, continuous jets are believed to be associated with large-scale open magnetic fields, what causes the episodic ejection of blobs remains unclear. Here by analogy with the coronal mass ejection on the Sun, we propose a magnetohydrodynamical model for episodic ejections from black holes associated with the closed magnetic fields in an accretion flow. Shear and turbulence of the accretion flow deform the field and result in the formation of a flux rope in the disk corona. Energy and helicity are accumulated and stored until a threshold is reached. The system then loses its equilibrium and the flux rope is thrust outward by the magnetic compression force in a catastrophic way. Our calculations show that for parameters appropriate for the black hole in our Galactic center, the plasmoid can attain relativistic speeds in about 35 minutes.