Peter said: "I'm delighted to sign this contract. The club is going in the right direction and we've shown that over the last couple of years.
"Since I joined the club I've progressed as a player, with the help of the coaches and the players around me and I want to keep progressing to become the best player I can be.
"It's nice to feel wanted and it's great the club have put faith in me and it's the perfect place for me to develop.
"We've got a fantastic squad and they are my best friends and we hang out a lot.
"It's a brilliant place to be and I'm loving living in Glasgow, so for me it was a no brainer to sign this deal.”
Glasgow Warriors head coach Gregor Townsend added: "It's fantastic news that Peter is staying at Scotstoun for another few years and this will give everyone at the club a big boost so early in the new season.
"He works really hard at his game and is improving all the time.
"Peter is a Scotland international with the ability to play at 10 and 12, so we are delighted he has committed his future to the club."
Meanwhile, there is a new addition to the playing squad with former Dalziel and Glasgow Hawks prop Gary Strain signing a one-month training contract.
The 26-year-old spent last season with Aviva Premiership side, Newcastle Falcons and the former Scotland under-20 cap will be available to play for Glasgow Hawks, when he's not involved with Gregor Townsend's squad.