1 out of 1 rated this helpful - Rate this topic

Using a Lab Environment for Your Application Lifecycle

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

If your application runs on multiple computers, for example, a web client, a web server, and a database server, then you can use Microsoft Test Manager to help you test the application on a collection of computers. If you also use System Center Virtual Machine Manager (SCVMM), then you can take snapshots of the complete collection of computers, and easily restore them to an initial state for each new test run. Visual Studio Lab Management is an extension of Microsoft Test Manager that helps you to manage collections of virtual machines or physical computers for testing, building, and developing applications in Visual Studio.

Testing in Lab Environments

A lab environment is a group of computers that is managed by Lab Management.

To create an environment, you use Lab Center in Microsoft Test Manager. You assign computers to each role that is required for the application that you intend to develop, test, or run. For example, you might be developing a multi-tiered application that requires three roles: a desktop client, a Web server, and a database server.

Environment for Multi-Tier Application

You can define a workflow so that it deploys each part of the application to the relevant computer by using Team Foundation Build, and then runs the three computers as a single instance of the application for testing. To run the workflow, you use Visual Studio.

You can run the same workflow on different lab environments. For example, some distributed applications can be deployed in more than one topology. The data tier and the application tier might be located on the same machine in one topology, whereas the two tiers are located on separate machines in the other topology. To test these two topologies, you can set up two lab environments, and run the workflow on each of them.

For more information, see Testing Using Lab Environments.

Standard and SCVMM Environments

There are two kinds of lab environments:

  • Standard environments can contain any mixture of computers, including physical computers. You can also include virtual machines that run on any virtual machine framework, not only SCVMM.

    For more information, see Creating a Standard Environment.

  • SCVMM environments consist of virtual machines that run under System Center Virtual Machine Manager (SCVMM). By using an SCVMM environment, you can take snapshots of the complete environment, and return its virtual machines to an earlier state. You can also use clustered Hyper-V hosts with SCVMM environments.

    For more information, see Creating an SCVMM Environment.

Stored SCVMM Environments

You can add an SCVMM environment to a library as a stored environment. The states of the complete environment of virtual machines and their roles are stored. Later, you can deploy copies of the environment when you want to run tests on it.

You can also create environments made up of virtual machine templates. Templates are virtual machines that have had their names and other identifiers removed. When a template is deployed so that you can run it, new identifiers are generated. This allows the same environment to be deployed more than once, without network name conflicts.

For more information, see How to: Store an SCVMM Environment in the Library.

Network-Isolated Environments
Caution note Caution

You cannot add clustered hosts to a network-isolated environment.

You can run tests on multiple copies of an environment at the same time. To achieve this without conflicts between the computer names, you can create a network-isolated environment in which each computer has two network adapters. One adapter is connected only inside the environment, and has an address that is the same in each copy of the environment. This allows the software installed in the machines to communicate, without any adaptation being required when each copy of the environment is created. The other adapter is connected externally, and is automatically assigned a unique address. This allows for communication with the test agent so that software can be installed and data collected. The software under test can also use services that are outside the lab environment.

For more information, see How to: Create and Use a Network Isolated Environment.

  • Build, deploy, and test applications automatically.

    You can define workflows in Lab Management. A typical workflow could invoke a build in Visual Studio Team Foundation Server, load the built applications into the appropriate computers in a lab environment, and then perform automated tests that are defined by using Microsoft Test Manager.

    Team members do not require administrator permissions to perform these deployments. Instead, you can use Lab Management permissions to create role-based self-service groups.

  • Collect diagnostic data from all machines in the environment, even in manual testing.

    Without using environments, you can collect diagnostic data only from the machine on which you are working. For example, if you are working on a web browser, it is difficult to collect data from the server. But with a lab environment, you can collect IntelliTrace, test impact, and other forms of data from the web server.

If you use Lab Management in conjunction with System Center Virtual Machine Management (SCVMM), you can also get these benefits:

  • Quickly reproduce specified configurations of machines.

    You can store environments of virtual machines that are configured to recreate typical customers' production environments. You can perform each test run on a new copy of a selected stored environment.

  • Reproduce the exact conditions of a bug or other development issue.

    Lab Management snapshots capture the state of all computers in the environment at a point in time. A snapshot of environment can be shared with members of a project team. A reference to the stored snapshot can be included in Visual Studio Team Foundation Server work item so that a copy of the environment can be created with a few clicks of the mouse. When Microsoft IntelliTrace data is included in the work item, the execution path of the application to the bug can be fully reproduced on the exact configuration where the bug occurred.

  • Run multiple copies of a test or development at the same time

    Using Lab Management stored SCVMM environments, you can deploy multiple copies of an environment at the same time without the computer name conflicts that can limit the use of unmanaged virtual machines in a domain.

Lab Management depends on technologies and concepts that are summarized in the following tables:

Virtual machines

Key Concept

Description

Virtual machine

A virtual machine is a software implementation of a computer that runs programs as if it is a physical computer. This enables you to run multiple virtual machines on one physical computer. Each virtual machine must have its own installation of an operating system and any other software that you require.

Host

The physical computer that runs the virtual machine.

Snapshot

A snapshot saves the state of your virtual machine at a specific point in time. You can revert your virtual machine to this snapshot whenever you want and then use this virtual machine from this known state when the snapshot was taken.

Virtualization framework

The tools and services that you use to create and run virtual machines. Microsoft Hyper-V and other virtualization frameworks can be used with Lab Management.

Hyper-V

A role in Windows Server that provides a virtualization framework.

System Center Virtual Machine Manager (SCVMM)

Key Concept

Description

SCVMM

Provides:

  1. Management of one or more virtualization hosts.

  2. A library in which virtual machines and templates can be stored.

Virtual Machine Template

An image of a virtual machine that has been stripped of identifying information such as the machine name and the product key. You can create multiple virtual machines from a template without creating computer name conflicts on a domain.

Host group

A group of physical computers that are hosts that can be used to run virtual machines. Host groups optimize the deployment of virtual machines on the collection of hosts for you, so that you do not have to select to which host each virtual machine is deployed. You can assign host groups to your team projects and team project collections in Team Foundation Server.

Library server

A computer that is used to store virtual machines, templates, and other resources.

Library share

A shared location on a library server where you can store your virtual machines, templates, and other resources. You can have multiple library shares. You can assign library shares to your team projects and team project collections in Team Foundation Server.

Lab Management

Key Concept

Description

Lab environment

A collection of computers on which you can run tests, that Lab Management manages as a logical unit. Each computer that you add to the environment is used for a role in your application. For example, you might select a role of Web server for a computer.

Lab Management installs a test agent on each computer, which allows it to control deployment and test execution.

SCVMM environment

A lab environment that consists of virtual machines that are managed by System Center Virtual Machine Manager. The virtual machines can only run on Hyper-V. By using Lab Management, you can take a snapshot of the states of all the machines in the environment, and restore the environment to a known state on which to run tests. You can also create copies of an environment, which can run independently of each other.

Standard environment

A lab environment in which the computers can include any mixture of physical and virtual computers. The virtual machines can run on any virtualization platform. You cannot use Lab Management to take snapshots or restore the state of a standard environment.

Each computer must run Windows 7, Windows Server 2008, or Windows 8 Consumer Preview. When you define a Standard environment in Lab Management, it installs a test agent on each of the computers.

Lab Center

The activity area in Microsoft Test Manager where you manage and operate the virtual machines and environments that are deployed on the SCVMM host groups of your team project.

Choosing between SCVMM and Standard Environments

You can use either physical or virtual machines in creating and managing environments, testing, or build deployment.

Creating and managing environments

On an SCVMM environment, you can: compose virtual machines into an environment; create environments and virtual machines from templates; run multiple copies of environments at the same time using network isolation; and Start/Stop/Snapshot/Restore the machines in an environment.

In a standard environment, you can compose any combination of existing physical or virtual machines. You cannot copy or take a snapshot of a standard environment.

Testing

Using Microsoft Test Manager, you can run tests on both SCVMM as well as standard environments. You can run automated and manual tests, and do rich diagnostic data collection on both types of environment.

Build deployment

You can easily automate the build-deployment-testing workflow on both SCVMM and Standard environments using the template build definitions provided. (LabDefaultTemplate.11.xaml)

Lab Management works with both SCVMM environments and standard environments, but the capabilities of each type of environment are different. The following table summarizes the different capabilities for each type of environment.

Capability

SCVMM Environments

Standard Environments

Testing

Run manual tests

Supported

Supported

Run coded UI and other automated tests

Supported

Supported

File rich bugs using diagnostic adapters

Supported

Supported

Build deployment

Automatic build-deploy-test workflow

Supported

Supported

Environments creation and management

Automatically install test agent into machines of the environment

Supported

Supported

Create environment from VM template

Supported

Not supported

Start/stop/snapshot environment

Supported

Not supported

Connect using Environment Viewer

Supported

Supported

Run multiple copies of an environment at the same time using network isolation

Supported

Not supported

Task

Related content

Try it out: Discover the resources to initially configure Team Foundation Server, SCVMM, and Lab Management, and then create and run virtual machines in an environment.

Getting Started with Lab Management

Create lab environments: Lab Management provides a number of ways to create and use lab environments. Learn how to create the lab environments that best fit your needs.

Creating Lab Environments

Integrate Lab Management in your testing lifecycle: Learn how to use lab environments to make testing more efficient, and the reproduction of bugs easier to create and share.

Testing Using Lab Environments

Capture the complete state of a SCVMM environment: Lab Management snapshots Let you store the exact state of an SCVMM environment at a point in time. Testers and developers can then roll back the environment to that state. You can use snapshots to create a clean environment for testing or to reproduce a bug or development issue.

Using Snapshots to Store, Reproduce, and Share the State of SCVMM Environments

Build, deploy, and test your application automatically:   Combine Lab Management lab environments with Team Build workflows and Test Manager test plans to automate the deployment and testing of regularly scheduled build of an application under development.

Deploying an Application to a Lab Environment

Customize the default workflow template: Add more activities to the lab default workflow template to meet the additional requirements in your build-deploy-test scenario.

Customizing Lab Management Workflow

Find more information and assistance on MSDN blogs and forums:  Lab Management blogs and forums provide troubleshooting information and answers to specific questions about using lab environments.

Troubleshooting Lab Management

Did you find this helpful?
(1500 characters remaining)