• Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • vsphere-cloud-plugin
    • None

      I couldn't help but notice the vSphere cloud plugin has options for restoring snapshots as a build operation, but this feature only works with named snapshots at the moment. I'd like to see this functionality enhanced such that one could restore a VM back to the "last" snapshot (ie: the one used to launch the current instance of the VM).

      The vSphere client and all other vSphere tools have this option, so I suspect there must be a remote API call exposing this exact behavior. That being the case I'd hope it would be a trivial amount of work to implement this feature.

      NOTE: The rationale for this request is, we'd like to have VM cleanup logic done automatically as part of our Jenkins jobs, which would essentially shut down a running VM, restore it back to the 'last' snapshot, then restart it, thus ensuring CI operations that use the VM always start in a consistent state. Further, as the number of VMs increases it becomes difficult to ensure the names of snapshots stays consistent over time so it would be helpful to be able to restore the VM back to the last snapshot without needing to refer to it's name explicitly in the job.

          [JENKINS-31942] Add option to restore latest snapshot

          pjdarton added a comment -

          If you want to always run your jobs on a "clean" VM, define a cloud template as described in the wiki - they're always started in a consistent state.

          leedega if this isn't what you want, could you clarify what it is that you need that the "cloud" functionality doesn't do?

          pjdarton added a comment - If you want to always run your jobs on a "clean" VM, define a cloud template as described in the wiki - they're always started in a consistent state. leedega if this isn't what you want, could you clarify what it is that you need that the "cloud" functionality doesn't do?

          I suspect you may be correct. I think using templates would achieve a similar result to what I was looking for at the time I create this ticket. Honestly it has been so long since I created this feature request I can't recall the specifics of why I created it.

          That being said, the feature request does seem that it should be trivial to implement. I believe the vSphere remote access APIs provide hooks for restring the "current" snapshot (i.e.: the one used to launch the VM most recently). If the implementation details are as simple as I suspect, it may still be worth implementing.

          Kevin Phillips added a comment - I suspect you may be correct. I think using templates would achieve a similar result to what I was looking for at the time I create this ticket. Honestly it has been so long since I created this feature request I can't recall the specifics of why I created it. That being said, the feature request does seem that it should be trivial to implement. I believe the vSphere remote access APIs provide hooks for restring the "current" snapshot (i.e.: the one used to launch the VM most recently). If the implementation details are as simple as I suspect, it may still be worth implementing.

            Unassigned Unassigned
            leedega Kevin Phillips
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: