Does anyone know how they filled the cast for all the storm troopers in the original trilogy (IV, V, VI) movies. Did they get them from military volunteers?
In actuality, there's probably only about a dozen or so actors used for Stormtroopers (lots of actors are reused, like Jeremy Bulloch appearing in ESB as both Boba Fett and an unmasked Imperial Officer)
Most of the vast legions of Stormtroopers are created utilizing matte paintings.
Here is one in-progress
Here is a finished one. If you look closely, you can see a "black" area near the shuttle. That's a clear spot on the glass where the live action would be filmed through. Watch closely in scenes where there are large groups of troops, and you'll notice that only those closest to the action ever actually move. That's because they're the only ones that were real actors.
Did you really think they built a village in the trees?
Not specifically Star Wars, but a great example of the steps involved in using a matte painting
Here is an artist setting up the camera so that it only films the live-action portions of the scene
Here is a great example of what is filmed actually filmed versus the final shot
Let's put it all together to see what it looks like.
As for how the actual troopers/actors did get cast...
I haven't actually read anything from an actual Stormtrooper, but based on what I have read and heard, I imagine it was the typical process for being cast as an non-featured role: know someone or get the job through the standard extra casting process.
Jeremy Bulloch said in an interview:
Having gone through the extra-casting process myself in the past, typically casting agencies are provided general descriptions of roles/groups they're looking for. Each candidate either provides a few basic photos, or comes in for them (as I had to). Those who fit the descriptions may be called in for fittings or readings if necessary. In my case, I was chosen solely on my appearance since it was for "deep background" where I would only be yelling and looking angry (for Pirates of the Caribbean 2 and 3).
For roles like Storm Troopers and most Rebels, a similar process would have occurred.
As per phantom42's answer, this was the days just before CGI, so there were a few live actors composited onto small live-action windows in matte paintings by these painters:
Empire Strikes Back: Harrison Ellenshaw, Ralph McQuarrie, Mike Pangrazio
Return of the Jedi: Mike Pangrazio, Chris Evans, Frank Ordaz
In addittion to matte paintings, cardboard figures were also used, notably in the hangar scenes in Return and the ceremony at Yavin.
If you have the old editions, you see this if you look for it, but I'm pretty sure this was replaced in the newer, more CG versions.
Edit: Here is a link to two photos from the award ceremony at forum.blu-ray.com. However, it is easier to see in the film as the cardboard cutouts are 100% stationary whilst live actors usually move somewhat no matter how still they should be (and CG characters usually move more unnaturally).