VMware templates with Windows and ESX server without VMware Infrastructure

This a guide on creating templates for Windows Server virtual machines for ESX server when you don't have the advantage of being able to use the template function built into VMware Infrastructure.

Why?

Templates are great for rapid deployment of new servers, setting a new server up from scratch each time wastes precious System Administrator time and everyone likes an easier way to do it.

The Process

This method involves using a VMware tool called VMware Converter. VMware Converter has many uses, the one we are going to be using today is the ability to move virtual machines between ESX hosts and to move then around on the same host!

Procedure

Firstly you need to create your base VM-Image, build you image up to whatever the basic configuration that you will need for your hosts. This option is called the Build To Order method (BTO). With the build to order method you will normally add in your standard array of software, run windows update, install anti-virus and install any Host Monitoring software like Nagios

  1. Prepare your system for re-imaging, if you are going to be joining these machines to a domain you need to prepare then with Sysprep to regenerate the security id (SID) and then shut the VM down.

  2. On a separate system load up VMware Converter, ideally this system should be located on the host ESX server to offer the maximum speed when doing the conversion as all the data from the VM Images will be going into this system and then being sent back to the ESX Served.

    1. Open VMware Converter and click "Convert Machine" button.
      1. Select the source type VMware Infrastructure Virtual Machine.
      2. Enter the credentials to a "Root" User on your ESX System.
      3. Select the VM that you want to "Move or Convert"
      4. When the "Source Data" section appears click "Select Volumes to save or add space"
      5. Resize the VM disks as you required and click next (leave the "ignore pagefile and hiberfile as default")
      6. Select destination type VMware Infrastructure Virtual Machine.
      7. Enter the credentials to a "Root" User on your ESX System.
      8. Enter a *NEW* Virtual machine name.
      9. Select the right resource pool (if you have them configured)
      10. Select the data store.
      11. Set the number of virtual NIC's the system is meant to have.
      12. Customize the virtual machine if you need to (change windows CD-Keys, Install VMware Tools ect)
      13. Click finish and let it convert, the conversion time will change depending on how much data you need to move.
      14. Open the VI Console to your ESX Server once the conversion has taken place, Check that it boots and that all the data is there
  3. If you ran Sysprep on the machine before imaging it will now run and request CD Keys
  4. The conversion is now done, you can image these off your master BTO Template, remember to keep your template updated and current.

Another Method

This is just one method of the other methods that you can use to copy and move your VM's around on your ESX host and obtain some form of template's for rapid setup. However these methods involve manually moving files around on the ESX system and if you are not totally familiar with ESX's inner workings, stick the the above method.

Vmkfstools

With Vmkfstools yon copy VM's around on the system a example of this command is

Vmkfstools –I /locationoftemplate/template.vmdk /destination/newservername.vmdk

This will only copy the VMware Virtual HDD (VHD) you will then need to go into the VMware GUI and add a new "custom" VM and utilise the new VHD as an existing virtual disk, the process is below.

  1. Open VI Client GUI
    1. Virtual machine configuration is "Custom"
    2. Name your VM.
    3. Select a Resource pool where to place the server.
    4. Select your data store where you keep VM Images.
    5. Select your operating system and architecture.
    6. Select the amount of virtual processors, only give it as much as it needs to avoid overheads.
    7. Select how much ram to allocate to the system.
    8. Select the amount and type of network adapters.
    9. Set the SCSI Controller type, LSI Logic is the most common.
    10. In the Disk section select "Use and existing virtual disk"
    11. Locate where you copied your Template to.
    12. Set the SCSI Node.
  2. Completion - Please start the new VM!

If you are brave, there is further explanation on how to do this and also how to setup scripts to do this for you located on Tech Target.

Summary

Templating is a great time saver for system administrators. If you follow the steps above you will be a long way to getting your provisioning time down and your productivity up. As we all know automation is the system administrators friend!


See also:

References/External Links

Other pages in similar categories