Skip to content

Clean up old VM instances after a jenkins restart #391

@bdattoma

Description

@bdattoma

What feature do you want to see added?

Context
We have an Openstack VM configured in jenkins casc.yaml to have a minimum instance number of 1.

Problem
After we restart Jenkins (i.e., rollout the Jenkins pod or kill and start the container), the plugin launches a new VM instance and leave the old one running in the cloud. This is making things difficult to manage given that we end up with multiple long running VMs which are never used.

Request
Would it be possible either:

  1. clean up the old VMs after jenkins is restarted - maybe the plugin could filter the VMs present in the cloud using the VM labels (e.g., JENKINS_URL or something else)
  2. capture the jenkins restart/stop and send a termination signal to the VMs - although, even if doable, it may not work with containerized jenkins
  3. maybe some other options i'm not thinking about

Additional Info

Upstream changes

No response

Are you interested in contributing this feature?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions