Read this book in the late 80s / early 90s, used. A bunch of space cadets are in a training center on a distant planet and things go badly wrong and they have to fight a mostly-losing defense against some kind of reptilian native creature with poisonous spines. This is not "The Legacy of Heorot", FYI. The paperback cover showed a couple of people holding sci-fi guns standing over a pile of human and alien bodies in a doorway, if I remember correctly.
One of the episodes in Douglas Hill's Young Legionary fits this description. The main characters are teenaged cadets, training for their future careers as members of the Legions of Moros. (The main character is Kiell Randor, who features in the chronologically later Last Legionary novels. Along with him is his friend Oni Wolda, another cadet named Firek, and several others.)
The planet Moros is legendarily deadly, and the cadets are trapped at their isolated outpost in the midst of an unexpected migration of local reptilian creatures. They resemble snakes with ruffles of poisoned spines around their necks.
I don't remember how it turned out (and it's been a very long time since I read this particular book, so I may have made some mistakes in the above description). The books in the series have been printed with many different covers, although I don't recognize the appearance of the one described in the question.