Provisioning Farm Members from Virtual Server Templates

VMM allows SharePoint administrators to define a library of templates and VMs that can be used to provision new SharePoint sessions. For example, a Windows Server 2008 R2 server template could be created with the right amount of memory and virtual processors, plus a pair of virtual hard drives for the OS and index files. With SharePoint 2010 binaries installed on that system, it can then be turned into a template that can be used to provision new SharePoint farm members or even entirely new farms.

VMM Template Options, shown in Figure 12.6, allow administrators to have the server created from the template automatically added to a domain, be automatically validated with a valid server key, and also to have a script run after first login. For example, a custom PowerShell script could be run automatically after login that joins the SharePoint template server to an existing farm or creates a new farm from scratch.

Figure 12.6. Creating a VM template.

image

Using this concept, an organization could easily set up a scenario where developers are given the rights, through the self-service portal, to provision a new SharePoint guest session. After provisioning the server, they could then log in to that session and have it automatically run a PowerShell script that would create a new farm. With the proper hardware, developers could provision an entirely new SharePoint environment within 10 to 15 minutes and have that farm completely independent from other farms.

For this scenario to work, the SQL server used must be on a different system, because SQL doesn’t lend well to name changes after it has been installed. In this scenario, a single SQL instance can hold the databases from multiple farms. Commonly, a single SQL guest session would be used for all development farms created in this manner.

A sample farm provisioning script (ProvisionFarm.ps1) is provided here as an example of the type of script that can be configured to run automatically upon login to the virtual session provisioned:

image

image

image

The high-level steps involved in running this scenario are as follows:

  1. Create a new Windows Server 2008 R2 guest session in VMM with at least 10GB of RAM and four virtual CPUs allocated to it. (Remember that SharePoint 2010 has large resource requirements.) Give the session two virtual hard drives: one for the OS and another for the index.
  2. Install the SharePoint 2010 binaries on the guest session but don’t run the Config Wizard. Copy the Provisioning Farm PowerShell script into a directory on the server, such as C:Scripts. See step 3 for the syntax of the script name.
  3. Using VMM, turn the guest session into a server template. Specify within the server template to automatically add the machine into a domain and to run powershell.exe –noexit C:scriptsProvisionFarm.ps1, as shown in Figure 12.6.
  4. Use the self-service portal to provision a new server based off of the template. After the session has been created and added to the domain, log in to the system and walk through the farm provisioning script. Because the SharePoint 2010 binaries will already be installed, the script will be able to provision a new farm or to add the server into an existing farm.

Within approximately 15 minutes, a new SharePoint farm can be provisioned with running web applications and services. Using this approach, modifications can also be made to the PowerShell script to expand the functionality of the script, such as by adding the ability to provision service applications. In addition, it can be made to run completely without user input, providing for a 100-percent automated farm provisioning solution.

This same process can be used with other virtualization management software, such as the third-party VMware VirtualCenter. The concepts still apply: Just install the SharePoint 2010 binaries, and then create a server template. Using a provisioning script, you can then automatically create a new virtual farm or add additional members to it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset