I wan't to change the networkcard on all our vm's to enhancedvmxnet, for this i created a script. But one problem resided, and that is configuring the ip adres inside the vm.
Who has got a snippet for that?
OK, I forgot to mention that.
They were all Windows 2003
I'm also looking for a way of doing this kind of modification after cloning of VMs. Maybe this reply doesn't belong in this thread.
In VMware SRM you have an option of editing only IP address info by utilizing OS customization specification template. The difference with cmdlet set-Vmguestnetworkinterface (or tricks like invoke-script) is that you don't need authentication inside the running OS (in my environment i dont have this kind of access but sometime i need to clone certain VMs that can be used/later configured by OS administrators).
So is there a way of making the script parts (as shown in first reply of this thread, LUCs reply) to work with cloning proces.
I would like to utilize two important parts:
- make IP address info changes on cloned VMs.
- if possible execute runonce command
(the parts being called by runonce command are placed after cloning and before booting cloned VMs by utilizing VMware VDDK).
All this stuff by using 'VMware.Vim.CustomizationSpec etc' and without doing modifications like SID change, computer rename and stuff like that.
Environment vCenter 4.1/vSphere 4.1.
Cloned VMs (XP,Vista,Win2003,Win2008)
Any ideas how to achieve this?