Return-Path: X-Original-To: apmail-deltacloud-dev-archive@www.apache.org Delivered-To: apmail-deltacloud-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 989D9D33A for ; Fri, 2 Nov 2012 10:08:28 +0000 (UTC) Received: (qmail 54156 invoked by uid 500); 2 Nov 2012 10:08:28 -0000 Delivered-To: apmail-deltacloud-dev-archive@deltacloud.apache.org Received: (qmail 54123 invoked by uid 500); 2 Nov 2012 10:08:28 -0000 Mailing-List: contact dev-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list dev@deltacloud.apache.org Received: (qmail 54093 invoked by uid 99); 2 Nov 2012 10:08:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2012 10:08:27 +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 mandreou@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; Fri, 02 Nov 2012 10:08:21 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA2A7xhe027161 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 2 Nov 2012 06:07:59 -0400 Received: from [10.36.112.23] (ovpn-112-23.ams2.redhat.com [10.36.112.23]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qA2A7vkX023528; Fri, 2 Nov 2012 06:07:58 -0400 Message-ID: <50939B7C.2000500@redhat.com> Date: Fri, 02 Nov 2012 12:07:56 +0200 From: "marios@redhat.com" User-Agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 MIME-Version: 1.0 To: dev@deltacloud.apache.org CC: Ian Main Subject: Re: [PATCH] Set name in hardware profile in openstack driver. References: <1351794469-14705-1-git-send-email-imain@redhat.com> In-Reply-To: <1351794469-14705-1-git-send-email-imain@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Virus-Checked: Checked by ClamAV on apache.org Hi Ian: On 01/11/12 20:27, Ian Main wrote: > Name was not being set which is crucial for heat usage. > patch looks fine - in the sense that there is no problem for us to grab the 'name' of a flavor being passed back from Openstack and expose this as the 'name' attribute of a hardware_profile. HOWEVER, it is not possible to then use this 'name' attribute as a reference to a hardware profile. For example, lets say there is a flavor with ID: 1 and name: "256_MB_and_1_CPU": (against Deltacloud): GET /api/hardware_profiles/1 ==> 200 OK GET /api/hardware_profiles/256 MB and 1 CPU ==> explosions. Can you explain why is crucial for heat to have 'name'. If you really need to have lookup/reference to hardware profile by descriptive name, its possible but we need to change the deltacloud code. So that GET "256_MB_and_1_CPU" would mean getting a list of all flavors and filtering for the one with that name. Only issue here though is that :id is a bona-fide UUID whereas :name is just a string. I wonder if there can be duplicates? thanks, marios > Signed-off-by: Ian Main > --- > server/lib/deltacloud/drivers/openstack/openstack_driver.rb | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb > index 5b29840..5c40425 100644 > --- a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb > +++ b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb > @@ -363,12 +363,14 @@ private > > def convert_from_flavor(flavor) > op = (flavor.class == Hash)? :fetch : :send > - HardwareProfile.new(flavor.send(op, :id).to_s) do > + hwp = HardwareProfile.new(flavor.send(op, :id).to_s) do > architecture 'x86_64' > memory flavor.send(op, :ram).to_i > storage flavor.send(op, :disk).to_i > cpu flavor.send(op, :vcpus).to_i > end > + hwp.name = flavor.send(op, :name) > + return hwp > end > > def convert_from_image(image, owner) >