See all of the top support solutions for our most common issues here
~ Ashish Kumar | Technical Lead
Hello all, my name is Ashish and I am Technical Lead with the Configuration Manager support team. System Center 2012 R2 Configuration Manager (ConfigMgr 2012 R2) is scheduled to be released soon and there’s a cool new feature you’ll want to be aware of. This new feature allows us to deploy an operating system and create a Virtual Hard Disk (VHD) at the same time, meaning that we can now deploy an operating system directly to a VHD that can be given to the VMM admins for further use.
Say for example that you have a Virtual Machine Manager administrator who has a project where he needs multiple VMs for production use. The standard procedure would be to manually create a VM, install the OS, install all of the required applications on that VM, and then use that VM on all of the other production machines. Now this all can be achieved by ConfigMgr 2012 R2 using a new Task Sequence (TS) that will do all of this for you in a single process. Here are the steps ConfigMgr 2012 R2 uses to create this new Virtual Hard Drive:
1) Configuration Manager creates a Task Sequence media.
2) Configuration Manager creates a Virtual Hard Disk.
3) Configuration Manager creates a temporary virtual machine (VM) on the Hyper-V Server.
4) Configuration Manager allocates the resources to the created temporary VM.
5) Configuration Manager mounts the Task Sequence media to the VM.
6) Configuration Manager attaches the VHD to the VM.
7) Configuration Manager executes the Task Sequence.
8) Once the Task Sequence completes, the temporary VM is stopped and the VHD is copied to a share location.
NOTE: While the steps above will create our VHD, there is an additional prerequisite that is required. In addition to the standard prerequisites for VMM (see http://technet.microsoft.com/en-us/library/gg610592.aspx), we also need a server with Hyper-V running on it, and this server needs to have the ConfigMgr 2012 R2 console installed.
Here is an example of how we can deploy an operating system to a Virtual Hard Drive using ConfigMgr 2012 R2:
First we select our new type of Task Sequence that allows us to install an existing Windows image package to a Virtual Hard Drive:
The rest of the Task Sequence is essentially the same as a regular Task Sequence, however there is an extra step that is added as part of this new Task Sequence: The “Shutdown computer” step.
This is an important part of the TS as this step allows the VM to shut down and then pass control to Configuration Manager to copy the VHD package. Once we have created the Task Sequence to deploy an OS to a Virtual Hard Disk, we will create the Virtual Hard Disk itself. To create this, we now have an additional node in Operating Systems for “Virtual Hard Disks”.
Note that if the Configuration Manager server is not a Hyper-V host we will not get the option to create a Virtual Hard Disk as Configuration Manager needs to interact with the hypervisor to create the virtual machine, perform all the steps in the TS, and then delete the VM. In this process, the Configuration Manager console interacts with Hyper-V which is why we require a dedicated Hyper-V server with the ConfigMgr 2012 R2 console.
Below is a screen shot from my Hyper-V server that has the ConfigMgr 2012 R2 console installed.
In the Create Virtual Hard Drive wizard, we specify the general description of the Virtual Hard Disk and a share location to store the VHD file created during the process.
The next step allows you to select the Task Sequence for deployment. Make sure to select the Task Sequence we created for the Virtual Hard Disk. You will see the option to select other kinds of Task Sequences but those will fail.
Once we select our Task Sequence we have a preview of all the packages in the TS.
After this step we get to see the introduction of another new feature in ConfigMgr 2012 R2, a preview of the packages which are required in a TS and their distribution status on the Distribution Point (DP).
We can clearly see in the above screen shot that there are 3 packages required in my TS and out of them 2 are not on the DP. This is a hard block now and we will not be able to proceed until we distribute all of the required packages to the DP.
After distributing the packages, we also get the option to choose which DP will be used to download these packages. This has an added bonus of allowing us to isolate DP related issues and package related issues we may run into after running the Task Sequence.
Here is a preview showing the available Distribution Points and the package distribution status.
We also have a preview that shows the DP selected to be used by the Task Sequence to download the required packages.
Once we initiate this wizard, the Operating System Deployment to the Virtual Hard Drive begins.
This wizard can be monitored by a log file named DeplottoVHD.log. This log is found in the AdminUILOG folder in the Admin console installation Directory.
As seen here, the wizard’s first step is to create a Task Sequence media. This creation of the media can be seen in DeploytoVHD.log which is monitored by the CreateTSMedia component and logged in the AdminUILog folder.
This is the same process that is logged when we create a normal Task Sequence media except for the fact that in this case TS media is created by Configuration Manager and mounted to the temporary VM.
Once the TS Media is created, the Deploy to VHD component comes into the picture. This creates a temporary VM, allocates the necessary resources to the machine, mounts the TS media and starts the execution.
The CreateTSMedia.log snippet above shows that the process of Task Sequence media creation has completed.
Above in our DeploytoVHYD.log we can see Configuration Manager creating a virtual machine, allocating the resources, mounting the TS media, attaching the VHD and starting the VM.
This log will pause here for some time and wait for the Task Sequence to complete the deployment.
We can see above how a temporary virtual machine is created on the Hyper-V server.
Once the Task Sequence completes on the virtual machine, the machine will be shut down and the VHD created as part of the TS will be copied to the shared location specified in the Create Virtual Hard Disk wizard.
The snippet above of the DeploytoVHD.log shows that after waiting for the VM to shut down, the VHD was copied to the shared location.
Once the Wizard is complete we can see our VHD in the create VHD node with the description we entered previously.
We might now be thinking of what can we do with this VHD and the answer lies on the same Create VHD node. As we all know, Virtual Machine Manager is part of the System Center suite which includes Configuration Manager, and now with ConfigMgr 2012 R2 we can upload this VHD created by Configuration Manager to your Virtual Machine Manager server directly.
Now your VHD is ready to be used by your VMM 2012 administrators.
NOTE: For additional information, see How to Manage Virtual Hard Disks in Configuration Manager at http://technet.microsoft.com/en-us/library/dn448591.aspx.
Ashish Kumar | Technical Lead
Get the latest System Center news on Facebook and Twitter:
System Center All Up: http://blogs.technet.com/b/systemcenter/ System Center – Configuration Manager Support Team blog: http://blogs.technet.com/configurationmgr/ System Center – Data Protection Manager Team blog: http://blogs.technet.com/dpm/ System Center – Orchestrator Support Team blog: http://blogs.technet.com/b/orchestrator/ System Center – Operations Manager Team blog: http://blogs.technet.com/momteam/ System Center – Service Manager Team blog: http://blogs.technet.com/b/servicemanager System Center – Virtual Machine Manager Team blog: http://blogs.technet.com/scvmm
Windows Intune: http://blogs.technet.com/b/windowsintune/ WSUS Support Team blog: http://blogs.technet.com/sus/ The AD RMS blog: http://blogs.technet.com/b/rmssupp/
The Forefront Endpoint Protection blog : http://blogs.technet.com/b/clientsecurity/ The Forefront Identity Manager blog : http://blogs.msdn.com/b/ms-identity-support/ The Forefront TMG blog: http://blogs.technet.com/b/isablog/ The Forefront UAG blog: http://blogs.technet.com/b/edgeaccessblog/
Awsome Ashish, very good artcile. exactly what i was looking for..
This is great stuff, thank you
Hello, how do you include steps in the TS to properly Sysprep the VHD? I am doing a prepare client for capture and a step to sysprep the deployment but the TS does not exit clean. There are traces of the C:\_SMSTaskSequence folder + a single TSEnv.dat file post deployment and the logs claim that the folder cannot be deleted even though the TS steps for cleanup and sysprep exits clean with error code 0. Any ideas?
usually the Sysprep is run by ConfigMgr automatically when you are using above mentioned option but if its not then you have to dig into the logs.