Tuesday, 25 January 2011

Deploying Native Boot VHDs [2]

My first test was to set up the target computer with its hard disk and boot environment and copy the VHD directly from the VM to the target and then boot. This was successful; the main issues being the missing Sysprep and driver injection stages. Since then, thinking about it overnight, I have decided I will have to learn how to use WSIM, Windows 7 Sysprep and DISM, all of which MDT nicely isolates you from. This is because MDT doesn’t have a deployment scenario for the situation we are using. Using the three tools mentioned above is what MDT encapsulates, but in a different way. The normal basic steps of deployment which I learned with Vista are:

  1. Make a Unattend file using WSIM
  2. Sysprep your reference system passing it the Unattend file
  3. Image it by using ImageX to perform the capture.

And now, with VHDs, we can replace the third step with DISM to inject the drivers. Then we copy the VHD for deployment. Deploy it to the target platform and when that platform is booted it will automatically set itself up with the Unattended settings. The advantage of this overall is that we don’t need to have a separate imaging stage to copy what is on the VHD into a wim file, and we don’t have to have a separate stage of loading the image onto the target platform. All we have to do is simple copying of the VHD file to the target platform, so it saves a lot of time. In my test run yesterday it took about seven minutes to copy a 13 GB VHD off an external hard disk to the computer. Basically this is what MDT leverages, but in a different way. MDT splits up the setup passes so that some of them happen at the time of doing Sysprep and Capture, and some of them happen at the time of applying the Deployment task sequence. But if you do it so that you specified your unattend file and everything before you deploy the VHD, then it all gets done automatically when the VHD is booted up for the first time.

Let’s have a look in depth then at the old system like Ghost of copying a whole hard disk and that being the image of the machine. The main advantage of this is that it is very easy to set up and deploy. However since you still need to Sysprep before capture, you will still need to learn how to use the WSIM and Sysprep tools. Therefore you haven’t saved much. The main issue is that once you have captured with Ghost into its own format, servicing those images becomes the issue. The usual story is to deploy to a reference platform, service, sysprep, capture, and you have to have a reference platform to do it. The other big Ghost limitation is that it is tied to a single HAL and that means images are locked to that platform pretty much.

On the other hand we will be starting with a VHD that is attached to a VM. We build and maintain it on that VM. We then take a simple copy of that VHD, run Sysprep over it with our unattend.xml file that we have already built. We then use DISM to inject the drivers to it. It is then ready to deploy. We can still service the VHD offline at that point before it’s deployed, no matter how much is needed to it. Or we can go back to our VHD attached to the VM and service it live there then do the Sysprep and DISM stages again. At no stage is it necessary to recapture and at no stage is it necessary to deploy the captured image by special software. It is just a matter of copying the VHD to the target platform. This is an advantage even over WIMs which is why the native boot VHD capability is such an underrated feature of Windows 7.