Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-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 E4A43118A8 for ; Mon, 25 Aug 2014 12:29:28 +0000 (UTC) Received: (qmail 63769 invoked by uid 500); 25 Aug 2014 12:29:28 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 63721 invoked by uid 500); 25 Aug 2014 12:29:28 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 63709 invoked by uid 99); 25 Aug 2014 12:29:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Aug 2014 12:29:28 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of runseb@gmail.com designates 74.125.82.45 as permitted sender) Received: from [74.125.82.45] (HELO mail-wg0-f45.google.com) (74.125.82.45) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Aug 2014 12:29:01 +0000 Received: by mail-wg0-f45.google.com with SMTP id x12so12860851wgg.28 for ; Mon, 25 Aug 2014 05:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=QP0rybNDfu3JgbLIOyvyLABFpW32bCH5uE30G2sS7UE=; b=NhB08db6FDR3YtkcxpENfGuALFGFfMoex2foeRtOXroKCccOrmOhzh+iut9XSMdH9f oekPZupiuBNWCSjvC9DgO5xqbG4F5Gjbq1qBO80dCwffLyjGEQIk7SqCFXj/8kC2X9gO 0/u/lOm8nR0kxVvRw//3/gvEQy5rfGhpYY4aA62FTCDSeCrxbHNvCispviY4DCbh3+jG PPrZ7EV+RnpVaGwQyJqC/0DpcG9En7tyNpZcTDMCWgY1QTNt2WXABcpLFYxwAfr3+8xs TTBDlLUPOXDzXwp1D6ziMFldjQVLhgSHcUVBYDXsP2iqJCW+UMLQMotOnCzYA/aHoLD7 HbpQ== X-Received: by 10.180.100.196 with SMTP id fa4mr15183153wib.1.1408969741112; Mon, 25 Aug 2014 05:29:01 -0700 (PDT) Received: from pc23.home (AMontpellier-552-1-80-35.w92-133.abo.wanadoo.fr. [92.133.191.35]) by mx.google.com with ESMTPSA id ib2sm94776233wjb.49.2014.08.25.05.28.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Aug 2014 05:29:00 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: cloud-init issue From: Sebastien Goasguen In-Reply-To: <53FB2B90.8050903@widodh.nl> Date: Mon, 25 Aug 2014 08:28:59 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: References: <9FB72686-9762-4F52-AA4D-ACA7134FA533@gmail.com> <53FB1AF1.9000704@widodh.nl> <737782029.79410.1408966424951.JavaMail.zimbra@li.nux.ro> <53FB291F.2030206@widodh.nl> <5E3F347D-84CA-4214-8E74-B0B3B5173B25@gmail.com> <53FB2B90.8050903@widodh.nl> To: dev@cloudstack.apache.org X-Mailer: Apple Mail (2.1510) X-Virus-Checked: Checked by ClamAV on apache.org On Aug 25, 2014, at 8:26 AM, Wido den Hollander wrote: > On 08/25/2014 02:25 PM, Sebastien Goasguen wrote: >>=20 >> On Aug 25, 2014, at 8:16 AM, Wido den Hollander = wrote: >>=20 >>> On 08/25/2014 01:33 PM, Nux! wrote: >>>> Thanks Erik! >>>>=20 >>>=20 >>> Indeed! >>>=20 >>>> Hopefully this change will be incorporated soon so we don't need to = patch cloud-init. >>>>=20 >>>=20 >>> I came up with a very small patch: = https://git-wip-us.apache.org/repos/asf?p=3Dcloudstack.git;a=3Dcommitdiff;= h=3D1499972804b6de4fade5c84436e29f9904165e18 >>>=20 >>> Tested it on my local env and worked fine. Both the old and new URL = work with the same output. >>>=20 >>=20 >> thanks folks, I will pull that in 4.3 >>=20 >=20 > Hmm. I didn't make a separate branch as a hotfix for 4.4, so how do we = get this in 4.4.1 as well? >=20 > We shouldn't cherry-pick anymore, right? Ideally no, if you make a hotfix/4.4-7405 branch for it you can ask Daan = to merge it in 4.4 branch I will also merge it in 4.3 >=20 > Wido >=20 >>=20 >>=20 >>> Wido >>>=20 >>>>=20 >>>>=20 >>>> -- >>>> Sent from the Delta quadrant using Borg technology! >>>>=20 >>>> Nux! >>>> www.nux.ro >>>>=20 >>>>=20 >>>> ----- Original Message ----- >>>>> From: "Erik Weber" >>>>> To: "dev" >>>>> Sent: Monday, 25 August, 2014 12:34:10 PM >>>>> Subject: Re: cloud-init issue >>>>>=20 >>>>> On Mon, Aug 25, 2014 at 1:27 PM, Erik Weber = wrote: >>>>>=20 >>>>>> On Mon, Aug 25, 2014 at 1:16 PM, Wido den Hollander = >>>>>> wrote: >>>>>>=20 >>>>>>> On 08/25/2014 12:12 PM, Sebastien Goasguen wrote: >>>>>>>=20 >>>>>>>> Folks, >>>>>>>>=20 >>>>>>>> There is an outstanding issue with cloud-init compatibility. >>>>>>>> The VR serves the instance metadata through a web server but = there is a >>>>>>>> trailing slash issue: >>>>>>>>=20 >>>>>>>> https://issues.apache.org/jira/browse/CLOUDSTACK-7405 >>>>>>>>=20 >>>>>>>> Does anyone know where the settings for this web server are = located in >>>>>>>> the cloudstack code ? >>>>>>>>=20 >>>>>>>>=20 >>>>>>> So I think that is done in systemvm/patches/debian/ >>>>>>> config/opt/cloud/bin/vmdata.py >>>>>>>=20 >>>>>>> It adds a RewriteRule to the .htaccess like: >>>>>>>=20 >>>>>>> entry =3D "RewriteRule ^meta-data/(.+)$ ../" + folder + >>>>>>> "/%{REMOTE_ADDR}/$1 [L,NC,QSA]" >>>>>>>=20 >>>>>>> I'm not a big mod_rewrite guru however. >>>>>>>=20 >>>>>>>=20 >>>>>> Adding a line with "RewriteRule ^meta-data$ ../" + folder >>>>>> +"/%{REMOTE_ADDR}/$1 [L,NC,QSA]" >>>>>> should suffice. >>>>>>=20 >>>>>> small typo there... >>>>>=20 >>>>>=20 >>>>>=20 >>>>>>=20 >>>>>> Tested on a VR with this config: >>>>>>=20 >>>>>> RewriteRule ^meta-data/(.+)$ ../metadata/%{REMOTE_ADDR}/$1 = [L,NC,QSA] >>>>>>=20 >>>>>> RewriteRule ^meta-data/$ ../metadata/%{REMOTE_ADDR}/meta-data = [L,NC,QSA] >>>>>>=20 >>>>>> RewriteRule ^meta-data$ ../metadata/%{REMOTE_ADDR}/meta-data = [L,NC,QSA] >>>>>>=20 >>>>>>=20 >>>>>>=20 >>>>> A better solution is probably to make the last slash conditional, = like this: >>>>> RewriteRule ^meta-data/?$ ../metadata/%{REMOTE_ADDR}/meta-data = [L,NC,QSA] >>>>>=20 >>>>> tested: >>>>> [root@jenkins ~]# curl -I -s 10.30.81.1/latest/meta-data/ | grep = HTTP >>>>>=20 >>>>> HTTP/1.1 200 OK >>>>>=20 >>>>> [root@jenkins ~]# curl -I -s 10.30.81.1/latest/meta-data | grep = HTTP >>>>>=20 >>>>> HTTP/1.1 200 OK >>>>>=20 >>>>> Erik >>>>>=20 >>>=20 >>=20 >=20