Add metadata and set hostname of generated VMs.

Let's avoid referring to env from driver as much as possible.
api.py is a better place for env aware code.