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

ec2-plugin doesn't allow for multiple EC2 clouds to be configured

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • ec2-plugin
    • None

      When using the ec2-plugin, we configured a connection to EC2 as well as a Eucalyptus cloud. When we tried some operations on the Eucalyptus cloud (specifically looking at logs of an instance or terminating an instance), we get an error;
      Jan 25, 2012 9:44:17 AM hudson.plugins.ec2.EC2Slave terminate
      WARNING: Failed to terminate EC2 instance: i-CCA241AF
      com.xerox.amazonws.ec2.EC2Exception: Client error : The instance ID 'i-cca241af' does not exist
      at com.xerox.amazonws.ec2.Jec2.makeRequestInt(Jec2.java:2359)
      at com.xerox.amazonws.ec2.Jec2.terminateInstances(Jec2.java:776)
      at hudson.plugins.ec2.EC2Slave.terminate(EC2Slave.java:95)
      at hudson.plugins.ec2.EC2Computer.doDoDelete(EC2Computer.java:103)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)

      Eucalyptus never generates this error message. I ran tests with euca2ools and typica to reproduce this error and supplying upper or lower case instance ids never caused this error to come back.
      Looking at the ec2-plugin code (EC2Cloud.java), there's a method get() which returns an EC2Cloud instance. The code will only retrieve a cloud of the class EC2Cloud which precluded having more than one cloud of that type registered.
      public static EC2Cloud get()

      { return Hudson.getInstance().clouds.get(EC2Cloud.class); }

      If the intention is to allow more than one cloud of a specific type to be used at the same time, this should be addressed.

            esmalling Eric Smalling
            dkavanagh David Kavanagh
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: