Migrating to 1.7 - trouble with starting EC2 instances

11 views
Skip to first unread message

SANDER SMITH

unread,
Jun 20, 2010, 6:20:52 PM6/20/10
to typ...@googlegroups.com
I'm migrating from Typica 1.6 to 1.7, and am having some trouble launching EC2 instances. Here's my code:

  LaunchConfiguration launchConfiguration = new LaunchConfiguration(amiName);
  launchConfiguration.setKeyName(keyPair); 
  launchConfiguration.setSecurityGroup(Collections.singletonList(securityGroup));
  launchConfiguration.setAvailabilityZone("us-east-1c");               
  launchConfiguration.setMonitoring(false);
     
  ReservationDescription reservationDescription = jec2.runInstances(launchConfiguration);

When I attempt to run the instance, I get an exception:

  com.xerox.amazonws.ec2.EC2Exception: Client error : The parameter LaunchSpecification is not recognized
     at com.xerox.amazonws.ec2.Jec2.makeRequestInt(Jec2.java:2289)
     at com.xerox.amazonws.ec2.Jec2.runInstances(Jec2.java:648)
        ...

I don't understand what's happening, this code worked beautifully in 1.6. I can't quite figure out what LaunchSpecification is, but it seems to be something related to Spot instances, but I'm not using Spot instances. Anyone have any idea what I should be doing?

Sander

David Kavanagh

unread,
Jun 21, 2010, 1:17:06 PM6/21/10
to typ...@googlegroups.com
I apologize for this. This has been fixed in SVN. The SecurityGroup and UserData were both affected.

David


--
You received this message because you are subscribed to the Google Groups "typica" group.
To post to this group, send email to typ...@googlegroups.com.
To unsubscribe from this group, send email to typica+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/typica?hl=en.


SANDER SMITH

unread,
Jun 22, 2010, 10:46:15 AM6/22/10
to typ...@googlegroups.com
David,
 
Thanks for the info.
 
Is there anything I can do to launch an on-demand instance, or is this just broken in the official release? Any plans on a 1.7.1 release to fix this as it seems like a pretty major bug?
 
Sander


From: David Kavanagh <dkav...@gmail.com>
To: typ...@googlegroups.com
Sent: Mon, June 21, 2010 1:17:06 PM
Subject: Re: [typica] Migrating to 1.7 - trouble with starting EC2 instances

David Kavanagh

unread,
Jun 22, 2010, 10:49:10 AM6/22/10
to typ...@googlegroups.com
Are you talking about spot instances? That is supported and I've done a little testing with it. I think other users have used it, but I don't always hear about successes, mostly just failures. :-)

David

SANDER SMITH

unread,
Jun 22, 2010, 4:55:03 PM6/22/10
to typ...@googlegroups.com
No, I'm not talking about Spot. My plan was to migrate to 1.7 keeping all of the functionality the same and using on-demand instances. Once I was comfortable that 1.7 was working fine, I'd start to implement the code that would also get Spot instances if necessary.
 
Does launching of non-Spot instances work at all, or is there something I could be doing different to make it work. If not, should I just implement for Spot because it's known to work?
 
Sander


From: David Kavanagh <dkav...@gmail.com>
To: typ...@googlegroups.com
Sent: Tue, June 22, 2010 10:49:10 AM

David Kavanagh

unread,
Jun 22, 2010, 5:34:28 PM6/22/10
to typ...@googlegroups.com
Sorry, I've been using EC2 so long that we just call "on demand instances", "instances". If you don't specify user data or security group, it works... so sadly the next best option is working from SVN. As an alternative, I can send you a jar file to drop in. I'd like to get a fix release out, but I have a list of other things I'd also like to see in there and finding the time has been a problem. (for instance, gas line getting installed for stove and dryer tonight and I'm going to chase cat 5e and coax as well.. moving is never ending fun!)

SANDER SMITH

unread,
Jun 25, 2010, 5:18:46 AM6/25/10
to typ...@googlegroups.com
David,
 
Thanks, you are correct. When I remove references to user data and security groups my on demand instances launch correctly on 1.7. I appreciate your offer to build me a jar - not necessary.
 
I've now gone and tried to implement Spot on 1.7, and am a bit confused by the interface. With on demand instances, I simply call runInstances(LaunchConfiguration lc) and we're good to go. With Spot, it doesn't look as simple, it looks like you must reserve, then start, then ??? I'm not even sure if there's a synchronous way to do this since you must wait for Amazon to reserve and set everything up for you. Anyone have a good example of code to launch a Spot instance, or a pointer to how to do it?
 
BTW, I had a long conversation the other day with the AWS guys about bumping up my instance cap, and the term "on demand instance" was his, so I guess that's the "official" Amazon way to distinguish from Spot instances.
 
Sander



From: David Kavanagh <dkav...@gmail.com>
To: typ...@googlegroups.com
Sent: Tue, June 22, 2010 5:34:28 PM
Reply all
Reply to author
Forward
0 new messages