Building Deployment Images the Smart Way
One of the keys to making large scale Hyper-V based virtual datacenters practical is the ability to rapidly provision and deploy new virtual machines. Typically this means creating a set of deployment images on which future virtual machines will be based.
Brien M. Posey
If you do an Internet search on the phrase “Windows image creation” or something similar, you will likely find numerous articles discussing the procedure for manually setting up a reference computer and running Sysprep against it. You can then use various techniques to capture the sysprepped image.
Perhaps the biggest drawback to using this technique is that system images tend to evolve over time. Busy admins don’t have time to manually create a new reference image every time that a change needs to be made. A better approach is to automate the creation of reference images by using Microsoft’s Deployment Workbench. That way if a change needs to be made, you can simply modify an entry in a task sequence rather than having to manually rebuild a reference machine.
In order to use the techniques described in this article you will need to download and install the Microsoft Deployment Toolkit and the Microsoft Windows Automated Installation Kit. These tools can be installed on a variety of operating systems, but the image deployment process, which I will be discussing in an upcoming article, will be easier if you install these tools onto Windows Server 2008 or 2008 R2.
Creating a Deployment Share
With that said, the first step in the process is to create a deployment share. To do so, open the Deployment Workbench that is a part of the Microsoft Deployment Toolkit, right-click on the Deployment Share container and choose the New Deployment Share command from the shortcut menu. When you do, Windows will launch the New Deployment Share Wizard.
When the wizard starts you will be asked to enter a path for the deployment share. You can use the defaults, but it’s better to store the deployment share on another volume if possible.
The next screen asks you to provide a share name. The defaults usually work fine. You can also accept the defaults for the remainder of the questions that the wizard asks.
Adding an Operating System
The next step in the process is to import all of the installation files for the operating system that you want to image. To do so, expand the deployment share and then right-click on the Operating System folder and choose the Import Operating System command from the shortcut menu. Windows will now launch the Import Operating System Wizard.
On the wizard’s initial screen, choose to import a full set of source files. You will now be prompted to provide the path to the installation media that you want to base the image on. After providing this path, just accept the defaults for the rest of the wizard’s prompts.
Adding Device Drivers
Since you are creating images which will be used to generate virtual machines, you probably won’t end up needing any extra device drivers. However, if you plan to use the images to create physical and virtual machines then you can include any necessary drivers in your deployment images. To do so, right-click on the Out-of-Box Drivers folder and choose the Import Drivers command from the shortcut menu. When you do, you will be prompted to enter a path for the driver source directory. You don’t have to specify each driver directory individually. Just enter the path to a top-level driver folder and the wizard will automatically pick up on all of the individual driver folders beneath the specified location.
Building a Task Sequence
Now that the operating system files and the device drivers are in place, the next step in the process is to create a task sequence. A task sequence is designed to guide the deployment process, but it can actually do much more. You can design a task sequence to install things like additional Windows components or even applications.
To create a task sequence, right click on the Task Sequences container and choose the New Task Sequence command from the shortcut menu. When you do, Windows will launch the New Task Sequence Wizard. The wizard’s initial screen requires you to provide a name, a unique identifier, and an optional description for the task sequence that you are creating.
The next screen asks you what type of task sequence you want to use. Even though there is a Sysprep and Capture option, it is better to choose either the Standard Client Task Sequence or the Standard Server Task Sequence.
The following screen will ask you to choose an operating system. You can make your selection from any operating system files that you have added to your deployment share. The wizard’s remaining screens are self-explanatory. They allow you to provide details such as a product key and an administrative password.
Customizing the Task Sequence
After you have created a task sequence you have the option of customizing it. To do so, select the Task Sequences folder, right-click on the task sequence that you have just created, and then choose the Properties command from the shortcut menu. When you do, you will see the properties sheet for the task sequence.
As you prepare to customize the task sequence, keep in mind that the task sequence is designed to generate a reference image. Therefore if you want to create multiple reference images then you will need to create multiple task sequences.
Space limitations prevent me from discussing task sequence customizations in depth, but one of the most useful options is the Install Applications option. If you look at Figure 1, you will notice that the console tree has an Applications container. You can add applications to the Deployment Workbench in a manner similar to that used for installing the operating system files or the device drivers. After doing so, you can use the Windows 7 Ultimate Properties dialog box to add the application to the task sequence as shown in the figure.
Figure 1 Adding applications to the Deployment Workbench
Updating the Deployment Share
Once you have finalized your task sequence (or sequences), you need to update your deployment share. Doing so creates the .WIM file that will be used to install Windows to your reference computer. You can update your deployment share by right clicking on it and choosing the Update Deployment Share command from the shortcut menu. When you do, Windows will ask you how you want to handle the boot image updating process. Choose the option to optimize the process, and then use the default options throughout the remainder of the wizard.
If you need to install any extra roles or features you can do so within the task sequence. Click on the Add button and choose the Roles | Install Roles and Features option. You will then be presented with a list of roles and features that you can install, as shown in Figure 2.
Figure 2 Install Roles and Features
In this article, I have shown you how to create a task sequence that can be used to generate a reference image. In my next article, I will show you how to deploy the reference image, and then use it to create a generalized image that can then be used to deploy Windows to your virtual machines.