How would I use the VI Toolkit4Windows from a Windows system running within a VM to get information about the VM and host ESX system? I realize this is kind of a strange question but we do a lot of VI development testing work here. That includes creating and cloning VMs in rather large volumes. And, part of that process involves doing things within the test VM based on a) the specific VM name or b) the specific ESX host on which the VM is running. Since I am dealing with 75-128 VMs all in one setup process it would help a great deal if I can automate this.
A part of this is changing the guest OS hostname and IP address based on the VM name. I have looked at the various topics and questions both here and within the FAQ and so far I have not been successful getting a script to run to do those two changes.
Any assistance is greatly appreciated.
Can you explain why you would need to do the customisation from within the guest ?
This looks a bit like the chicken and the egg problem.
With the VI Toolkit (and the SDK APIs) you can:
- create/clone guests
- customise the guest (hostname, IP address...) with the CustomizeVM_Task method
- define/determine on which ESX host the guest has to run
And all this from a station that has the VI Toolkit installed.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
There are two reasons I need to "customize" from within the guest.
1) I have not gotten customization to work in either CloneVM_Task or
CustomizeVM_Task.
2) Some of the customization is at the workload level. Once I have the
new VM cloned with a new system name and IP addr some workload file
entries need to be changed based on where this instance of the VM is
running.
Thanks,
Roland.....