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 A7A8C9546 for ; Mon, 28 Nov 2011 09:42:43 +0000 (UTC) Received: (qmail 37782 invoked by uid 500); 28 Nov 2011 09:42:43 -0000 Delivered-To: apmail-deltacloud-dev-archive@deltacloud.apache.org Received: (qmail 37670 invoked by uid 500); 28 Nov 2011 09:42:43 -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 37650 invoked by uid 99); 28 Nov 2011 09:42:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Nov 2011 09:42:41 +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 (nike.apache.org: domain of mfojtik@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; Mon, 28 Nov 2011 09:42:35 +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 pAS9gDeR017616 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 28 Nov 2011 04:42:13 -0500 Received: from dhcp-29-121.brq.redhat.com (dhcp-29-121.brq.redhat.com [10.34.29.121]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pAS9gAtM028070 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 28 Nov 2011 04:42:12 -0500 Subject: Re: [jira] [Created] (DTACLOUD-110) Deleting VMs does not work with rhevm backend Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Michal Fojtik In-Reply-To: <497583058.14889.1322411080091.JavaMail.tomcat@hel.zones.apache.org> Date: Mon, 28 Nov 2011 10:43:05 +0100 Cc: deltacloud-dev@incubator.apache.org Content-Transfer-Encoding: quoted-printable Message-Id: <35A580AC-AB3D-4D44-89EC-D4B2713B8385@redhat.com> References: <497583058.14889.1322411080091.JavaMail.tomcat@hel.zones.apache.org> To: dev@deltacloud.apache.org X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Virus-Checked: Checked by ClamAV on apache.org On Nov 27, 2011, at 5:24 PM, Alfredo Moralejo (Created) (JIRA) wrote: Thanks Alfredo! Patch was pushed to SVN. -- Michal > Deleting VMs does not work with rhevm backend > --------------------------------------------- >=20 > Key: DTACLOUD-110 > URL: = https://issues.apache.org/jira/browse/DTACLOUD-110 > Project: DeltaCloud > Issue Type: Bug > Components: Server > Environment: deltacloud 0.4.1 (latest version) > Reporter: Alfredo Moralejo > Assignee: David Lutterkort >=20 >=20 > When trying to delete a VM in a RHEVM backend I get an error: >=20 > curl -u admin@internal:XXXX -X DELETE = http://cf1:3003/api/instances/3930521c-9e71-407b-878d-6ac47fdea78d >=20 > I get following error from backend: >=20 > [root@cf1 core]# /usr/bin/deltacloudd[8324]: = RestClient::BadRequest:400 Bad Request >=20 > According with doc of RHEV-M API in = http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Virtualization/3.0/ht= ml-single/REST_API_Guide/index.html#sect-REST_API_Guide-Common_Features-Re= sources-Deleting_Resources the header must only contain "Accept" and = it's adding Content-Type too. >=20 > I've applied following patch and it's seems to be working fine now: >=20 > diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb = b/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb > index 49f6509..908eae3 100644 > --- a/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb > +++ b/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb > @@ -67,14 +67,19 @@ module RHEVM > end >=20 > def vm_action(id, action, headers=3D{}) > - headers.merge!(auth_header) > - headers.merge!({ > - :content_type =3D> 'application/xml', > - :accept =3D> 'application/xml', > - }) > if action=3D=3D:delete > + headers =3D {} > + headers.merge!(auth_header) > + headers.merge!({ > + :accept =3D> 'application/xml', > + }) > RHEVM::client(@api_entrypoint)["/vms/%s" % id].delete(headers) > else > + headers.merge!(auth_header) > + headers.merge!({ > + :content_type =3D> 'application/xml', > + :accept =3D> 'application/xml', > + }) > begin > client_response =3D = RHEVM::client(@api_entrypoint)["/vms/%s/%s" % [id, = action]].post('', headers) > rescue >=20 >=20 >=20 >=20 > -- > This message is automatically generated by JIRA. > If you think it was sent incorrectly, please contact your JIRA = administrators: = https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa > For more information on JIRA, see: = http://www.atlassian.com/software/jira >=20 >=20 ------------------------------------------------------ Michal Fojtik, mfojtik@redhat.com Deltacloud API: http://deltacloud.org