Skip to content

[JENKINS-44796] Retry deletion of unwanted VMs#77

Merged
pjdarton merged 3 commits intojenkinsci:masterfrom
pjdarton:retry_deleting_unwanted_vm
Jul 28, 2017
Merged

[JENKINS-44796] Retry deletion of unwanted VMs#77
pjdarton merged 3 commits intojenkinsci:masterfrom
pjdarton:retry_deleting_unwanted_vm

Conversation

@pjdarton
Copy link
Copy Markdown
Member

Not every attempt to communicate with vSphere succeeds. Sometimes we fail to create a VM, sometimes we fail to destroy a VM. If we fail to create one, the existing logic will try again, as Jenkins will keep asking for new VMs.
If we failed to delete one, we used to merely log the failure exception and then forget about it, which could result in unused VMs running in vSphere.

This code change adds extra in-memory state so that we remember a list of all the VMs that we want to delete until we are sure that we have deleted them, and we keep trying to delete unwanted VMs until we've got rid of them.

pjdarton added 2 commits June 28, 2017 16:45
When CloudProvisioningAlgorithm, CloudProvisioningRecord and
CloudProvisioningState were added, they were mistakenly added with CRLF end of
line codes, which makes future "diff" operations difficult (as they often show
as "entire file contents removed and replaced with new file contents").
This commit changes the end-of-line codes from CRLF to LF - no other changes made.
Not every attempt to communicate with vSphere succeeds.  Sometimes we fail to
create a VM, sometimes we fail to destroy a VM.  If we fail to create one, the
existing logic will try again, as Jenkins will keep asking for new VMs.
If we failed to delete one, we used to merely log the failure exception and
then forget about it, which could result in unused VMs running in vSphere.

This code change adds extra in-memory state so that we remember a list of all
the VMs that we want to delete until we are sure that we have deleted them,
and we keep trying to delete unwanted VMs until we've got rid of them.
@pjdarton pjdarton changed the title Retry deletion of unwanted VMs [JENKINS-44796] Retry deletion of unwanted VMs Jun 29, 2017
JENKINS-42187 applies to us too; same cause, same fix.
So we avoid trying to delete VMs in-line with the slave's
terminate method and instead schedule deletion for later.
@pjdarton pjdarton merged commit f3c7aac into jenkinsci:master Jul 28, 2017
@pjdarton pjdarton deleted the retry_deleting_unwanted_vm branch July 28, 2017 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant