Vowels are, strictly speaking, sounds, not letters of the alphabet.
The letters of the alphabet used to represent vowel sounds are a, e, i, o, u, w, and y.
The sound of "w" in "water" and of "y" in "yes" are called semi-vowels or glides; however, these glide sounds are not the only sounds which "w" and "y" represent. They can represent full vowels as well, as in "crwth" and "cyst" and "sky".
Furthermore, "w" is associated with "u" and "y" is associated with "i", so that "u" and "i" also represent the glide sounds in "water" and "yes", as in "quite" and "onion". Had history gone a little differently, we might now be spelling these last two as "qwite" and "onyon"!
So the little clause "and sometimes 'y'" is really a misleading little clause. It presupposes that the glide sound in "yes" is to be considered a consonant. Otherwise, the "y" would be considered a vowel the same as "a, e, i, o, u", i.e., always a vowel. And if "y" is not a vowel when a glide, then neither is "i", and there should be another clause saying that "i" is "only sometimes a vowel", it not being so when it represents a glide (as in "onion").
In summary, "i", "u", "y", and "w" are all used to represent both glides (semi-vowels) and full vowels.