We're building an environment in which VMs are automatically deployed. We need the VM its hostname to be identical to the VM name in vSphere (which is randomly being created). Is there a way to retrieve the vSphere/vCenter VM name from within the VM itself?
For now we're testing on Linux VMs, but eventually we'll also be deploying Windows Server VMs. VMwaretools is installed on the VMs.