added updated code of VMManager from Yogesh pull request