Category Archives: Virtual Machines and Templates

Creating a Server 2008R2 Template on vCenter 4.1

Long Story Short: It’s pretty simple, but if you want to do advanced things like automatically activate, activate office, join domain, etc, then you need to use sysprep.exe and that’s another post entirely. Take a look at my post on using Windows 7 with WDS for a good idea at how to do some interesting things with your sysprep.xml file.

In this post I’ll show you how to Create a basic template for a workgroup server with a preconfigured network settings that’s not automatically activated. What you want to do after that is your call. Follow these steps.

  1. Create a new VM, Select “Typical” and click “Next >”.
  2. Name the VM, it would be a good idea to identify this image as a template so that you can go back later, clone it, and make new templates from it. Click “Next >”.
  3. Select the Host or Cluster that this VM will run on, and then click “Next >”.
  4. Select the Datastore to run your host on, and then click “Next >”.
  5. On the screen where you select which operating system to use, select “Microsoft Windows” and then from the drop down select “Microsoft Windows Server 2008 (64-bit)”. The reason for this is VMware is doing something funky during the template process for Server 2008 R2 that it’s not doing for Server 2008 (x64). I kept running into networking problems when I selected 2008R2, where IP and Default Gateway settings were just not working properly, if you choose to use 2008 (x64) it works wonderfully. You can change it back to 2008R2 after the VMs have been deployed from template if you wish. Click “Next >”.
  6. Select the size and type of the disk you’d like, and then click “Next >”.
  7. Click “Finish”. Open the settings for the VM and change it to boot into the BIOS on first boot.
  8. Once in the BIOS, disable the Com and LTP ports. Now attach an ISO of Server 2008 R2, and install the OS.
  9. Once the installation is completed, install your software, run updates, set a static IP address, etc. Because we’re not doing anything fancy with this Template we’ll not configure a sysprep file, we’ll let VMware take care of this for us. Shut down your VM.
  10. Right click on your VM in vCenter client and select “Template >”, then select “Convert to Template”.
Now that we’ve got a updated template we’ll configure a customization file for it. This will allow us to rapidly deploy VMs from this template using a nice and easy wizard that will update our Static IP address as we deploy VMs. Follow these steps:
  1. Go to the Home screen in the vSphere client, and click on “Customization Specifications Manager”.
  2. Click the “New” button.
  3. Choose “Windows” from the Virtual Machine OS drop down, assign this Specification a name and a description and then click “Next >”.
  4. Now enter the Name and Organization that will appear in the guest OS. Click “Next >”.
  5. On the NetBIOS name screen, select “Enter a name in the Deploy wizard” and click “Next >”.
  6. On the Product Key screen enter the product key that you’ll be using for this deployment and then click “Next >”. Note if you are using trial software for temporary VMs or test environments just leave this blank. Click “Next >”.
  7. Define an Administrator password and then click “Next >”.
  8. Set the time zone, and then click “Next >”.
  9. On the “Run Once” section, enter any commands you would like to run when the machine boots for the first time. When done press “Next >”.
  10. On the Network screen, select “Custom Settings” and then click “Next >”.
  11. Press the button next to the first nic labeled “…”. Select the option “Prompt the user for an address when the specification is used”. Enter all IP information except for the IP address and then click “OK”. Click “Next >”.
  12. On the Workgroup section, leave the defaults and click “Next >”.
  13. Check the box titled “Generate New Security ID (SID). Click “Next >”.
  14. Click Finish.
Now that we have a customization settings file that we can apply to templates we can start to deploy VMs from our newly created template. Let’s deploy a new VM. Follow these steps:
  1. Change back to “VMs and Templates” view, and then right click on your newly created template and select “Deploy Virtual Machine this Template…”
  2. Give the new VM a name, and select where to store it. Click “Next >”.
  3. Select the Host or Cluster where this VM will run on, and then click “Next >”.
  4. Select the Datastore where this VM will be stored, and then click “Next >”.
  5. Select the Disk format for this new VM and then click “Next >”.
  6. Click the radio button titled “Customize using an existing customization specification” and then choose the newly created specification that we just made. Click “Next >”.
  7. Assign this new VM a NetBIOS name, and give it an IP address that matches the subnet/gateway that we created in the specification. Click “Next >”.
  8. Click “Finish”.
Now when this VM is booted for the first time, it will get to the “Control + Alt + Delete” screen. DO NOT do anything, just wait. VMware will take care of syspreping this machine, generating a new SID, and applying the settings you’ve just chosen. Once the VM as rebooted you THEN can log in and use it.