The new deal means the Scotland international will be playing his rugby at Scotstoun until at least May 2020.
Ali told Warriors TV: "It was an incredibly easy decision for me to make. I've been up here for four years now and I'm loving it and the club's in a really good place.
"Playing at Scotstoun is a feeling I can't really explain. I love the buzz. Glasgow fans love their team and as a player I love that. I love running out here and they give us the extra motivation we need.
"I'm staying here because I want to win things. I feel like the squad and coaching staff we've got here have the ability to do that and it's really exciting."
Glasgow Warriors Head Coach Dave Rennie, said: "We're rapt that Ali has signed up. He's developed into a top class 9 and the speed that he brings is a big part of how we're trying to play the game.
"He's a good man and he loves the club and it's great for us to have an international scrum-half committing long-term."