Just as there are patterns to the stress of words ending in the suffixes -ic and -ious (the stress regularly falls on the immediately preceding syllable for either suffix), there are patterns to the "length" of a single vowel letter before a single consonant letter.
The patterns for vowel length have many more exceptions than the patterns for stress, though, and it's unclear to what extent English speakers productively apply vowel length alternation rules.
The concept of open and closed syllables is not relevant: it would be circular to say that harmonic has a short vowel in the second syllable because the syllable is closed, since the only reason that syllable would ever be analyzed as closed is because it has a short vowel.
Spelling is probably relevant, unless you make certain strange assumptions (which some linguists do, but which is not an obvious choice!) about the reality of double/long/geminate consonants in the English sound system. We find a "long vowel" in proscenium, selenium but not in millennium: since all of these words are usually described as ending in the same sequence of phones, [niəm], you either have to explain the difference in the pronunciation of the stressed vowels in terms of spelling, leave it unexplained, or say that the difference is not based on spelling but based on a phonological contrast between /n/ and /nn/ in English that happens to line up with the spelling contrast and is realized not as a difference in the phonetic length of the consonant itself, but as a difference in the pronunciation of the preceding vowel (for more on this last approach, search for the term "virtual geminate").
Words ending in -ic regularly have a short vowel in the stressed syllable if it is written with a single vowel letter other than U, and followed by at least one consonant. A post where I describe this a bit more, and try to categorize the multiple exceptions: Which words have a long vowel before the suffix -ic?
The explanation for -ic's behavior isn't very clear. The Sound Pattern of English, by Chomsky and Halle, treats it as based on the behavior of -ical, which has two syllables. Vowels written with a single vowel letter and followed by at least one consonant sound are often short in stressed syllables when followed by two syllables or more (Chomsky and Halle treat this as a shortening or laxing process, "trisyllabic laxing", but I've seen other sources that prefer instead to analyze it as simply an absence of lengthening in this context).
There are some other suffixes or just endings written with the vowel letter I which also have a tendency to occur alongside a short vowel in the stressed stressed syllable: -id, verbal -ish (as in finish, cherish), possibly -it (as in deposit, credit).
Words ending in -ious regularly have a long vowel in the stressed syllable if it is written with a single vowel letter other than I, and followed by only one consonant letter. This is part of a more general rule that says that A E O U are long in a stressed syllable whenever the following letters are a single consonant letter (other than X), an E or I (not representing a stressed vowel), and then another vowel letter (so sequences like -eliu-, -olio-, -alea-, where e and a are not a digraph representing a single vowel sound). So suffixes or endings like -ial, -ian, -eous, -ean show the same pattern of long vowels in the stressed syllable (genial, Washingtonian, erroneous, subterranean).
I discuss this lengthening rule a bit in my post here:
Why is "salient" pronounced with a "long a" sound?
It seems to have originated from a vowel-lengthening sound change that occurred at some point in Middle English. However, the pattern applies to Latinate words in general, not just words that have been in English since Middle English. It seems a bit more consistent that the -ic short vowel rule but there are still plenty of exceptions, some difficult to explain.