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

Vsphere cloud plugin won't revert to a snapshot

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • vsphere-cloud-plugin
    • None
    • Running jenkins 1.504 on RHEL5 and vsphere-cloud-plugin 0.10 . vsphere client 4.1.0 and ESXi 4.1.0

      Steps to reproduce :

      • Create a new cloud in jenkins settings
      • Create a new slave to use the cloud configured earlier with a machine name * And a snapshot name to revert to on launch (force vm launch = true)
      • Test the configuration and get "Virtual Machine found successfully"
      • Launch the slave and nothing is written to the log. just the animated sphere is rolling but nothing there
      • Note: This happens only when setting a snapshot. without a snapshot everything works fine.

      Check with Jenkins log file and see the following loop:

      INFO: [vsphere] Starting Virtual Machine...
      Mar 6, 2013 10:24:21 AM org.jenkinsci.plugins.vSphereCloud InternalLog
      INFO: [vsphere] Reverting to snapshot:michael
      Mar 6, 2013 10:26:21 AM hudson.slaves.SlaveComputer tryReconnect
      INFO: Attempting to reconnect vsphere

      Looking at vsphere events, I can see the user logs in and logs out, If I look into the specific machine events list I don't see anything.

      Also tried, as suggested by plugin owner, to Set the slave to no snapshot. Get it running and connected. Then, while connected, set the snapshot to a valid value. Also, set the "What to do when the slave is disconnected" to "Shutdown and Revert". Then disconnect the slave (kill the slave agent or hit Disconnect in Jenkins). See if both the power down AND revert commands are sent to the VM by looking at the vSphere task list.

      Results: from Jenkins log file i see :

      INFO: [vsphere] Running disconnect procedure...
      Mar 6, 2013 10:19:50 AM org.jenkinsci.plugins.vSphereCloud InternalLog
      INFO: [vsphere] Shutting down Virtual Machine...
      Mar 6, 2013 10:19:50 AM org.jenkinsci.plugins.vSphereCloud InternalLog
      INFO: [vsphere] Powering down hard
      Mar 6, 2013 10:19:50 AM org.jenkinsci.plugins.vSphereCloud InternalLog
      INFO: [vsphere] Got an exception
      Mar 6, 2013 10:19:50 AM org.jenkinsci.plugins.vSphereCloud InternalLog
      INFO: [vsphere] com.vmware.vim25.RestrictedVersion
      Mar 6, 2013 10:19:50 AM org.jenkinsci.plugins.vSphereCloud InternalLog
      INFO: [vsphere] Printed exception
      Mar 6, 2013 10:19:50 AM hudson.remoting.Channel$2 handle
      SEVERE: Failed to execute command close (channel vsphere)
      java.lang.NullPointerException
              at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
              at java.util.regex.Matcher.reset(Matcher.java:291)
              at java.util.regex.Matcher.<init>(Matcher.java:211)
              at java.util.regex.Pattern.matcher(Pattern.java:888)
              at java.util.Formatter.parse(Formatter.java:2458)
              at java.util.Formatter.format(Formatter.java:2414)
              at java.util.Formatter.format(Formatter.java:2367)
              at java.lang.String.format(String.java:2769)
              at hudson.util.StreamTaskListener.fatalError(StreamTaskListener.java:153)
              at org.jenkinsci.plugins.vSphereCloudLauncher.afterDisconnect(vSphereCloudLauncher.java:335)
              at hudson.slaves.SlaveComputer$2.onClosed(SlaveComputer.java:419)
              at hudson.remoting.Channel.terminate(Channel.java:749)
              at hudson.remoting.Channel$CloseCommand.execute(Channel.java:850)
              at hudson.remoting.Channel$2.handle(Channel.java:435)
              at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:60)
      Mar 6, 2013 10:19:50 AM hudson.remoting.Channel$2 handle
      SEVERE: This command is created here
      Command close created at
              at hudson.remoting.Command.<init>(Command.java:56)
              at hudson.remoting.Channel$CloseCommand.<init>(Channel.java:844)
              at hudson.remoting.Channel$CloseCommand.<init>(Channel.java:842)
              at hudson.remoting.Channel.close(Channel.java:909)
              at hudson.remoting.Channel.close(Channel.java:892)
              at hudson.remoting.Channel$CloseCommand.execute(Channel.java:849)
              at hudson.remoting.Channel$2.handle(Channel.java:435)
              at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:60)
      Mar 6, 2013 10:20:21 AM hudson.slaves.SlaveComputer tryReconnect
      INFO: Attempting to reconnect vsphere
      Mar 6, 2013 10:20:21 AM org.jenkinsci.plugins.vSphereCloud InternalLog
      INFO: [vsphere] Starting Virtual Machine...
      Mar 6, 2013 10:20:21 AM org.jenkinsci.plugins.vSphereCloud InternalLog
      INFO: [vsphere] Reverting to snapshot:michael

      From the vsphere event list i don't see the shut down event or the snapshot

            Unassigned Unassigned
            miked michael d
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: