skip to Main Content

I have 2 parallel jobs allowed by Azure DevOps (private project, 1 default + 1 for Visual Studio subscription). I have a stage with ~20 jobs with no interdependencies. I have a VMSS-based agent pool with max pool size set to 4 machines. And still only one job is running at a time – even though I see 2 or even 4 VMs in the VMSS.

Although it must be noted that I only see one entry in the agent pool with the name of the VMSS itself, not the machines it spawned. Maybe this is the issue, but I don’t know how to fix this.

I created the VMSS with the script.

$nsg = Get-AzNetworkSecurityGroup -Name $nsgName -ResourceGroupName $rg
$ipConfig = New-AzVmssIpConfig -Name 'publicIp' -SubnetId $vnet.Subnets[0].Id -PublicIpAddressConfigurationName 'publicIp' -Primary
$vmssConfig = New-AzVmssConfig -Location $location -LicenseType 'Windows_Client' `
    -SkuName $machineSize -SkuTier 'Standard' -SkuCapacity 0 -SecurityType 'TrustedLaunch' `
    -OrchestrationMode 'Uniform' -Overprovision $false -IdentityType 'SystemAssigned' -UpgradePolicyMode 'Manual' `
    -SinglePlacementGroup $false -PlatformFaultDomainCount 1 `
| Set-AzVmssStorageProfile -OsDiskCreateOption 'FromImage' `
    -ImageReferenceId $image.Id `
    -DiffDiskSetting Local -DiffDiskPlacement ResourceDisk -OsDiskCaching ReadOnly -OsDiskOsType Windows `
| Add-AzVmssNetworkInterfaceConfiguration -Name $nicName -Primary $true -NetworkSecurityGroupId $nsg.Id `
    -IPConfiguration $ipConfig -EnableAcceleratedNetworking

$vmss = New-AzVmss -ResourceGroupName $rg -VMScaleSetName $scaleSetName -VirtualMachineScaleSet $vmssConfig

2

Answers


  1. Chosen as BEST ANSWER

    My problem was that the image I was using for VMSS was specialized, as it was given in the Microsoft documentation. This produced agents with the same computer name. So when registering them, the agent pool believed it only had one machine to work with.

    Converting the image to generalized remedied the issue.

    Due to the sparse documentation, it took me almost a day to create the Powershell script for this, and it's still not working correctly, so I have to execute some commands manually on a VM. But basically, I clone the source VM and then run a generalization command sysprep on it, and then use that image for VMSS.


  2. According to Configure and pay for parallel jobs,

    For each active Visual Studio Enterprise subscriber who is a member of your organization, you get one additional self-hosted parallel job.

    You need to ensure the type of your VS Subscription is Enterprise. If it is, the access level of your account will be VS Enterprise subscription. You can go to Organization Settings -> Users -> search and find your account from the user list -> Check your access level.

    Besides, you can check the parallel jobs in your organization from Organization Settings -> Pipelines -> Parallel jobs.

    In the following example, there are three Visual Studio Enterprises in the organization, so you can see that for the private project, there are four self-hosted parallel jobs.

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search