Volkswagen was caught installing software in its diesel cars to cheat emissions tests, affecting 11 million vehicles worldwide.