Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-38125

If the build results in FAILURE, Jenkins don't destroy the vagrant VM

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • vagrant-plugin
    • None
    • Jenkins 2.17
      Vagrant plugin 1.0.2
      Debian Jessie 64 bits

      Hello,

      my workflow is the following:

      • pull a Git repository
      • build environment
        • boot up vagrant VM
        • run some scripts in the VM (which installs and runs our provisioning tool)
        • run tests on our application in the VM
        • destroy the VM
      • post-build tasks

      My actual problem is that when tests results in FAILURE, the VM never gets destroyed, so my Vagrant KVM server is filling with old VM which are not used anymore.

      As my VM name is dynamically generated, I can't destroy it on the next build, so I'm stuck to destroy the VM outside of Jenkins.

      I wonder if it could be possible to have a "destroy VM" step in the post-builds actions?

      Thanks

            sparko Michal Vala
            daks Eric Veiras
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: