Return-Path: X-Original-To: apmail-incubator-deltacloud-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-deltacloud-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 112EB6E32 for ; Thu, 9 Jun 2011 19:41:35 +0000 (UTC) Received: (qmail 29845 invoked by uid 500); 9 Jun 2011 19:41:34 -0000 Delivered-To: apmail-incubator-deltacloud-dev-archive@incubator.apache.org Received: (qmail 29828 invoked by uid 500); 9 Jun 2011 19:41:34 -0000 Mailing-List: contact deltacloud-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltacloud-dev@incubator.apache.org Delivered-To: mailing list deltacloud-dev@incubator.apache.org Received: (qmail 29820 invoked by uid 99); 9 Jun 2011 19:41:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2011 19:41:34 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of clalance@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2011 19:41:29 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p59Jf898031878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 Jun 2011 15:41:08 -0400 Received: from localhost.localdomain.com (dhcp-100-19-47.bos.redhat.com [10.16.19.47]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p59Jf7xA011873; Thu, 9 Jun 2011 15:41:07 -0400 From: Chris Lalancette To: deltacloud-dev@incubator.apache.org Cc: clalance@redhat.com Subject: [PATCH] Remove EC2 instance tagging and load balancer registering. Date: Thu, 9 Jun 2011 15:41:07 -0400 Message-Id: <1307648467-11920-1-git-send-email-clalance@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 During an EC2 create_instance call, two optional things might be done; tagging the instance with the name provided, and registering the new instance with a loadbalancer. Unfortunately, there is a big problem with this; the instance ID does not always exist immediately after the ec2.launch_instances call returns. This seems to be a generic problem with EC2, as I've run into it several times. Because of this, we *cannot* tag the instance or register the instance with the load balancer right within the create_instance call, since we can't be sure the instance ID yet exists. Luckily, the loss of either function shouldn't be that huge; the name can never be retrieved (since there is no generic tag support), and you can always register an instance with a load balancer later. Therefore, totally remove these operations from create. Not only does this make create_instance more reliable, it restores the "one deltacloud API -> one cloud backend call" semantic that we try to preserve. Signed-off-by: Chris Lalancette --- server/lib/deltacloud/drivers/ec2/ec2_driver.rb | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-) diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb index 4edd989..d01113c 100644 --- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb +++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb @@ -214,16 +214,6 @@ module Deltacloud end safely do new_instance = convert_instance(ec2.launch_instances(image_id, instance_options).first) - # TODO: Rework this to use client_id for name instead of tag - # Tags should be keept as an optional feature - tag_instance(credentials, new_instance, opts[:name]) - # Register Instance to Load Balancer if load_balancer_id is set. - # This parameter is a feature parameter - if opts[:load_balancer_id] and opts[:load_balancer_id]!="" - lb = lb_register_instance(credentials, - {'id' => opts[:load_balancer_id], - 'instance_id' => new_instance.id}) - end new_instance end end -- 1.7.4.4