Working with Virtual Environments
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Virtual environments are the entities on which you perform most of your tasks when you use Lab Management, such as development, application deployment, and testing. An environment is a group of machines. A virtual environment managed by Lab Management is a group of virtual machines. Grouping allows you to define machines that are required for an instance of your multi-tier application and to perform tasks on that entity as if it were a single unit. The following list includes examples of these tasks:
Create and start the environment
Take snapshot of the environment
Deploy your application to various machines of the environment
Run test cases on the environment
By using Lab Management and Microsoft Test and Lab Manager, you can create and use virtual environments in a variety of development tasks.
If you are developing one or more components of a multi-tier application, you can use a single virtual environment that contains multiple virtual machines. Each virtual machine constitutes a separate tier of your application. In most cases, you would want a virtual environment to mimic the way the application would be set up in production.
If you are developing a server application that can be deployed in multiple topologies, you could define a separate virtual environment for each topology. For example, you might want to test your server application in two topologies:
Where the database and application tiers are on the same machine
Where the two tiers are located on different machines. You can then define one virtual environment for the first topology and one virtual environment for the second.
If you are developing a desktop or client application, you can create the virtual environment using a single virtual machine.
You can also define a virtual environment with only some components of the application. Other components are shared across environments. For example, if your application needs a large database, then you can choose to host a shared database on a physical machine. All virtual environments will have only virtual machines for the client and application tiers.
Environment Lifecycle
You can create a virtual environment on a team project host group or in a team project library share.
When an environment is created on a team project host group, the virtual machines of the environment are hosted on a Hyper-V host. When the environment is started, the corresponding virtual machines are started and you can interact with those virtual machines. This environment is now considered to be an active environment. You can view and manage active environments under the Lab tab in Microsoft Test and Lab Manager.
When an environment is created on a team project library share, the virtual machines or templates of the environment are stored on the disk of the library server. In this case, the environment is simply a passive set of files. Until the environment is deployed onto a team project host group, you cannot do anything more with it, and the environment is now considered to be a stored environment. Stored environments are viewed and managed under the Library tab in Microsoft Test and Lab Manager.
The process of making a copy of a stored environment and creating an active environment from the copy is called deploying. The process of making a copy of an active environment and creating a stored environment from the copy is called storing.
Note
The term deployment here should not be confused with application deployment. While the former means creating an active environment, the latter means installing bits of the application on an environment.
All the supported ways of creating environments are summarized in the picture above. A team can adapt these creation operations to suit the needs of their development process. A typical scenario using environments might be:
Import: A team project administrator or lead imports virtual machine templates in a team project library share. These templates are "golden" images of standard operating systems or operating systems combined with the prerequisite software for the application being developed.
Create active environment: A team project member creates an active environment by grouping virtual machine templates. After they have been created and started, the virtual machines in the environment are running and available for use.
The team project member connects to the environment and installs all the prerequisite software for the application being developed or tested.
The team project member takes a snapshot of the environment in order to return to this pristine state and install a newer version of the application whenever a new version is needed.
The team project member installs the latest version of the application and makes any post-installation configurations.
Store: The team project member stores a copy of that environment in the team project library share. This will save time for the rest of the team members as they do not have to install the application or its prerequisites again.
Deploy: Each team project member creates a fresh instance from that stored environment for his or her daily work.
Store: When a team project member finds a bug, the team member takes a snapshot of the environment to preserve the bug. At the end of his testing, he stores another copy of the environment to library.
Deploy: A developer can deploy a copy of the environment stored with the bug to reproduce and fix the bug.
Delete: When the environments are no longer needed, the team project members who created the environments remove them from both the host groups and the library shares.
The above scenario is not intended to be prescriptive and must be adapted to the needs and processes followed by individual teams.