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

vSphere Cloud Deploy VM from Template - Requires snapshot of template, not possible in vSphere 5.5

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • vsphere-cloud-plugin
    • None
    • Cloudbees Enterprise 14.05 (Jenkins 1.554.2.2) running in stock Jetty container on CentOS 7
      vSphere Plugin 1.1.11
      vSphere 5.5 (Enterprise Plus)

      When attempting to configure a job with a "Deploy VM from Template" build step, the user is prompted to enter "The name of the vSphere template to clone and start."

      The documentation for the vSphere Cloud Plugin says, "This build step will create a VM from the specified template. The template must have at least one snapshot before it can be cloned." And the plugin's form validation requires that a snapshot exist.

      However, there does not seem to be a way to create a snapshot of a template in vSphere 5.5, so this condition cannot be met.

          [JENKINS-24661] vSphere Cloud Deploy VM from Template - Requires snapshot of template, not possible in vSphere 5.5

          Not clear for me. Why template should has snapshot? I dont have permission make snapshot in huge data center where templates done by IT department.

          Igor Tereshchuk added a comment - Not clear for me. Why template should has snapshot? I dont have permission make snapshot in huge data center where templates done by IT department.

          pjdarton added a comment -

          pjdarton added a comment - See https://github.com/jenkinsci/vsphere-cloud-plugin/pull/52 (and JENKINS-24605 )

          Code changed in jenkins
          User: Jason Swager
          Path:
          src/main/java/org/jenkinsci/plugins/vsphere/builders/Deploy.java
          http://jenkins-ci.org/commit/vsphere-cloud-plugin/ef95e6f6fcf9777997b8eb4b95d862af0026b99f
          Log:
          Merge pull request #52 from pjdarton/fix_jenkins_24605

          Fix JENKINS-24605 and JENKINS-24661

          Compare: https://github.com/jenkinsci/vsphere-cloud-plugin/compare/cf3f8a8f8c0f...ef95e6f6fcf9

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jason Swager Path: src/main/java/org/jenkinsci/plugins/vsphere/builders/Deploy.java http://jenkins-ci.org/commit/vsphere-cloud-plugin/ef95e6f6fcf9777997b8eb4b95d862af0026b99f Log: Merge pull request #52 from pjdarton/fix_jenkins_24605 Fix JENKINS-24605 and JENKINS-24661 Compare: https://github.com/jenkinsci/vsphere-cloud-plugin/compare/cf3f8a8f8c0f...ef95e6f6fcf9

          pjdarton added a comment -

          Pull request has been merged.
          It'll be fixed in the next release.

          pjdarton added a comment - Pull request has been merged. It'll be fixed in the next release.

          pjdarton added a comment -

          My previous commit only dealt with part of the problem.
          To actually have a "cloud slave" that uses a Template as its "master image" requires further changes, as the "cloud slave" functionality called the cloneVm method which requires a VM (not a Template) that contains at least on snapshot (and Templates don't have snapshots).

          pjdarton added a comment - My previous commit only dealt with part of the problem. To actually have a "cloud slave" that uses a Template as its "master image" requires further changes, as the "cloud slave" functionality called the cloneVm method which requires a VM (not a Template) that contains at least on snapshot (and Templates don't have snapshots).

          pjdarton added a comment -

          The "cloud-slave" problem (that I mentioned in my previous comment) is extending the remit of this issue a bit (the original issue description was only referring to the build step), but it's the same underlying problem - templates can't have snapshots.
          However, I've got a fix for it: https://github.com/jenkinsci/vsphere-cloud-plugin/pull/58

          This allows a cloud-slave-template to be based on a vSphere Template.
          Previously, it was only possible to base a cloud-slave-template on a vSphere Virtual Machine that had at least one Snapshot.

          I believe that this change renders the code "template-safe"

          pjdarton added a comment - The "cloud-slave" problem (that I mentioned in my previous comment) is extending the remit of this issue a bit (the original issue description was only referring to the build step), but it's the same underlying problem - templates can't have snapshots. However, I've got a fix for it: https://github.com/jenkinsci/vsphere-cloud-plugin/pull/58 This allows a cloud-slave-template to be based on a vSphere Template. Previously, it was only possible to base a cloud-slave-template on a vSphere Virtual Machine that had at least one Snapshot. I believe that this change renders the code "template-safe"

          Code changed in jenkins
          User: Jason Swager
          Path:
          src/main/java/org/jenkinsci/plugins/vSphereCloudSlaveTemplate.java
          src/main/java/org/jenkinsci/plugins/vsphere/RunOnceCloudRetentionStrategy.java
          src/main/java/org/jenkinsci/plugins/vsphere/VSphereCloudRetentionStrategy.java
          src/main/java/org/jenkinsci/plugins/vsphere/tools/CloudProvisioningRecord.java
          src/main/java/org/jenkinsci/plugins/vsphere/tools/VSphere.java
          src/main/resources/org/jenkinsci/plugins/vSphereCloudSlaveTemplate/config.jelly
          src/main/resources/org/jenkinsci/plugins/vSphereCloudSlaveTemplate/help-linkedClone.html
          src/main/resources/org/jenkinsci/plugins/vSphereCloudSlaveTemplate/help-masterImageName.html
          src/main/resources/org/jenkinsci/plugins/vSphereCloudSlaveTemplate/help-snapshotName.html
          src/main/resources/org/jenkinsci/plugins/vSphereCloudSlaveTemplate/help-useSnapshot.html
          src/test/java/org/jenkinsci/plugins/vsphere/tools/CloudProvisioningAlgorithmTest.java
          src/test/java/org/jenkinsci/plugins/vsphere/tools/CloudProvisioningStateTest.java
          http://jenkins-ci.org/commit/vsphere-cloud-plugin/dd3f70f41b06ac2ab3e02996f924a73f15850911
          Log:
          Merge pull request #58 from pjdarton/refix_jenkins_24661

          Re-fix JENKINS-24661

          Compare: https://github.com/jenkinsci/vsphere-cloud-plugin/compare/e712d531c7d0...dd3f70f41b06

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jason Swager Path: src/main/java/org/jenkinsci/plugins/vSphereCloudSlaveTemplate.java src/main/java/org/jenkinsci/plugins/vsphere/RunOnceCloudRetentionStrategy.java src/main/java/org/jenkinsci/plugins/vsphere/VSphereCloudRetentionStrategy.java src/main/java/org/jenkinsci/plugins/vsphere/tools/CloudProvisioningRecord.java src/main/java/org/jenkinsci/plugins/vsphere/tools/VSphere.java src/main/resources/org/jenkinsci/plugins/vSphereCloudSlaveTemplate/config.jelly src/main/resources/org/jenkinsci/plugins/vSphereCloudSlaveTemplate/help-linkedClone.html src/main/resources/org/jenkinsci/plugins/vSphereCloudSlaveTemplate/help-masterImageName.html src/main/resources/org/jenkinsci/plugins/vSphereCloudSlaveTemplate/help-snapshotName.html src/main/resources/org/jenkinsci/plugins/vSphereCloudSlaveTemplate/help-useSnapshot.html src/test/java/org/jenkinsci/plugins/vsphere/tools/CloudProvisioningAlgorithmTest.java src/test/java/org/jenkinsci/plugins/vsphere/tools/CloudProvisioningStateTest.java http://jenkins-ci.org/commit/vsphere-cloud-plugin/dd3f70f41b06ac2ab3e02996f924a73f15850911 Log: Merge pull request #58 from pjdarton/refix_jenkins_24661 Re-fix JENKINS-24661 Compare: https://github.com/jenkinsci/vsphere-cloud-plugin/compare/e712d531c7d0...dd3f70f41b06

          pjdarton added a comment -

          Fixed in the next release.

          pjdarton added a comment - Fixed in the next release.

          when you suppose release new version?

          Igor Tereshchuk added a comment - when you suppose release new version?

          pjdarton added a comment -

          Fixed in 2.14, released Oct 27th 2016.

          pjdarton added a comment - Fixed in 2.14, released Oct 27th 2016.

            Unassigned Unassigned
            jazze Jason Azze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: