I am currently provisioning a lot of Virtual Machines in VMWare vSphere 4.1. Because I had already sized the Virtual Machines I am doing this from PowerCLI based on my Excel Sheet.

I will probably blog later about the details of how I am doing this in PowerCLI (would you be interested in that?) but after successfully deploying some Windows 2008 VM’s I got this error in PowerShell:

New-VM : 3-11-2010 10:00:50 New-VM The operation for the entity VirtualMachine-vm-150 failed with the following message: “Cannot complete customization.”

At C:\Users\Administrator\Documents\NewVm.ps1:64 char:14

+ $VM = New-VM <<<< -Name $Name -VMHost $VMHost -Template $Template -OSCustomizationSpec $Spec -DiskStorageFormat $DiskFormat -Datastore $LargestDataStore

+ CategoryInfo : NotSpecified: (:) [New-VM], CustomizationFault

+ FullyQualifiedErrorId : Client20_TaskServiceImpl_CheckServerSideTaskUpdates_OperationFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM

In the vCenter console the following error was logged:

Cannot deploy template: Cannot complete customization.

I decided to try a Deployment from the vCenter GUI so I would get some more detailed error information and indeed the error was more meaningfull:

Windows customization resources were not found on the server

So this meant there was probably something wrong with the SysPrep files which are located under “%ALLUSERSPROFILE%\VMware\VMware VirtualCenter\sysprep\<OS VERSION>”.

I decided to replace the sysprep version that I downloaded from Microsoft with the one from the OS Install Media (SUPPORT\TOOLS\Deploy.cab). You can do this by simply extracting the files from the Deploy.cab and placing them in the proper subdir (in this case svr2003).

After that I could Deploy successfully.

BTW: This kb article from VMWare is also helpfull.