Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

IT just setup vCenter 4.1 for my team. Using vSphere client, I:

  • Created a VM (name: A)
  • Cloned to a template
  • Deployed a VM (name: B) from the template, checked the option to name the computer name same as the VM name.
  • Once VM starts, its computer name is still "A"!!
  • I had to rename and reboot it for the name to take effect
  • This is not practical for me since I need to deploy over 20 VMs from the template

This used to work perfectly in 4.0, what am I doing wrong?

Also, can anyone please point me to a script sample I can use a baseline to create these 20 VMs in a loop from the template? and if there is no way to resolve the name issue described above, perhaps I can include the renaming code inside the script instead of doing it manually for each VM.

share|improve this question

2 Answers 2

The VM Customization wizard is a bit odd in that it does a reboot of the server after deploying for its changes to take effect. The standard flow is:

  1. Deploy VM from template, using customization wizard.
  2. Power on VM.
  3. VM finishes booting, vmware tools do the customization, then they issue a reboot.
  4. When VM boots the second time, all changes are in place.
share|improve this answer
1  
Just to be clear you need to have vmware-tools installed in the VM template image before cloning so that it can wake up and make changes during the boot process. –  mtinberg Jul 6 '11 at 21:13
    
ErikA, yea, but the new VM after it reboots still has the original VM's netBIOS name. Very strange. In the wizard's step of deploying the VM from template, instead of picking the option to name the netBIOS name as the VM, I supplied a name explicitly, still didn't take effect. I then tried again by supplying the name at the wizard deploy time, still didn't take effect. Hitting a wall. –  sOltan Jul 6 '11 at 21:26
    
mtinberg, I looked at the seed VM from which I cloned the template, and saw vmware tools installed, having only one tool called "Start VM Statistics Logging". Does this provide a clue? perhaps I'm missing a particular tool? –  sOltan Jul 6 '11 at 21:29
    
mtinberg, there are actually a bunch of files and a few folders installed in the path c:\program files\vmware\vmware tools\ –  sOltan Jul 6 '11 at 21:40

To answer your second question, I would install PowerCLI and write a simple PowerShell script that calls New-VM with the proper parameters. If you don't know the VMware API or PowerShell you can probably get away with copy and paste for the handful of commands you need.

share|improve this answer
    
mtinberg, thanks, i'll explore this. I don't know vmware api or PowerShell, so I hope there is useful documentation/snippets out there. –  sOltan Jul 6 '11 at 21:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.