Hyper-V provisioning without any additional tools

Posted: (EET/GMT+2)

 

In my work, I often have the need to set up fresh, new virtual machines for testing. For example just this week, I needed to set up a collection of three virtual machines: one Active Directory server, one application server with IIS, and one client computer running Windows 7.

There are many ways to automate provisioning of Hyper-V virtual machines, but these solutions usually come with a cost. However, what if you have no other tools than what come with Windows Server 2008 R2?

If this is your case, then you could work as follows. If you need only basic operating system(s) installed without no additional tools, then my suggestion is to first manually install a set of virtual machines, and then take their .vhd files into a safe place (it is a good idea to zip the files). Then, whenever you need a new virtual machine, simply unzip the needed operating system .vhd, set up the virtual machine config, and choose to use the existing .vhd file. You are good to go!

On the other hand, if you have the need for operating systems with specific applications installed, consider using Windows' available tools for operating system image distribution. This way, you can first create a ready-made OS image with all the tools your need (such as Visual Studio and SQL Server already installed), and when you set up a new virtual machine, simply let it boot from the network.

The OS installation starts after the PXE boot succeeds, and within a couple of minutes, you will have a brand new virtual machine up and running, with all the software installed. And what's great about this kind of solutions is that you can still script certain things, such as automatically joining a domain.

Also remember that nothing will stop you from using a combination of these two techniques. I'm presently working on an article (well, in Finnish at least) about Windows installation automation tools for the Tietokone magainze. Stay tuned for the article announcement.