In Red Victory W. Bruce Lincoln says that as Commisar for War, Leon Trotsky recognized that the Bolsheviks did not have the expertise to lead the Red Army, and he would have to get former Tsarist officers to lead the Red Army.
How did he get these officers to serve?
Prior to the February and October revolutions, what was the political sense of the officer class of the Russian Army? Were there officers who were sympathetic to the Bolsheviks' cause?
What happened to these officers who served in the Red Army after the end of the Civil War?
First of all, apologies. I've had this question on the back-burner for some time, but I'm finally getting around to answering it.
First of all, what was the political sense of the Russian officer class before the revolutions? You might say that there wasn't one. The Russian Army was reformed in 1874 during the reign of Tsar Alexander II, whose laws extended service to all Russians regardless of social status. Russian aristocrats, however, tended to be good at wriggling out of military obligations, and men of the upper-class tended only to serve for short amounts of time. Because of this, the Russian officer class was much less aristocratic than, say, its counterpart in Britain. Most Russian officers were sons of soldiers or peasants, so there was a degree of upward social mobility.
However, there was still a sharp distinction between officers and the rank-and-file. Officers were considered educated men based on their training in military academies, where they studied history and literature, besides military science. They went to extraordinary lengths to minimize any influence by subversive politics (to the point that many actually did not teach Russian literature, because its ideas were considered dangerous!) This led the Russian officer class to be sort of aggressively apolitical. Anton Denikin, the commander of the White Volunteer Army, and himself from peasant stock, summed it up pretty well in his memoirs:
"The fatherland was accepted ardently, completely, as the entire complex entity of the country and the people - without analysis, without knowledge of its life, without delving into the murky realm of its interests... The young officers were hardly at all interested in social questions, which touched their consciousness as something strange or simply dull. In life they hardly noticed them; in literature pages dicussing social right and wrong were flipped over as something irritating, obstructing the development of the plot.. And indeed, generally they did not read much."
So, Russian officers were fundamentally uninterested in politics. The big objection by the Russian officer class to the revolutions was whether they weakened Russia's military. Indeed, many officers (among them White leaders like Denikin) supported the February Revolution because they felt it would aid the anti-German war effort.
This helps answer your second question, how did the Bolsheviks get former officers to serve in the Red Army? Well, coercion in part, but also there were very many willing volunteers. Like you said, Trotsky recognized that he needed help organizing an army, and an army of millions could not be effectively commanded by elections and unit-democracy, as the failure of the Provisional Government's army had shown. The regime had no choice but to draft thousands of ex-Imperial officers.
However, many joined by their own volition. Eight thousand ex-Tsarist officers responded to the Bolshevik government's call in February and March 1918, when negotiations between the Bolsheviks and the Central Powers broke down at Brest-Litovsk. They volunteered because they were patriotic and wanted to keep fighting Germany, and felt that the Red Army was the only force organized enough to do it. They also joined because the only other alternative for many officers was a life of poverty on the streets, as the collapse of the army had left them without pensions and placed them under a cloud of suspicion. Joining up gave them status and shielded them form persecution. Few openly sympathized with the revolution, let alone joined the Communist Party, but by and large they maintained their apolitical attitude: they wanted a job and to fight the Germans, and joining the Red Army allowed them to do both.
Of course, not many expected they would soon be fighting other Russians, and the Red Army still required far more officers and NCO's to lead it. Trotsky did not decide personally to enlist thousands more officers, the Bolshevik Central Committee did, and in July 1918 the drafting of officers got under way.
The ex-Imperial officers were termed "military specialists", similar to how members of the bourgeoisie were employed later in the Soviet Union as technical specialists, etc. Former Tsarist officers were always paired up with two political commissars, who approved his orders and watched for signs of unreliability. This actually became a trope in Soviet movies about the Russian Civil War - a grizzled, aristocratic ex-Tsarist officer will have to work together with a zealous young communist commissar, they will learn to get along and fight the reactionaries, yadda yadda.
75,000 ex-Imperial officers were employed as such during the Russian Civil War, including 775 generals and 1,726 members of the old Imperial General Staff. Ex-Tsarist officers made up 85% of the commanders of fronts, 82% of the commanders of armies, and 70% of divisional commanders.
So, again, how did they maintain their loyalty? Well, the commissars could have them executed, but more importantly, their families were held accountable under the idea of "collective responsibility". An ex-Imperial officer who failed or switched sides could have his family imprisoned or executed. This policy worked pretty well, and very few Tsarist officers in the Red Army defected to the Whites. This is also, again, because they lacked much political consciousness. Even when the White Armies were at their peak, they didn't have many volunteers from the officer class, who did not really care enough about reversing the revolution to enlist en masse. Also, the few that did defect sides were usually treated very poorly by the Whites. The Chief-of-Staff of the Red forces at Ufa, in Siberia, for example, defected to Admiral Kolchak's White Army in 1918, together with his whole staff. Not only did they make an amazing escape through the Red lines, they brought loads of valuable information. Yet Kolchaks' officers criticized him as a traitor for ever serving with the Reds in the first place, and came close to having him shot!
What happened to them after the end of the Civil War? To the best of my knowledge, many of them remained in the Red Army throughout the 1920s and 1930s, participating in other conflicts like the Soviet-Polish War. Many of them reached lofty heights, like S.S. Kamenev, an ex-Tsarist officer who became the Commander in Chief of the Soviet military. By the time of Stalin's purges in the 1930s, however, they were easy targets because their Tsarist background could be used against them, and many if not most were shot.
Sources:
Peter Kenez, Civil War in South Russia
Richard Pipes, Russia Under the Bolshevik Regime
Jonathon Smele, Civil War in Siberia: the Anti-Bolshevik Government of Admiral Kolchak