What I'm trying to create: ...
So, a few items of note.
17x17 is a small world, it will keep things at a brisk pace
a dead civ means nothing, Armok will create and send as many dwarves as you set your popcap to, regardless of current civs
War and opposed are different. Getting to be at WAR is often challenging, you can only tell when you embark, and that of course can change immediately after, if certain armies conquer sites and so on.
kobolds are tough to get and harder to make survive, given their features. however, a short history of say 50 years and a 500/500 cavern should get you there
for elves you need non-evil forests, which can complicate worldgen when shooting for other features
the whole world can be lacking in evil, or you can make it evil in the biome sense without evil effects like reanimation. either is possible.
magma is always reachable unless you remove it from worldgen, but if you want it easily reachable, only put in one layer of caverns. this has other consequences though, some of which can be annoying to dire.
getting sand can be frustrating, but soil generation is not my specialty, honestly.
no shallow or deep metals of any kind means no metals of any kind.. are you sure?
what do you need the flux for, if there are no metals...? goblinite?
partial aquifer or full aquifer are possible, there's also water in the caverns, or streams or rivers, which are quite different. streams don't block non-swimmers, rivers do.
no surface trees but with elves desired can be tricky without either many gens and getting lucky with the RNG, or using the world painter.
there's almost always wood in the caverns, but sometimes not, depends on a few factors, regarding beds.
I can almost guarantee you a dead civ. that's very easy, especially in the current versions. Just allow one site for your civ, and it'll be dead, almost guaranteed. Why? because the first site of any dwarven civ is almost always conquered by a forgotten beast. So if there's only one, it's gone.
You'll always get caravans, even from a dead civ, in my experience.
If the goal is magma, make a shallow world (search this thread for shallow) and a single cavern. Ensure there's at least 50% water and you'll get all your underground crops.
If you want candy but no clowns, set demons to zero. However, this will make it so there's no goblin civs, which means no goblinite. Goblin civs require a demon leader, now.
Keeping those in mind, what you want to do should be possible.
The tool to show what was in the embark was 'prospect' in dfhack, and I think dfhack also has a sand search plugin/script now, in the lastest versions (15+?) although I haven't personally used that feature.
Typically, as smeeprocket has said, it's either the magma sea or a volcano at or above the embark level. I have seen underground volcanos (what some people call magma pipes) but I've never derived a method to reliably generate them at desired depths, so I just stick with shallow worlds.