I want to be able to use either a power-cli cmdlet, or the vsphere api (i'm writing in C#) - to be able to change a vm's hostname. I don't mean the name of the vm we see in the vsphere's gui - but the one we see when we use the command line "hostname" in the cmd line prompt window.
Asked
Active
Viewed 743 times
1 Answers
0
The hostname you see under "hostname" is the real hostname the guest os communicates out of its vmworld. it is determined by the actual hostname setting in the os. e.g. in linux it's the name in /etc/hostname. in windows it's the hostname defined in the machines properties. afaik there is no command to change that value through vsphere api. you would have to change that "by yourself" using a script or other means. but consider the implications of changing the hostname of a maschine.
hope this helps.

Alexander Heuser
- 1
- 1