The former Paris Saint-Germain coach has stressed that the Spain international remains a key player for Madrid and is not interested in swapping him for the Juventus veteran
Both playmakers are reaching the end of their respective contracts and Alonso, 31, has been heavily linked with a move to the Serie A champions, while Pirlo is thought to be keen on a reunion with former AC Milan boss Ancelotti.
However, the Madrid manager has made it clear that he will not make a move for his 34-year-old compatriot and is eager to keep Alonso at Santiago Bernabeu.
"Xabi is a vital player for Madrid now that he's recovered from injury. There are only two players like him in Europe. One is Pirlo and the other is Xabi," Ancelotti told Mediaset.
"However, we have no intention of making a player exchange deal with Juventus. There is no substance to any rumour like that.
"I am still in touch with Andrea because I have a good relation with him. I was pleased to see the Madrid fans give him a warm welcome when we met."
Pirlo, who has been with Juventus since the summer of 2011, was inspirational during their successive Scudetto triumphs but has seen his first-team place come under increasing threat from Paul Pogba this season.