It was Gen. Petraeus who brought the war in Iraq to a more-or-less successful conclusion. Go here to see an Associated Press article on the Yahoo News website about the replacement.
McChrystal, the son of a general, is reputed to have been a spirited trouble-maker ever since his undergraduate days at West Point. Most of the time he has managed to squirm out of the trouble into which he's gotten, not this time.
It will be interesting to see what his next career move will be. I'd suggest forming a consulting firm offering COIN (counterintelligence) expertise to third-world nations with troublesome insurgencies.