Microsoft Lab Manager (MLM) for VMM Administrators – Soup to Nuts 101
Our development team is, as many of you already know, deeply integrated with Visual Studio & Team Foundation Server (TFS) 2010. It shouldn’t shock anyone to hear that we are also taking a deep investment on the new Application Lifecycle Management (ALM) functionality exposed as part of Visual Studio 2010. A couple months back we started working hard at getting Microsoft Test Manager (MTM) and Microsoft Lab Manager (MLM) working for management of our test cases and infrastructures.
Lab Manager is designed to facilitate development teams by offering the following:
- Ability to best utilize physical & virtual resources by all members of the development team
- Facilitates the deployment of “environments” that can be utilized for testing of new or old builds
- Easy Integration with MTM to support automation testing against new builds
- Tight integration with TFS 2010 Reporting
Lab Manager has a great number of pre-requisites which often development teams will not have the built-in skill sets to make use of. For some companies, development teams might utilize resources owned and operated by other parts of the IT organization. This is the purpose of my post today is to focus on the latter where your software development team decides to utilize resources owned and operated by others in IT.
Cluster this, Cluster that….but don’t you Cluster Microsoft Lab Manager
The first thing to share when seeking out the IT staff who owns and runs your Virtual Machine Manager (VMM) infrastructure is to let them know that Microsoft Lab Manager does not support deployments to clusters. This is by design though one that will certainly make most VMM administrators frown upon as everyone knows that VMM certainly supports it, though MLM does not.
VMM Admins: What are you going to need to get Lab Manager working?
The first question, I anticipate, asked by many who run VMM for organizations and have testers and developers asking for access is – what type of access?
The first thing to note is that Microsoft Lab Manager does not require each “user” of there application to have administrator rights to your VMM server. All work is performed by the
VMM Administrator Checklist 101 for Microsoft Lab Manager
There are a few steps that the VMM administrator (or a delegated individual) will need to take to setup the development team for success. In this section, I will do my best to summarize the steps required for a VMM administrator to get everything ready for integration with TFS.
|Install VMM Console on TFS 2010 Application Tier||In order for TFS web services to communicate with VMM, the VMM Administrator console is required. The web services interface with the PowerShell command-lets that are available in the VMM PowerShell provider.|
|Create VMM Host Group with physical hosts to be utilized by Lab Manager||All “deployments” in Lab Manager occur against a host group. For many VMM administrators, they will have multiple host groups containing individual physical hosts. Access is granted in Lab Manager to a set of physical hosts through authorizing them to deploy to a host group.|
|Create VMM Library Server||Lab Manager can utilize any library, though, one should expect that high utilization is going to greatly increase the number of “objects” stored in the library. Where possible, I highly recommend you create a dedicated library for use by Lab Manager.|
|Create VMM Templates to be used by Lab Manager users||Lab Manager depends on VMM Templates for creation of new virtual machines. These templates need to already exist for Lab Manager users to base their new templates on.|
|Grant VMM Administrator rights to the TFS Service Account||This is the account that is running the TFS services, and as such, should be a dedicated service account. Unfortunately, VMM administrators have to trust the owners of this account because this account is what is used when creating objects on behalf of other users (e.g. Dev, Test, etc.)|
In the following sections, I will go a bit deeper into each of these steps to hopefully give context around the checklist item. For now, though, you can simply trust that if you do the above that Lab Manager will be successful when setup in the TFS Administration console.
Host Groups: Lab Managers Physical Hosts Access Point
Unless you are a very small IT environment, very seldom do VMM administrators use the default Host Group that is shipped as part of VMM 2008/R2. The host group, All Hosts, represents the top of the virtualization tree and typically doesn’t have any physical hosts. Instead, administrators often will “group” virtualization physical hosts into something called host groups which are a way of putting “like” resources together and managing them as a unit. Hosts groups offer VMM administrators the ability to do the following:
- Set the hosts to allow Unencrypted Transfers
- Set performance characteristics on the physical hosts (resource constraining)
- Manage behaviors associated with Performance & Resource Optimization (PRO)
In the image below, I want to show you how one VMM Administrator might build their host groups when running production level resources along with TFS Lab Manager resources. In the case above, we have physical host groups which include production clusters, non-production clusters, and lastly the resources dedicated to TFS Lab Manager Hosts. For today’s post, I’m focusing on the latter which is TFS Lab Manager Hosts. To create a host group in VMM, you do the following -
- Right-click on All Hosts (or the parent folder of the host group you would like TFS hosts to live), select New Host Group
- Provide a new Host Group Name
- To select the physical hosts to put into that host group, highlight the physical host, right-click, and select Move Host Group (not available when on a clustered resource)
- Select the host group to move the host to (in this case, TFS Lab Manager Hosts)
How Lab Manager utilizes VMM Library Assets?
There are a couple of steps involved in the library assets as mentioned above. I hope to clarify those below and make it make sense to a VMM administrator.
VMM “Master” Templates – Source of all Virtual Machines
The first thing that a user of Lab Manager will need to do on a per-project basis is to import templates that have already been created by the VMM Administrator. This is a key step that enables the dynamic creation of machines that serve as a “Complete” set of resources needed to test a Web application. What do I mean by a complete set of resources?
By today’s standards, not many applications are necessarily built on a single machine. They often include front-end application tier servers along with Web services and Data services residing on other servers. All these servers make up a single, “complete” set of resources needed to test new builds.
In the above example, we have two machines that serve as an “environment” – ConfigMgr Server & Database Server. This deployment would deploy two servers and configure them to communicate with each other so that we can do testing of our application(s).
The first step is to create master templates that will serve as the basis for your machines. These templates include both hardware and Operating System configurations and should be available on the library server serving the TFS Lab Host group.
For information on creating these master templates, see my blog post around creation of Library objects.
Lab Manager: Importing Master Templates to Project
The next step is to “import” the master templates to the project which needs to use them. After importing, you can create any number of machines from these templates and these result in a unique “new” template in VMM. This is another reason for ensuring that the library is one that is separate from other libraries as this will seriously litter your VMM library with ugly templates. (see below)
To import in Lab Manager, do the following:
- Open Microsoft Test Manager 2010
- Click Lab Manager
- In Lab Center, click Virtual Machines & Templates
- Click Import
- Under Path, click Browse the VMM Library and locate the template for importing and provide machine details
- Click Next
- Then Finish
The nice thing is the Default role, you can give it a friendly name through type rather than choosing on of the default role types.
Configuring TFS 2010: Enable Lab Management
After the work has been done on the VMM side, there are a couple of things that need to be done on the TFS side. Those are listed below.
First, install the VMM Administrator’s Console on the TFS Application Tier server. To do this, simply use the VMM setup.exe.
Second, you need to enable Lab Management. To do this, do the following:
- Open the TFS Administration Console
- Open Application Tier
- Click Lab Management
- Click Configure Lab Management
- Enter the Fully Qualified Domain Name (FQDN) and click Test
- Click Network Isolation Tab, enter a non-routable IP Address block to use for isolation
- Select the FQDN for lab manager to use
- Click OK
Third, and most importantly, enable Lab Manager for the TFS collection(s). To do this, you will do the following:
- In TFS Administration Console, click Team Project Collections
- Highlight the Collection
- Click Lab Management tab
- Click Configure Library Shares
- Configure Host Shares
- Configure Service Account
That’s it. You should be working. If not, there are multiple documents that walk you through in much more detail listed below -
- How To: Set up and Configure Virtual Machine Manager
- How To: Configure or ReConfigure Lab Management in TFS Application Tier
In today’s post, I focused a bit on hopefully bridging the gap for those VMM administrators who will get attacked by software engineering organizations asking for resources from your VMM pool. I don’t expect many VMM administrators to be overly familiar with MTM & MLM so I hoped to create a “cliff notes” for those Admins by sharing what they will need to do to support MLM as well as what to expect when using MLM integrated into VMM. If succeeded, then you have carved off a set of physical hosts in the form of host groups that are used by MLM and also built library resources for them to utilize.