VMware Communities
cmhui
Contributor
Contributor

How to get VM's own name from a VM

On Xen, there is a command xenstore_client which allows a VM to check it own VM name. Is there anything similar in VMWARE so that a VM can check its own VM name within the VM's O/S.

We're writing script to change computer name on Windows 7 after cloning from a template. We know VMWare can do customization when cloning a template but we'd like to know whether there is another way to do it.

Regards

0 Kudos
3 Replies
Sreejesh_D
Virtuoso
Virtuoso

if its a ESX \ ESXi host you can use the following command.

vim-cmd vmsvc/get.summary <vmid> | grep -i hostname

we can see the vmid by usnign the command "vim-cmd vmsvc/getallvms"

0 Kudos
cmhui
Contributor
Contributor

But I mean when the program is running in the VM's O/S, such as windows 7

0 Kudos
Sreejesh_D
Virtuoso
Virtuoso

there is no default commands in windows to find the details of underlying ESX host or VM.

Power CLI scripting is the option for it.

0 Kudos