If I want to say I was in Ukraine, do I say Ja buw w Ukrajini or Ja buw u Ukrajini?
In 99.9% we say в Україні. I can not remember any rule for this case. We just say like that. :)
It is better to use "w", so the consonant and vowel don't clash. The constant rotation of the consonants and vowels contributes to more melodical language. It is rarely required to follow this rule.
The Ukrainian FAQ has a section on в/у .