This workflow allows you to incorporate snapshots into a Build-Deploy-Test using a Standard Environment that is composed of Virtual Machines in TFS 2012.
Standard Environments in Lab Management are attractive since they can be created from existing machines and require very little setup and configuration. If you have Standard Environments composed of Virtual Machines, then it is possible to add snapshot capabilities to this environment.
The “Hybid Lab Workflow” does exactly that. It is a customization of the LabDefaultTemplate.xaml workflow for Build-Deploy-Test workflows, and allows you to incorporate snapshots into a Build-Deploy-Test run against a Standard Environment
that is composed of Virtual Machines.
Here is a simplified workflow chart showing the tasks in this workflow (the orange blocks indicate the custom tasks that augment the out-of-the-box Build-Deploy-Test workflow):
- You have an existing Standard Environment composed of VMs that all reside on the same host
- To restore snapshots before deployment, you have taken a "clean" snapshot of the VMs after the Environment has been configured and is in the "Ready" state
- You have the username and password of an administrator account on the VM Host machine. (This is because the workflow interacts with the host using WMI, and these credentials are required for the connection)
- If you are going to run Coded UI tests and have one of the Test Agent's VMs configured to run interactively, you have the password for the interactive account
These are prerequisites even for the out-of-the-box Build-Deploy-Test Workflow:
- You’ll need to have a build that produces bins that you want to deploy to the environment (the Code build)
- You’ll need to know how to deploy (either have your commands ready or include scripts into the Code build
- If you want to run automated tests, you’ll have to have created them, linked them to test cases in a test plan and created automated test settings
When the workflow completes, the build report will contain a reference to the post-deployment snapshot, but it is not possible to restore the environment to this snapshot using MTM. Restoring the environment to the post-deployment snapshot state requires you to restore each VM manually. The name of the snapshot on each VM will however be the name of the snapshot in the build report.General Standard Environment Limitations:
- You cannot start or stop the environments from MTM
- You cannot clone the environments or utilize network isolation
- You cannot create the environment from templates within MTM
For details on how to set up and use this workflow, go to http://colinsalmcorner.blogspot.com/2012/10/hybrid-lab-workflow-standard-lab.html
Supporting VMWare Hosts
Currently the workflow only supports HyperV hosts. However, the workflow has been designed to be extended for other Host Types (such as VMWare). If you have a VMWare Host and would like to extend the workflow, see http://colinsalmcorner.blogspot.com/2012/11/extending-hybrid-lab-workflow-virtual.html