Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds a
JenkinsTemplateTag
tag to the ARM templates for creating the virtual machines in Azure with the value of the template name. Fixes #563 and Fixes #378.With existing state, whenever
AzureVMManagementServiceDelegate.getVirtualMachineCountsByTemplate()
is run, it is looking for this tag to build a map to track the number of existing agents (lines 1843-1854). Since this tag does not exist, the resulting map does not correctly reflect the count of VMs which exist.Testing done
First started creating a Jenkins server using the existing released version of the plugin. Confirmed we were able to reproduce the error, in this case by running multiple pipelines scoped to the agent label with a configured maximum template limit of 1. Was able to successfully reproduce the issue.
Built and installed plugin with existing code into same instance of Jenkins and recreated the agents. Performed same test as above, and only 1 agent was able to be created. I confirmed the presence of log messages similar to the following:
Wanted to create 1 nodes from template jnksagtqa3 but cannot create any, have template limit of 1 but have 1 VMs already so we can have 0 more, currently have 1 VMs in cloud
. Continued to run this to ensure we meet a scheduled run of the verification task, which would historically break the counts.The templates used are configured with a custom image, managed disks, and startup script. This means
customImageTemplateWithScriptAndManagedDisk.json
is the main template tested so far.Submitter checklist