Freigeben über


SCVMM R2 Deployments with customization under the hood

SCVMM R2 Deployments with customization under the hood

SCVMM streamlines and simplifies operating systems deployments by way of templates with customization.  This technology creates a sysprep.inf or unattend.xml on the fly based on operating system associated with the template.  This is very powerful as the System Administrator does not need to be a deployment expert with the WAIK or other tools to easily deploy Windows in an automated fashion.   

In a basic scenario, I attach a Windows DVD to a VM and perform a clean build in a workgroup.  In a more advanced scenario I may leverage (MDT) Microsoft Deployment Toolkit to provide quality control leveraging task sequences for applications and customizations.  You can now Sysprep, shutdown VM, export in Hyper-V and copy VHD to SCVMM library share.  You must manually refresh the library share from SCVMM Administrator Console or wait for standard refresh interval.  Based on the VHD you just stored, created a template with customization and input appropriate fields such as product key or organization name.

[Creating the template from VHD]

Now we are ready for a deployment.  SCVMM will copy VHD over the network via BITS network service to Hyper-V host; attach virtual floppy disk containing a dynamically generated answer file.  The setup engine of Windows will look for well know locations for answer files.  In this case, since its Windows XP, the sysprep.inf will be found on the virtual floppy and subsequently automating (OOBE) Out of Box Experience.

Collecting a SCVMM trace while deployment job is running will reveal steps taken to complete task.  For brevity, I will show a few of the main subtasks highlighting the overall process.  In this case the trace shows a sysprep.inf as template was based on Windows XP Operating System.

[Trace Exert]

Cmdlet New-VM:

Placement: Final DeploymentPreference for the set: is: BITS

Description Deploy file (using BITS over HTTPS): 0 of 1 files (76.50 MB/3.25 GB) time remaining

Inside GenerateSysPrepFile:

[Sysprep.inf being created]

GenerateSysPrepFile: Adding sysprep entry, Section = UserData, Key = FullName, Value = User

GenerateSysPrepFile: Adding sysprep entry, Section = UserData, Key = OrgName, Value = Microsoft

GenerateSysPrepFile: Adding sysprep entry, Section = UserData, Key = ComputerName, Value = DAVG12345624 in targetFile = C:\ProgramData\Microsoft\Virtual Machine Manager\0febe968-2417-41ac-94dc-2c55e0202582\sysprep.inf

[Copying sysprep.inf to virtual floppy]

Initializing CreateSysprepVfdSubtask to create vfd file C:\ProgramData\Microsoft\Virtual Machine Manager\0febe968-2417-41ac-94dc-2c55e0202582\DAVG12345624.vfd containing customized sysprep.inf

[Deploying virtual floppy to Hyper-V host and attaching to VM]

Initializing DeployVfdFilesSubtask to deploy vfd file C:\ProgramData\Microsoft\Virtual Machine Manager\0febe968-2417-41ac-94dc-2c55e0202582\DAVG12345624.vfd from VMMSERVER.DAVELAB.com to c:\images\DAVG12345624\DAVG12345624.vfd on HYPERVHOST.DAVELAB.com 

Initializing attachSysPrepVfdToVmSubtask to attach floppy image c:\images\DAVG12345624\DAVG12345624.vfd to VM 762968F7-E598-49E7-93F8-F9E7303BB1E7             

As you can see, VMM tracing is a great way to not only troubleshoot problems but also gain more insight on how the product works overall.

Dave Guenthner [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.