The former Paris Saint-Germain coach has stressed that the Spain international remains a key player for Madrid and is not interested in a swap 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 champion while Pirlo is thought to be keen on a reunion with former AC Milan boss Ancelotti.
However, the Madrid boss has now 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 rumor 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 has been with Juventus since the summer of 2011 was inspirational in the club's successive Scudetto triumphs, but has seen his first-team place come under increasing threat from Paul Pogba this season.