Hello dimis hope its not too late to give an answer to this
I believe the issue is not into knowing the use of "a" in this situatuon but in knowing the structures that make up the sentence, in your previous example:
"Voy a pasar veintisiete dias en españa"
Actually you are using the future tense that in english the equivalent would be "I am going to..." = "Voy a..."
So the direct translation of
"Voy a pasar veintisiete dias en españa"
Would be:
"I am going to spend 27 days in spain"
Its a bit confusing because in spanish we tend to eliminate the subject in many sentences like in the sentence that you said, and the full sentence in spanish is this:
"Yo voy a pasar 27 dias en españa"
Remember that in english we have 2 future forms, one that is absolute and one that is probability but in spanish both future forms are almost the same, the difference lies in the fact that you express them in other ways
English:
"I am going to spend 27 days in spain"
" I will spend 27 days in spain"
Spanish
"Yo voy a pasar 27 dias en españa"
"Yo pasare 27 dias en españa"
And of course after you use any of these forms you must describe the type of activity you are going to do, thats what "a" stands for
Hope you find this helpful