Endospore formation is usually triggered by a lack of nutrients, and usually occurs in gram-positive bacteria. In endospore formation, the bacterium divides within its cell wall, and one side then engulfs the other. Endospores enable bacteria to lie dormant for extended periods, even centuries.