Messi, 32, is reported to have a clause in his contract that would allow him to leave Barca on a free transfer at the end of the season.
There is an obvious connection between the six-time Ballon d’Or winner and Guardiola, under whom he won two Champions League titles at Barcelona, but the current City manager is not expecting to renew their partnership.
“He is a player from Barcelona and he will stay there, that’s my wish for him to stay in Barcelona,” said Guardiola, who remains a Barca fan and has frequently been asked about Messi throughout his tenure at the Etihad Stadium.
“I’m not going to talk about players for other clubs. I think he will finish his career there, that’s my wish.”
Guardiola is without one of his current star players for Sunday’s Premier League clash with West Ham after Raheem Sterling suffered a hamstring injury in last week’s defeat at Tottenham.
City are still unclear how long the England international will be absent and whether he will be fit to face Real Madrid in the Champions League on February 26.
Guardiola said: “It’s a hamstring injury, and we will see. Of course, it takes weeks but we’ll see before Leicester, (Real) Madrid and the rest of the games. I don’t know right now.
“It’s a problem, but it’s a problem we had with (Ilkay) Gundogan out for six months in the first year, and (Aymeric) Laporte this season for four or five months.
“It’s always a problem but it is what it is. During the season it happens, this kind of thing. unfortunately for the players.”