SharePoint Sysprep

Hello,

With the wide use of virtualization platforms to run Microsoft Servers’ workloads, for the last few years, we faced a lot of questions regarding templates for SharePoint (Virtual Machines and Services Templates – in SC VMM, Base/Managed Templates, Cloning, etc.). The aim is super simple: Create once a Virtual Machine that can become a VM template. Then use it as the base to create multiple Virtual Machines.

The best (and supported way) to do this with Windows technologies is to use the SYSPREP tool. This tool stands for System Preparation tool (more info here: https://technet.microsoft.com/en-us/library/cc721940(v=ws.10).aspx ). When launched it does few actions that will prepare the server for duplication like:

  • Removes system-specific data from Windows like the server name, the network settings (IP and MAC addresses)
  • Rearming the license and activation data
  • Remove the SID and domain related data
  • Etc. (this list is not exhaustive)

 

For SharePoint (2010 & 2013, all editions), there are components that will “survive” a “sysprep” and others that won’t:

  • The SharePoint components that will survive a Sysprep are:
    • The Prerequisites
    • The SharePoint binaries (setup.exe)
    • The Language Packs (setup.exe)
    • Service Packs (setup.exe or msi or Slipstream setup)
    • Cumulative Updates
  • The SharePoint components THAT WON’T SURVIVE a SYSPREP and give an unsupported server are:
    • Every tasks related to the configuration wizard, Central Administration and farm settings
    • Said differently, one SharePoint server joined/member of a SharePoint farm cannot be used to create a VM template

From this, how to create a supported SharePoint VM template?

  1. Setup a VM with Windows Server and all the settings/policies in place in your environment (disks, NICs, event logging, agents, antivirus, etc.). Careful here, you can only sysprep 2 times a Windows server. If you use a Windows Server template as a starting point, then you can only use once more sysprep on this Server (for SharePoint in our case)
  2. Install the SharePoint Prerequisites (with either the installer or the command line)
  3. Install SharePoint (i.e. run the Setup.exe, enter the License key, choose Server Farm option – DO NOT choose standalone)
  4. Install the Language Packs you need (if any)
  5. Install the latest Service Packs and Cumulative Updates you want (ideally slipstream the install media and the unattended answer file)
  6. Once all is done, and no SharePoint Configuration wizard or “psconfig” did run, create the VM template from this VM:
    1. Either launch the UI with "Sysprep" / Enter the command " %WINDIR%\system32\sysprep /oobe /shutdown /generalize"
    2. Or use your virtualization management server to create the template – like in SC VMM
  7. Then either use directly a copy of the resulting Virtual Disk or the VM template stored in the virtualization management library, to create multiple/new SharePoint VMs servers
  8. Once these servers are created, you can create or join them to a SharePoint farm

Hope this will help a lot of you.

<Emmanuel/>

 P.S.: The maintenance of the template is whole topic in itself, I won't cover here.

References: