Improved vm creation algorithm.
Merge branch 'test' into dev