Speaking to BBC Radio 4's Today programme, he said: “The only response can be: 'yes, Mr President'.”
Gen Petraeus resigned as CIA director in 2012 following an extramarital affair with his biographer.
It later emerged he had shared classified material with her.
He served as a senior officer under Presidents Bush and Obama. He was the commander of US and Nato forces in Afghanistan, before retiring from the military to take the top position in the Central Intelligence Agency.