Partager via


Restore Lab Management components for TFS

TFS 2015 | TFS 2013

Important

TFS 2017 and later versions no longer support Visual Studio Lab Management. This article applies to TFS 2015 and TFS 2013.

You can restore one or more components of Visual Studio Lab Management that have failed. You can decide which procedures to complete based on which components failed, but you should complete the procedures in the following order:

  1. Restore the library server for System Center Virtual Machine Manager (SCVMM)
  2. Restore the server that is running SCVMM
  3. Restore Team Foundation Server
  4. Restore the Hyper-V hosts

If you follow the recommended order, TFS will recognize all virtual machines, templates, hosts and other objects in SCVMM. However, TFS will not recognize any objects that were deleted from SCVMM after it was backed up but before TFS was backed up. You can remove any such objects from Microsoft Test Manager, as described later in this topic.

Before you can complete these procedures, the following conditions must be true:

  • The network names of the new machines must match the names of the machines that were replaced.
  • All security accounts must have been restored.
  • All software must have been recovered to the same state.

Prerequisites

To perform this procedure, you must be a member of the following groups:

  • The Administrators security group on the server that is running the administration console for Team Foundation.

  • The SQL Server System Administrator security group or your SQL Server Perform Back Up and Create Maintenance Plan permissions must be set to Allow on each instance of SQL Server that hosts the databases that you want to back up.

  • The Administrator user role in SCVMM.

Restore the Library Server for SCVMM

When you restore the library server, make sure that you use the same names for the host and the library shares. For more information, see the following page on the Microsoft website: Backing Up and Restoring the SCVMM Database

Restore the Server That Is Running SCVMM

  1. Restore the server that is running SCVMM, and give it the same machine name as the old server.

    For more information, see the following page on the Microsoft website: Backing Up and Restoring the SCVMM Database.

  2. Make sure that the $machinename of the application-tier server for Team Foundation is a member of the Administrators group on the server that is running SCVMM.

  3. Add or remove any host groups or library shares that were added or removed after the most recent backup. For more information, see the following page on the Microsoft website: Backing Up and Restoring the SCVMM Database

Restore Team Foundation Server

If Team Foundation Server has failed, you must restore both the application-tier and the data-tier servers that compose the deployment. These components might be hosted on the same server or on multiple servers.

To restore Team Foundation Server

  1. Restore the server or servers that are running Team Foundation Server.

    For more information, see Restore an application-tier server, Restore data to the same location, Restore Data to a Different Server or Instance, or Restore a Single-Server Deployment to New Hardware.

    The machine name, accounts, and software must all be returned to the same state. The machine must be joined and connected to the domain.

    If you restore Team Foundation Server to a new machine, you must update the notification URL for Lab Management to match the URL of the new machine. For information about how to set the Lab URL in the Team Foundation Administration Console, see Configuring Lab Management for SCVMM Environments.

  2. Make sure that Team Foundation Server is running under a user account that is a member of the Administrators group on the server that is running SCVMM. If Team Foundation Server is running as Network Service, the TFS_MACHINE$ account should be a member of the Administrators group on the server that is running SCVMM.

  3. Perform the following steps to make sure that Team Foundation Server is running under a user account that is a member of the Administrators group on all Hyper-V hosts.

    1. Open the Team Foundation Administration Console. 

    2. On the Lab Management tab, choose Configure Host Groups, and then choose Verify.

    3. When you are prompted for a user name and password, type the user name and password of a member of the Administrators group on all the Hyper-V hosts. The service account for Team Foundation Server is automatically configured for you.

    4. Repeat steps b and c for each project collection.

  4. In SCVMM, manually delete any virtual machines that were created after the point to which you restored Team Foundation Server.

    These machines will not appear in either Microsoft Test Manager or Microsoft Environment Viewer. You can find them in SCVMM by looking for the project name in the description field of the virtual machine.

  5. In Microsoft Test Manager, manually delete any virtual machines that were deleted after the point to which you restored Team Foundation Server.

    These machines are no longer in SCVMM. In both Microsoft Test Manager and Microsoft Environment Viewer, the environment will have a status of Failed, and the virtual machines will have a status as Deleted. If a host was added to a SCVMM host group that was already associated with a project collection, that host will be available for placement the next time that you deploy an environment.

  6. In Microsoft Test Manager, manually delete any hosts that were removed from SCVMM after the point to which you restored Team Foundation Server.

    Because these hosts can no longer run virtual machines and environments, all environments on these hosts will appear as Failed in Microsoft Test Manager and Microsoft Environment Viewer.

  7. Manually reassociate any a host groups that were associated with a project collection and project after the point to which you restored Team Foundation Server.

    The virtual machines on this host group will not be associated with the project.

  8. At the levels of both project collections and projects, manually unassociate any host groups that were unassociated after the point to which you restored Team Foundation Server.

    For more information, see How to: Change the Host Groups for Your Project Collections.

  9. Reassociate any host groups that were associated with a project after the point to which you restored Team Foundation Server.

  10. Reassociate any library shares that were associated with a project after the point to which you restored Team Foundation Server, and reimport all virtual machines and templates that were imported into the project.

Restore the Hyper-V Hosts

If a host that had virtual environments crashed, they will be in a Failed state.

To restore a physical host that was running virtual machines

  1. Restore the host from your backup, and connect it to SCVMM.

    For more information, see the following page on the Microsoft website: Backing Up and Restoring the SCVMM Database.

    If the virtual machines are running again on the host, no additional action is required. Lab Management will update the new status of all running virtual machines to the correct state. If you cannot restore the virtual machines and this host is new, the environments will appear as Failed and the virtual machines as Deleted in Microsoft Test Manager or in Microsoft Environment Viewer.

  2. Refresh Microsoft Test Manager, manually delete the environments that ran on this host, and then re-create them.

    If you must determine the environments that ran on this host, SCVMM provides a list of which virtual machines ran on which host.