TFS 2017 prevent two build agents from restoring the same image with the SCVMM task

85 views Asked by At

I have multiple images managed by SCVMM 2016. I have a build agent that starts and restore one of multiple images using SCVMM then deploys the testagent on this image and starts tests. At the end the Image will be shutdown.

I want to add multiple build agents so I can run tests paralell, how can I prevent two build agents from restoring the same image.

The only idee I head was adding a requirement with the name of the machine. So only that agent would use this machine. But that would require a build agent per image.

1

There are 1 answers

4
Andy Li-MSFT On BEST ANSWER

If you just want to run tests paralell, you can restore multiple VMs and deploy the test agent for each of them. Multiple build agents are not needed.

Assuming the "images" you said are the Checkpoints which shown in SCVMM task.

You can create a release definition with multiple environments set, then restore the image and deploy the test agent separately, or in build definition add the SCVMM task multiple times to restore the image separately.

In the task you can select the Virtual Machine Names and specify the specific Checkpoint Name. So, they will not restore the same image. If that doesn't work, you can also try to use the Action "New Virtual Machine using Template" to create a new machine for deploying the test agent.

Please correctly me if I misunderstand.

enter image description here