Team Services | TFS 2017 | TFS 2015 | Previous versions
This example shows how you can integrate System Center Virtual Machine Manager (SCVMM) with Release Management in Visual Studio Team Services or Team Foundation Server. You can restore virtual machines managed by SCVMM to a clean snapshot and then deploy your apps to them.
You will need a minimum of two machines - a target server or virtual machine to deploy to, and an agent machine that drives the deployment. You may have multiple target servers depending on how many nodes you want to deploy to. However, you only need one agent machine to drive the deployment.
Install the System Center Virtual Machine Manager (SCVMM) extension from Visual Studio Marketplace into your server or account.
Install an agent on the agent machine:
Create an SCVMM service endpoint in your team project:
Open your Team Services or TFS team project in your web browser. Choose the Settings icon in the menu bar and select Services.
In the Services tab, choose New Service Endpoint, and select SCVMM.
In the Add new SCVMM Connection dialog, enter the values required to connect to the SCVMM Server:
- Connection Name: Enter a user-friendly name for the service endpoint such as MySCVMMServer.
- SCVMM Server Name: Enter the fully qualified domain name and port number of the SCVMM server, in the form machine.domain.com:port.
- Username and Password: Enter the credentials required to connect to the vCenter Server. Username formats such as username, domain\username, machine-name\username, and .\username are supported. UPN formats such as firstname.lastname@example.org and built-in system accounts such as NT Authority\System are not supported.
Choose OK to save the settings and create the connection.
Open the Releases tab of the Build & Release hub and choose the "+" icon to create a new release definition.
In the Create release definition dialog, select the Empty template and choose Next.
In the next page, select Choose Later and then choose Create. This creates a new release definition with one default environment and no linked artifacts.
Choose + Add tasks and add an SCVMM task from the Deploy section of the Task catalog dialog to the environment.
To configure the SCVMM task to restore a virtual machine that is already managed in SCVMM to a snapshot, use the following settings:
Task step Parameters
Connect to a SCVMM server and perform actions on Virtual Machine(s).
SCVMM Service Connection: Select the SCVMM connection you created earlier.
Virtual Machine Names: Enter the names of one or more target virtual machines. Separate multiple names with a comma; for example,
Checkpoint Name: Enter the name of the checkpoint that will be applied to the virtual machines. This checkpoint must exist.
Select VMs from: Optional. You can specify a filter to scope the source for virtual machines to either
HOST. Leave it set to
You can now add other tasks to the environment, such as PowerShell on Target Machines and then deploy to the newly provisioned machines.
In the future we plan for the SCVMM task to provide an output variable that you set in the task and then use as input to subsequent tasks. Until then, if you want to run additional tasks, you'll need to specify the fully-qualified domain names of the virtual machines that are provisioned in SCVMM.
Type a name for the new release definition and save it.
Create a new release from the release definition and deploy it to the environment.