Life is a Non-Deterministic Finite State Automata
Automation ? (*pGeekiness)++ : Code /eneration;

February 23, 2011

Automating the Integration of VmWare with Microsoft Test Manager and Lab Center: Part 1 – Introduction

PLEASE NOTE: This is for Visual Studio 2010. For the VS2012 version, please click here.

There have been a few good posts recently on how to integrate Physical Environments into the Build-Deploy-Test cycle in Visual Studio 2010. This one by Colin Dembovsky (and the Darshan Desai one it references) explains how to target a physical environment out of the box with TFS.

But setting up those physical environments and registering them with Lab Center is still a manual task. What I want to do as part of my Build-Deploy-Test cycle is to provision a brand new virtual machine from VmWare, join it to my domain, install the test controllers and test agents, register those test controllers and agents with TFS and construct a Physical Environment in TFS/Lab Center containing those VmWare machines ready for testing. And I want to be able to do that by calling a web service, running a script or pushing a button. And I want the entire process to be automated. How?

This series of posts will achieve that:

  • Part 1 – Introduction.
  • Part 2 – Provisioning a new VmWare machine using Vix and joining a domain.
  • Part 3 – Automating the installation of the Test Controller and Test Agent.
  • Part 4 – Automating the configuration and registration of the Test Controller and Test Agent with TFS.
  • Part 5 – Automating the creation of a Physical Enviroment in Lab Center. (Source Code)
  • Part 6 – Service Pack 1 Notes
  • Background
    I am often asked by customers whether it is possible to use VmWare machines as part of their development effort in VS2010 and Lab Center. And the answer is Yes.

    And No.

    And Of Course.

    And It Depends :-)

    So I’m glad I cleared that up! Whether they can use VmWare is really the wrong question. What they should be asking is Can we use VmWare as part of our Test Automation? and Can we use VmWare as part of our nightly Build-Deploy-Test cycle?. So here goes…!

    Can we use VmWare as part of our Test Automation?
    Yes. Microsoft Test Manager [MTM] can do this by targeting a ‘physical enviroment’ that contains VmWare machines. Before targetting VmWare from MTM you need to:

  • Provision one or more VmWare Machines manually or using Vix, PowerCLI or whatever.
  • Optionally install a Test Controller onto one of those machines.
  • Install a Test Agent onto each of those machines.
  • Register that Test Controller with TFS.
  • Construct a Physical Environment in Lab Center containing those VmWare machines.
  • That is a typical approach taken by clients that have an investment in VmWare. Once the VmWare machines have been configured, you can target those machines in MTM:

    The astute technical term for manually configuring those VmWare machines, test controllers and physical environments is: ‘ballache’.

    These posts will show you how to automate the creation of VmWare Environments for use in MTM and Lab Center. By the end of this series of posts, you will have a set of scripts that will automatically construct brand new VmWare Environments from the ground up, install the Test Controllers and Test Agents, register them with TFS and construct a Physical Environment to be ready for use with MTM. All automatically.

    We do a build every night and want to install and test our software on VmWare Environments automatically afterwards. Can we do that?
    Yes! Absolutely! The problem is that out of the box, the Build-Deploy-Test Workflow is designed to target Virtual Environments managed in Lab Center. Lab Center can only manage virtual environments built on Hyper-V and SCVMM. Lab Center has no idea how to start, stop, provision, clone or manage snapshots on a machine that is not managed by SCVMM and it collectively treats every such machine as a ‘Physical Machine’. So if we want to target VmWare and its features as part of Build-Deploy-Test, we need to write the necessary glue ourselves.

    This post sums it up nicely!

    Let’s get started…!

    Powered by WordPress