The Tongan international No.8 previously played Super Rugby with the Blues.
He played for Tonga in their successful Rugby World Cup campaign in 2011.
Ma'afu was awarded the 2009 North Harbour Player of the Year and is a triple international - having represented Tonga in tennis and golf as well as playing for the national Sevens team.
On signing for the Warriors, Viliami said "I’m delighted to have signed for a major club like Glasgow Warriors, and can’t wait to become part of the team in the summer.
“I know they’ve been doing well in the RaboDirect PRO12 this season, and it’s exciting to know I’ll be able to play a part in big games in that competition and the Heineken Cup.
“I’ve been very impressed by what everyone at the Warriors has told me about where they want to take the club – it’s clear that there is a lot of ambition, and a talented squad in place. It’s going to be a fantastic place to play my rugby.”