This topic has not yet been rated Rate this topic

How to: Create a Lab-ready Virtual Machine or Template in VMM

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

This topic contains instructions for creating virtual machines with all the necessary team agents using VMM, for converting those virtual machines into templates and storing the templates in the VMM library. You might have to regularly create new golden virtual machines to satisfy the needs of various team projects.

The following instructions use a shadow account for configuring the agents in virtual machines. For more information about the need for shadow accounts, see How to: Create Accounts to Enable Testing and Workflow Integration.

To create a virtual machine

  1. Log in to VmmMachine as an Administrator.

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

  3. Create a virtual machine in VMM using one of the following three methods:

    1. How to Create a Virtual Machine from an Existing Virtual Hard Disk.

    2. How to Create a Virtual Machine with a Blank Virtual Hard Disk.

    3. How to Create a Virtual Machine from a Template.

  4. Connect to the virtual machine using the VM console in VMM Administrator Console.

    1. In VMM Virtual Machines, right-click the VM, and click Connect.

    2. Make sure that you have installed the appropriate operating system and application pre-requisites into this virtual machine.

  5. Enable remote desktop connections to this VM.

    1. On the VM, click Start, right-click Computer and then click Properties.

    2. On the Systems dialog, click Remote settings.

    3. On the Remote tab of the System properties dialog, click the appropriate Allow connections option, and then click OK.

To install and configure a build agent

  1. Create a local account for agentsvc on the virtual machine.

    1. Click Start, click Run, type lusrmgr.msc and then click OK.

    2. Click Users.

    3. In the list of Users pane, right click and select New User.

    4. In the New User dialog, in User name type agentsvc, and in Password, type the same password that you used earlier when setting up the agentsvc account on TfsMachine. Clear User must change password at next login.

  2. Add agentsvc as a member of local Administrators group.

    Because the build agent will be used to deploy applications on the machine, the agent must have administrative permissions.

  3. Download and run the installer for Microsoft Visual Studio Team Foundation Server 2010 Beta2. This installer has an option to install build service. Select that option, and follow the instructions to install build service.

  4. When the installation is complete, click the option to launch the configuration tool. Follow the instructions in the configuration wizard.

    1. In the configuration wizard, DO NOT type in the name of the team project collection. Skip this page as it will be automatically done when the virtual machine is deployed by Lab Management.

    2. Use local agentsvc account to run the build service.

To install and configure a test agent

  1. Follow the instructions in Installing and Configuring Visual Studio Team Agents.

  2. In the test agent configuration tool, choose to run the agent service under the local agentsvc account.

Important note Important

Do not check Register with test controller. This will be done automatically when the virtual machine is deployed by Team Lab Management.

To install a lab agent

You have the option of storing this virtual machine in the VMM library as-is or to first convert it into a template and then store the template in library. Use the latter option if you plan to create environments with multiple instances of the same golden virtual machine. If you do not plan to have multiple instances within the same environment and if you plan to use network isolation, you may use the former option.

To store a virtual machine as-is into library

  1. Shutdown the virtual machine.

    1. In VMM Administrator Console, right-click the virtual machine and then click Shutdown.

  2. Store or create a copy of it in library.

    1. Right-click the virtual machine and then click Store in library.

To first convert a VM into a template and then store it in the library

  1. Prepare the virtual machine to be converted into a template.

    1. Clear the administrator password and local password policy.

    2. If the virtual machine is joined to a domain, remove it from the domain and join it to a workgroup. This is a pre-requisite for the next step. Restart the machine when prompted to do so.

    3. Open gpedit.msc, and click Local Computer Policy, Computer Configuration, Windows Settings, Security Settings, Account Policies, and then Password Policy.

    4. Set the following values:

    5. Enforce password history: 0

    6. Minimum password length: 0

    7. Password must meet complexity requirements: Disabled

    8. Close gpedit.msc

    9. Change the password of local Administrator account to be empty. You can do this by logging in as .\Administrator and then using ctrl-alt-del to change the password.

  2. Shutdown the virtual machine. In VMM Administrator Console, select the virtual machine, right click it, and choose Shutdown.

  3. Select the virtual machine and create a clone of it first onto a Hyper-V host. This is recommended because the original virtual machine is destroyed when converted into a template.

  4. Select the clone, and remove all the checkpoints on the virtual machine. This is required as SCVMM cannot convert a virtual machine with checkpoints into a template.

    1. Right-click the virtual machine, and then click Manage checkpoints.

    2. Click each checkpoint, and then click Remove.

  5. If you remove the checkpoints from a VM, Hyper-V merges the disks associated with the checkpoints. This could take several minutes depending on the size of the checkpoints. You can check the progress of this merging using Hyper-V manager on the host on which the virtual machine is deployed. Wait for the merging to be complete before moving to the next step.

  6. In VMM Administrator Console, right-click the virtual machine, and then click New template.

    1. Accept the defaults on all the screens. When prompted for a library share location, select the VMM library share.

Did you find this helpful?
(2000 characters remaining)