Share via


Configuring Lab Management for the First Time

To use Visual Studio Lab Management to manage a set of virtual machines as virtual environments, you must first configure Lab Management. Each environment consists of one or many virtual machines for each role required for your application. You can then use Lab Management to deploy your application to these environments and run tests. For more information about Lab Management, see Using a Virtual Lab for Your Application Lifecycle.

The following illustration shows the steps to configure Hyper-V, SCVMM, and Lab Management to work together to let you create these environments. This illustration shows a simple setup and which step applies to each computer.

Configure Lab Management

You also can have a more complex setup with separate machines for SCVMM, Hyper-V, your library server, and Team Foundation Server. 

Note

Any computers that you use as Library Servers (including the SCVMM machine that has a default library server) and as Hyper-V hosts should be on a gigabit network that is connected to a common network switch. The faster network speed will help improve performance when you deploy virtual machines to hosts and when you save virtual machines to the library from your host.

Prerequisites

The Team Foundation Server administrator must set up and configure Team Foundation Server before configuring Lab Management. For more information about how to set up and configure Team Foundation Server, see the Team Foundation Server Installation Guide. After the administrator has configured Team Foundation Server and created a default team project collection, make sure that you have the following information:

  • TfsMachine: The name of the machine that is running Team Foundation Server.

  • domain: The Active Directory domain that is used by all machines.

  • tfssvc: The account under which Team Foundation Server is running.

    Note

    If your instance of Team Foundation Server uses more than one machine to run the logical application tier and you will be using the Lab Management feature of Visual Studio 2010, do not use the NetworkService account as the service account for Team Foundation Server. Using the NetworkService account will require more manual work later to maintain the physical host machines for virtual environments because the NetworkService account for each new application-tier machine will have to be added to the local Administrator group on each physical host machine. For example, if you run a lab with 20 physical hosts and add or replace an application-tier machine, you would then need to update each of the 20 host machines with the name of the new application-tier machine and assign permissions. Instead of using the NetworkService account, use a standard domain user account and password for the TFSservice account. That way, the domain user account gets added once at the initial configuration of the physical host and each subsequent application-tier machine uses the same account. For more information about the limitations of the NetworkService account, see NetworkService Account.

  • domain\tfsadmin: The account for the Team Foundation Server administrator.

Note

If you want to use a specific team project collection and not the default team project collection, you must create this first.

System Requirements

The following table summarizes the minimum and recommended hardware and software requirements for the machines used with Lab Management. For the simple setup in the earlier diagram, the HyperVHost machine, the VmmMachine and the LibraryMachine can be the same machine. If you are using a more complex setup, then you can use separate machines for Hyper-V, SCVMM and for your library server that have the system requirements that are defined in the following table.

System

Processor

Supported operating system

RAM

(min/

recommended)

Hard disk (min/ recommended)

HyperVHost

64-bit with hardware virtualization enabled

Windows Server 2008 R2 operating system with Hyper-V 64-bit, Standard, Enterprise, and Datacenter Editions

Windows Server 2008 R2—Server Core installation, Standard, Enterprise, and Datacenter Editions

Windows Server 2008 operating system with Hyper-V 64-bit, Standard, Enterprise, and Datacenter Editions with Service Pack 2

Windows Server 2008—Server Core installation, Standard, Enterprise, and Datacenter Editions with Service Pack 2

Hyper-V Server 2008 R2 operating system

4GB / 8GB

100 GB/ 200GB

VmmMachine

64-bit

Windows Server 2008 R2 operating system 64-bit Standard, Enterprise, and Datacenter Editions

Windows Server 2008 operating system Standard, Enterprise, and Datacenter Editions with Service Pack 2

NoteNote
You cannot install SCVMM on the Hyper-V Server 2008 R2 operating system. Hyper-V Server 2008 is a dedicated, stand-alone product which contains only the Windows Hypervisor, the winsvr08_r2 driver model, and virtualization components. For more information about the Hyper-V Server 2008 R2 operating system, see this Microsoft Web page.

2GB / 4GB

200GB

LibraryMachine

64-bit

Windows Server 2008 R2 operating system 64-bit Standard, Enterprise, and Datacenter Editions

Windows Server 2008 operating system Standard, Enterprise, and Datacenter Editions with Service Pack 2

2GB / 4GB

200GB / 500GB

TfsMachine

32-bit x86

64-bit x64

All operating systems that are supported by Team Foundation Server are supported by Visual Studio Lab Management, except any operating systems that are not joined to a domain.

2 GB / 4GB

120GB / 230GB

ControllersMachine

32-bit x86

64-bit x64

All operating systems that are supported by Team Foundation Server are supported by Visual Studio Lab Management, except any operating systems that are not joined to a domain.

2GB / 4GB

120GB / 230GB

Configuration Procedures

The following table details the procedures that you must follow to complete the configuration for Hyper-V, SCVMM, and Lab Management, and the permissions that are required. For a simple setup, the HyperVHost machine, the VmmMachine and the LibraryMachine can be the same machine.

Note

All the machines that are used for Lab Management must be joined either to the same domain or domains that have two-way trust between them.

Step Number

Procedure

Details

Machine Name In Procedure

Permissions Required

Step Completed

1

Set Up And Configure Hyper-V Hosts

Hyper-V lets you manage virtual machines and their resources.

HyperVHost

Administrator for the HyperVHost

2

Install and configure SCVMM

SCVMM helps you manage your virtual machines and templates, and where and how you store them.

VmmMachine

NoteNote
You can use a separate machine as the LibraryMachine to use for the library share to store the virtual machines.

Administrator for VmmMachine

3

Configure Team Foundation Server to enable Lab Management

You configure TFS to give you access to the virtual machines and templates that you have created.

TfsMachine

Team Foundation Server Administrator

4

Verify the configuration using Microsoft Test Manager

Verify that your can connect to a team project and access the Lab Center by using Microsoft Test Manager.

DesktopClient

Any user account that has been added to the computer

5

Install build controller and test controller

If you want to build and deploy your application by using Team Foundation Build and run tests, you will need build controllers and test controllers.

TfsMachine

NoteNote
It is recommended that you use a separate machine as the ControllersMachine to install the test controller.

Team Project Collection Administrator

Set Up and Configure Hyper-V Hosts

To set up Hyper-V, you can do one of the following:

  • Enable the Hyper-V role on your computer that has Windows Server 2008 installed. If you do not have the Hyper-V role enabled on the HyperVHost computer, you must first enable this by using Server Manager on each of the Hyper-V hosts so that you can create and manage virtual machines using the steps in the following procedure. For more information about Hyper V, see the following Microsoft Web site.

  • Install Hyper-V Server 2008 R2 on your HyperVHost. For information about Hyper-V server and how to install it, see the following Microsoft Web site.

To enable the Hyper-V role on each Hyper-V host with Windows Server 2008

  1. On the Hyper-V host, log on as an administrator.

  2. Click Start, point to Administrative Tools, and then click Server Manager.

  3. In the left pane of Server Manager, right-click Roles and point to Add Roles.

  4. Follow the Add Roles Wizard. You can just click Next in all except the following pages of the wizard:

    1. On the Select Server Roles page, select Hyper-V and then click Next.

    2. On the Create Virtual Networks page, you must select an active network adapter and then click Next.

      Note

      To find which network adapters are active, use the ipconfig command to view which network adapters have IP addresses. In the wizard, select the network adapter that should be used for creating a virtual network. You must select an adapter that is connected to the same network as the other machines in the lab. If there are several adapters, select the adapter to which the virtual machines that were created by Lab Management should be connected.

    3. On the Confirm Installation Selections page, click Install.

    4. On the Installation Results page, click Close.

    5. On the Do you want to restart now dialog box, click Yes.

      The machine will restart and continue with Resume Configuration Wizard.

    6. On the Installation Results page, you will see a message that states Installation succeeded. Click Close.

  5. Install the update described on this Microsoft Web site. This update supports the network isolation capability of virtual environments.

Note

If you are using multiple hosts for Hyper-V that have different versions of Windows Server 2008, you might need this hot fix. Check the details in the following link to determine whether you require this fix: A Hyper-V differencing disk that you create in Windows Server 2008 R2 cannot be used in Windows Server 2008.

Improve the Reliability of WinRM

Windows Remote Management (WinRM) is used by SCVMM to communicate with Hyper-V hosts. You must make the following changes to the default configuration settings for WinRM. The changes to these settings help improve the reliability of WinRM because Lab Management performs a larger number of operations on Hyper-V hosts than are performed in a typical production scenario for Hyper-V. These changes to the WinRM settings must also be performed on any computer that is used for a library share.

To change Windows Remote Management configuration settings

  1. Click Start, right-click Command Prompt, and then click Run as administrator.

    Note

    You must be a domain user who has been added to the administrators group for this machine.

  2. At the command prompt, run the following command:

    winrm set winrm/config @{MaxTimeoutms = "1800000"}

  3. Restart the winrm service and the SCVMM agent on the host using the following commands:

    net stop winrm

    net start winrm

    net start vmmagent

  4. If the host OS is Windows Server 2008: 

    1. Run the following command:

      winrm set winrm/config/Service @{MaxConcurrentOperations="200"}

    2. Restart winrm and the SCVMM agent on the host using the following commands:

      net stop winrm

      net start winrm

      net start vmmagent

Verify the Hyper-V Setup

To verify that Hyper-V is installed correctly and is working

  • Create a virtual machine using Hyper-V and check that you can start the virtual machine.

    If you have enabled the Hyper-V role for your HyperVHost, create a virtual machine using the information from the following MicrosoftWeb site.

    Note

    You can change the settings for the virtual machine based on your needs. You can update the hard disk size and the memory. For more information about these settings, see the following Microsoft Web site.

    If you are using Hyper-V Server, create a virtual machine using the information in the Hyper-V Server Getting Started Guide from the following MicrosoftWeb site.

    Note

    If you have multiple hard disk drives on your Hyper-V machine, you must configure the paths for the virtual machines to be the larger disk, or you may not have sufficient disk space to create your virtual machines.

For more information about Hyper-V, see this overview of Hyper-V.

Note

When you create or start a virtual machine, issues may occur due to antivirus software. For more information, see the following Microsoft Web site.

Install and Configure SCVMM

To access the virtual machines that you create with Hyper-V from Lab Management, you must install and configure System Center Virtual Machine Manager R2. System Center Virtual Machine Manager (SCVMM) is a tool for managing your Hyper-V host machines from a central console. Lab Management communicates with SCVMM to be able to use the virtual machines and templates to create environments.

Note

If you are using the stand-alone Hyper-V Server 2008 R2 operating system, you must install SCVMM on a separate VmmMachine. You cannot use the HyperVHost computer. For more information about the unique characteristics of Hyper-V Server 2008 R2, see the following Microsoft Web site.

To install SCVMM server and SCVMM Administrator Console on the VmmMachine

  1. On VmmMachine, log on as a domain user who is also an administrator on the machine.

  2. To install System Center Virtual Machine Manager, run setup.exe.

  3. To install the SCVMM Server, under Setup click VMM Server. Click I accept the terms of this agreement. Then click Next in all except the following pages of the wizard:

    1. On the SQL Server Settings wizard page, click Install SQL Server 2005 Express Edition SP3, and then click Next.

      Note

      If you do have an existing instance of SQL that you want to use, then select Use a supported version of SQL Server.

    2. On the Library Share Settings wizard page, select Create a new library share.

      Note

      You can accept the default names and locations for the library share or enter different values.

    3. On the Installation Settings wizard page, you can either accept the default port numbers and VMM service account or enter different values.

    4. On the Summary of Settings wizard page, click Install.

    5. On the Installation wizard page, click Close.

  4. To install the Virtual Machine Manager Administrator Console, under Setup click VMM Administrator Console. Click I accept the terms of this agreement. Then click Next in all except the following pages of the wizard:

    1. On the Summary of Settings wizard page, click Install.

    2. On the Installation wizard page, click Close.

  5. On the System Center Virtual Machine Manager 2008 startup page, click Exit.

  6. Install the update described on this Microsoft Web site. This update supports the network isolation capability of virtual environments.

Configure SCVMM

You must configure SCVMM to add your Hyper-V host machines to a host group, and to optionally add more library shares.

Note

A host group lets you group the Hyper-V host machines together in a meaningful way based on the purpose of the host machine. For example, a set of host machines might belong to a particular department in your company.

To configure SCVMM

  1. Open Virtual Machine Manager Administrator Console.

    1. Click Start, All programs, Microsoft System Center, Virtual Machine Manager 2008 R2, and then Virtual Machine Manager Administrator Console.

    2. On the Connect to Server dialog box, type localhost:<port number>or <the name of the SCVMM Server>:<port number>, and then click Connect.

      Note

      If you receive an error message that states that you cannot connect because the service is not running, run services.msc and verify that Virtual Machine Manager Service is running.

  2. To add the HyperVHost machines to a host group in SCVMM, in the Actions pane click Add host. Click Next in all except the following pages of the wizard:

    1. On Select Host Location wizard page of the Add Hosts wizard, type the credentials of an administrator for the Hyper-V host.

    2. On the Select Host Servers wizard page, type the computer name of the host that you are adding to SCVMM—for example, HyperVHost—and then click Add.

    3. On the Summary wizard page, click Add Hosts.

      Note

      It is recommended that you configure a separate host group for each team project collection. For example, if you plan to configure Lab Management in two project collections in Team Foundation Server, you can create two host groups in System Center Virtual Machine Manager.

  3. (Optional) By default, SCVMM configures the machine on which it is installed to act as a library server. It also sets up a default library share on the machine. You can add more library servers or shares to improve the performance.

    1. To add a new library server to SCVMM, click Add library server in the Actions pane on the right side and follow the instructions in the wizard.

    2. To add a new library share to SCVMM, first create a Windows file share on a library server. Then select the library server on the Library tab of SCVMM Administrator Console and click Add library shares under the Actions pane on the right side.

      Note

      It is recommended that you configure a separate library share for each team project collection.

    3. On each SCVMM library server, install the update described on this Microsoft Web site. This update supports the network isolation capability of virtual environments.

  4. To ensure that virtual machines start quickly and that the host service and any network agents do not timeout, set the minimum amount of memory that the HyperVHost machine will always have in reserve. The default memory reserves on the host machine are often too low to accommodate the longer startup time required for virtual machines.

    1. In the SCVMM Administrator Console, click Hosts.

    2. Under the All Hosts pane, click the name of the host machine, and then click Properties.

    3. In the Host Group Properties for All Hosts dialog, click the Host Reserves tab.

    4. In the Memory edit box, type or select 1024, and then click OK. For more information about the minimum required memory for Hyper-V hosts, see this Microsoft Web site.

    5. Repeat steps b. through d. for each host.

Important

If you have two SCVMM servers that are both configured to be used by Lab Management with a specific Team Foundation Server, then each SCVMM server must be configured to use a unique MAC range. To configure the MAC range, from the Virtual Machine Manager Administration Console, in the lower-left navigation window click Administration, click Networking and then double-click Global Static MAC Address Range. For more information about how to configure the MAC range, see the following Microsoft Web site.

To verify that SCVMM is installed correctly and is working

  1. In the Virtual Machine Manager Administrator Console, in the Actions pane on the right side, click New virtual machine. Click Next in all except the following pages of the wizard.

    1. On the Select Source wizard page, select Create the new virtual machine with a blank virtual hard disk.

    2. On the Virtual Machine Identity wizard page, in Virtual machine name, type blank.

    3. On the Select Destination wizard page, select Place the virtual machine on a host.

    4. On the Select Host wizard page, view the ratings, and then click Next.

      You should see all the HyperVHost machines that you are using for Lab Management. All of them should have positive star ratings. If not, you might have an issue that must be corrected. To determine why the HyperVHost machines are not usable by SCVMM, examine the Rating Explanation.

    5. On the Summary wizard page, click Create.

      A new virtual machine called blank should be created without any errors and should be visible in the Virtual Machines tab of SCVMM. There might be a warning that SCVMM could not locate the boot volume. This is expected and can be ignored.

  2. In the Virtual Machine Manager Administrator Console, click Virtual Machines, right-click the virtual machine displayed in the list, and then click Start. If the virtual machine does not start, review the information located on the following sites to identify the cause of the problem:

  3. After the Status of the VM is Running, right-click the VM, and then click Stop.

    This confirms that your Hyper-V hosts are configured correctly.

  4. To store the virtual machine in the library, right-click the VM, and then click Store in library.

    1. On the Select Library Server wizard page, click one of the library shares.

    2. On the Select Path wizard page, browse to the path for your library share that you plan to use for your team project collection on Team Foundation Server.

    3. When you are finished, confirm that a virtual machine called blank appears in the Library pane in the SCVMM Administrator Console.

      This confirms that the library share is configured correctly.

Improve the Performance of VM Transfers

You can use the following procedure to improve the performance of virtual machine transfers from the SCVMM library share to a host and also when storing a virtual machine to the SCVMM library share. This performance improvement removes encryption that has security implications if the images are transmitted unencrypted over the network.

To improve performance of VM transfers

  1. Enable unencrypted file transfers for library servers.

    1. Click the Library tab in the SCVMM Administrator console. Right-click each library server in the Library Servers tree, and then click Properties.

    2. Select Allow unencrypted file transfers.

    3. Click OK to close the dialog box.

  2. Enable unencrypted file transfers for host groups.

    1. Click the Hosts tab in the SCVMM Administrator console. Right-click each host group in the Hosts tree, and then click Properties.

    2. Select Allow unencrypted file transfers.

    3. Click OK to close the dialog box.

Configure Lab Management for Team Foundation Server

To enable Team Foundation Server to communicate with the SCVMM server, you must also install the SCVMM Administrator Console on your TfsMachine if this is a different computer from the computer that you are using as your VmmMachine.

To install the SCVMM Administrator Console on <TfsMachine>

  1. Logon to TfsMachine as domain\tfsadmin.

  2. To install Virtual Machine Manager Administrator Console, run setup.exe for Virtual Machine Manager.

  3. Under Setup on the System Center Virtual Machine Manager 2008 R2 startup wizard page, click VMM Administrator Console.

  4. You can just click Next in all except the following pages of the wizard:

    1. On the Summary of Settings wizard page, click Install.

    2. On the Installation wizard page, click Close.

Note

If your deployment of Team Foundation Server has more than one application-tier machine, repeat the previous steps to install SCVMM Administrator Console on each application-tier machine.

Configure Lab Management for Team Foundation Server

Important

Before you configure Team Foundation Server, make sure that you have installed the latest updates for Lab Management. To find the latest updates, see Update for Microsoft Visual Studio 2010 Lab Management and this Microsoft Web page.

You must configure Lab Management in Team Foundation Server. This enables access to the virtual machines and templates that you create from Microsoft Test Manager. You can then use these virtual machines or templates to create virtual environments and store them in a library share. This requires you to select the SCVMM server to use with Team Foundation Server.

To configure Lab Management for Team Foundation Server

  1. On TfsMachine, click Start, All programs, Microsoft Team Foundation Server 2010, and then click Team Foundation Administration Console.

    Note

    You must log on to TfsMachine as domain\tfsadmin.

  2. In the Administration Console, in the Application Tier node, click Lab Management.

  3. Click Configure Lab Management.

    The Lab Management Settings dialog box is displayed.

  4. On the Virtual Machine Manager tab, in VMM Server Name, type the name of VmmMachine, the server that is running Virtual Machine Manager and that you will use to manage the virtual machines.

  5. Click Test to determine whether Visual Studio Team Foundation Server can communicate with the SCVMM server.

    1. If Team Foundation Server service account does not have the appropriate permissions on the specified SCVMM, a dialog box prompts you for a user name and password.

    2. Specify the credentials of an existing member of SCVMM Administrators Role. By using this user name and password, the Team Foundation Server service account will be added to the SCVMM Administrator Role.

    If Team Foundation Server cannot contact the SCVMM server, a red x and an error message is displayed. For more information about how to troubleshoot installation issues, see Troubleshooting Lab Management.

  6. You can use network isolation in Visual Studio Lab Management to enable multiple copies of a lab environment to run at the same time without causing network conflicts, such as conflicts in computer names and Domain Name System (DNS) registration. For more information about network isolation, see How to: Create and Use a Network Isolated Environment. On the Network Isolation tab, follow these steps:

    1. In IP Block, type the range of Internet Protocol (IP) addresses to be assigned to the virtual machines in an environment when an isolated network is created.

      You must type the IP Block using Classless Inter-Domain Routing (CIDR) notation. The CIDR notation is constructed from the IP address, the forward slash (/), and the prefix size. For example, 192.168.0.0/24.

      The addresses that you specify are used only for internal routing among virtual machines and are not exposed beyond the boundaries of an environment. Therefore, you can specify any address range that is not used within your public network. In most cases, you can use the default range of 192.168.23.0/24.

    2. In DNS Suffix, type the suffix of the domain name to be assigned to the environment when an isolated network is created.

      Team Foundation Server uses the suffix that you entered when it registers a unique external name with DNS for each virtual machine in a network-isolated environment. The DNS alias record makes it possible for machines and other objects outside the isolated network to communicate with machines inside the isolated network. Because Team Foundation Server goes into the DNS zone to register the alias record, the service account under which Team Foundation runs must have permissions to add or delete alias records in the specified DNS zone.

      If your Team Foundation Server deployment has more than one application tier and each application tier runs under a different service account, then each application-tier service account must have permission to edit the DNS alias records created by the other application tiers.

      Click Test to determine whether Visual Studio Team Foundation Server can use the suffix.

      If the suffix is valid, a green check mark appears. Click OK.

      If the suffix is not valid, a red x and an error message appear. You must fix the error before you can continue.

  7. (Optional) If your workflow capability fails, the build agent might not be using the correct URL to communicate with the build controller. To fix this issue, on the Advanced tab, type the correct URL in Lab Url. The URL should include the fully qualified domain name for Team Foundation Server. For example, http://<tfs server name>.<domain name>.com:8080/tfs. For more information about the workflow capability, see Install build controller and test controller.

  8. If your deployment of Team Foundation Server has more than one application-tier machine, repeat the following steps on each of the other application-tier machines:

    1. In the Team Foundation Administration Console, click the Application Tier node, click Lab Management, and then click Reconfigure Lab Management.

      The Lab Management Settings dialog box is displayed.

    2. Click the Virtual Machine Manager tab, and then click Test to determine whether the application tier can communicate with SCVMM.

      If the Team Foundation Server service account does not have the correct permissions on the specified SCVMM, a dialog box is displayed prompting you for a user name and password. Type the credentials of an existing member of SCVMM Administrators role. When you type this user name and password and click OK, the Team Foundation Server service account of this application tier will be added to the SCVMM Administrator role.

Configure Lab Management for Each Team Project Collection

You must configure the host group and library share from SCVMM that you want to use with each team project collection. For example, you might decide to allocate one host group to each team project collection to evenly divide the virtual machine resources.

To use the workflow capability from a Team Foundation Build build definition to deploy your application, or run tests by using a test controller on your virtual environments, you must add a domain user account that will be used by test agents and build agents.

Note

You must have a team project collection already created for this step of the configuration.

To configure Lab Management for each team project collection

  1. To select the library share to use to store virtual machines, templates, and virtual environments, click Team Project Collections under Application Tier.

    Important

    You must select the library share for each team project collection that you want to configure for Lab Management.

  2. In the right-side pane, click the appropriate team project collection from the list of project collections.

  3. Click the Lab Management tab, and then click Configure Library Shares.

    The Lab Management Settings dialog box is displayed.

  4. On the Library Shares tab, click Add and Verify.

    The Select Library Shares dialog box is displayed.

  5. In the Select Library Shares dialog box, click one or more SCVMM library shares that this team project collection will use, and then click Add.

    The verify process now confirms that Visual Studio Team Foundation Server can connect to the library share. If the verification fails, then a log is generated. You can view the log to identify the problems and then fix them. When they are fixed, you can click Verify to confirm that Team Foundation Server can connect to the library share.

  6. To add the library share to each team project in the team project collection, select Auto Provision for the library share.

    Note

    If you select to auto-provision the library share, Team Foundation Server automatically adds the library share to all the team projects in this team project collection. For team projects that have not yet been created, the library share is added when the New Team Project wizard creates the project. For team projects that have already been created in this team project collection, the library share is added when these settings are saved. If you clear Auto Provision the library share will no longer be added to new team projects that you add to your team project collection.

  7. To select the host group to use for a team project collection, click Host Groups.

    Important

    You must select the host group for each team project collection that you want to configure for Lab Management.

  8. On the Host Groups tab, click Add and Verify.

  9. In the Select Host Groups dialog box, click one or more SCVMM host groups that this team project collection will use, and then click Add.

    The verify process now confirms the following:

    • The Team Foundation Server service account has been added to each host in the host groups that you have selected to add, so that Team Foundation Server can communicate directly with the hosts on the host group.

    • The network adapter to use for the virtual machines.

  10. If the Team Foundation Server service account (domain\tfssvc) has not been added to the administrators group on one or more of the hosts in these host groups, a dialog box prompts you for your user name and password.

    1. Type the user name and password of an account that has administrator permissions on all the physical hosts in the host groups that you want to add to this collection. These credentials will be used to add the Team Foundation Server service account into the Administrator Group of hosts in the selected host groups. Click OK.
  11. If you have one or more Hyper-V hosts that have multiple network adapters and if Team Foundation Server cannot determine which adapter has to be used to connect the virtual machines to, then the Multiple Network Adapters dialog box is displayed for each of these hosts. Select the network adapter, corresponding to your network location that you want to use from the drop-down list.

    Note

    If the verification fails, then a log is generated. You can view the log to identify the problems and then fix them. When they are fixed, you can click Verify confirm that everything is working correctly.

  12. To add the host group to each team project in the team project collection, select Auto Provision for the host group.

    Note

    If you select to auto-provision the host group, Team Foundation Server automatically adds the host group to all the team projects in this team project collection. For team projects that have not yet been created, the host group is added when the New Team Project wizard creates the project. For team projects that have already been created in this team project collection, the host group is added when these settings are saved. If you clear Auto Provision, the host group will no longer be added to new team projects that you add to your team project collection.

  13. To select the user account to use for communication between the test agents and build agents and between the test controllers and Team Foundation Server respectively, click Service Account.

    Warning

    The service account that you add must be a domain account. For security reasons, this account must have limited privileges. The account that you use must not have any administrative permissions or be the account that is used by any trusted service. This includes the build controller and test controller.

    We recommend that you create two accounts to use for this service account. For more information about how to switch between these two accounts and how existing environments are updated with the service account, see How to: Configure the Service Account for the Testing and Workflow Integration.

  14. On the Service Account tab, type the name of the account that you want to use for the service account in Account Name and the password for this account in Password.

  15. To verify that the user account is valid, click Test.

    Important

    You must select the user account for each team project collection that you want to configure for Lab Management.

  16. Click OK.

  17. If your deployment of Team Foundation Server has more than one application-tier machine, repeat the following steps on each of the other application-tier machines:

    1. In the Team Foundation Administration Console, expand the Application Tier node, click Team Project Collections, and then click the Lab Management tab.

    2. On the Lab Management tab, click Configure Host Groups.

      The Lab Management Settings dialog box is displayed.

    3. Click the Host Groups tab, and then click Verify.

      The verify process confirms that the Team Foundation Server service account for this application tier has been added to each host in the host groups you selected and that it can communicate directly with the hosts in the host groups. The process also confirms which network adapter to use for the virtual machines.

      If the Team Foundation Server service account has not been added to the Administrators group on each of the hosts in these host groups, a dialog box is displayed prompting you for a user name and password. Type the credentials of an account that is a member of the Administrators group on all the physical hosts in the host groups that you want to add to this collection. When you type this user name and password and click OK, the Team Foundation Server service account will be added to the Administrators group on the hosts in the selected host groups.

Verify Configuration Using Microsoft Test Manager

To verify that Lab Management is set up correctly to this point, you must:

  • Create at least one team project in your team project collection. For more information, see Create a Team Project.

  • You must install Visual Studio Test Professional or Visual Studio 2010 Ultimate on a client machine so that you can use Microsoft Test Manager.

To connect to team project by using Microsoft Test Manager 

  1. On a client machine that has Microsoft Test Manager installed, log on as domain\tfsadmin or any user who is a contributor in the team project.

  2. Connect to a team project that is configured for Lab Management.

    1. Click Start, All Programs, Microsoft Visual Studio 2010, and then click Microsoft Test Manager.

    2. If you are prompted to add a Team Foundation Server, type the name of the TfsMachine, and then click Add.

    3. Click the arrow to view the list of team projects in the team project collection, select the team project in the list, and then click Connect Now.

    4. Click Lab Center from the drop-down list of centers, or if you had to add a Team Foundation Server, click Lab Center under Change project.

    5. Click Continue to connect to the Lab Center of the selected team project.

      Note

      If no team projects appear in the team project collection, the collection administrator might not have created any projects. If a project appears but is displayed as Not supported, the collection administrator might not have provisioned the library shares and host groups for that team project.

    If the Lab Center opens and the Environments view is displayed, then you have successfully configured the project collection for Lab Management.

Install Build Controller and Test Controller

You can use Lab Management to deploy an application to your environment and also to run tests on that environment. These are known as the workflow and testing capabilities for Lab Management.

To deploy an application by using the workflow capability, you can use Team Foundation Build to build your application, or deploy an application that has already been built. Then you create a build definition that includes the workflow to deploy your application to each virtual machine in your environment. This requires a build controller. You can then run tests on the role that you selected in your test settings. This requires a test controller. For more information about how to run tests using test settings and environments, see Setting Up Test Machines to Run Tests or Collect Data.

Workflow Capability: To set this up for a team project collection, you must do one of the following:

  • Install a build controller and register it to the team project collection.

  • Use an existing build controller that is registered to the team project collection.

Testing Capability: To set this up for a team project collection, you must do one of the following:

  • Install a test controller and register it to the team project collection.

  • Use an existing test controller that is registered to the team project collection.

After you install the controllers, you can verify your installation by adding agents to existing virtual machines or creating virtual machines with the agents installed. Then create a virtual environment that has these capabilities that uses these virtual machines for roles in the environment. For more information about this, see the Next Steps section of this topic.

Important

You can install build and test controllers now as part of the configuration process, or you can complete this step later when you must have workflow and testing capabilities for your environments.

If you need to install a build controller or a test controller, follow these steps. We recommend that you install these on separate machines from your TfsMachine, but for a minimal setup you can install it on your TfsMachine.

To install the build controller and test controller

  1. Install the build controller on ControllersMachine, or on a different machine. To install the build controller, you must use the installation DVD for Team Foundation Server. For more information about how to install a build controller, see Installing and Configuring Visual Studio Agents and Test and Build Controllers.

    Note

    You must register the build controller with the team project collection that you are using for Lab Management

  2. Install the test controller on ControllersMachine or on a different machine. For information about how to install and configure a test controller, see Installing and Configuring Visual Studio Agents and Test and Build Controllers.

    Note

    You must register the test controller with the team project collection that you are using for Lab Management.

Next Tasks

You can now use Lab Management for any of the following tasks:

Tasks

Associated Topics

Quickly create a virtual environment from virtual machines: You can now use the virtual lab that you created for your team project collection. You can compose an environment for that team project collection from existing virtual machines to use to get started with Lab Management.

Prepare virtual machines to be ready to use with lab management: You can prepare existing virtual machines or create new ones to be ready to use with the virtual lab that you created. You must install the necessary agents onto these virtual machines to be able to use them with Lab Management.

Decide how to create your environments based on your needs: You might want to run multiple copies of your environments at the same time. There are various ways to accomplish this by using Lab Management. In addition, you might want to enable the testing and workflow capabilities when you create your environments based on your needs.

Deploy your application to a virtual environment: You can use the workflow capability to deploy your application to your environment after you have built the application. You can then use the environment to run tests or to have users test an internal release.

Run manual tests by using a virtual environment: You can use Microsoft Test Manager to run manual tests by using a virtual environment for the back-end tiers of your application.

Run automated tests by using a virtual environment: You can use your virtual environment to run automated tests from Microsoft Test Manager by selecting the environment as part of your test plan or when you run your tests from the Run Tests view.

Build, deploy and test your application on a scheduled basis by using the workflow and testing capabilities: You can use the workflow and testing capabilities if you want to schedule building your application, deploying your application, and running automated tests to check the quality of your build.

See Also

Concepts

Configuring and Administering Lab Management

Change History

Date

History

Reason

April 2011

Added a step in the SCVMM installation section to change the default port numbers or service account on the Installation Settings wizard page.

Customer feedback.