Improved vm creation algorithm.