Added locking to vm creation.
Merge branch 'test' into dev