On Mon, Aug 25, 2014 at 1:16 PM, Wido den Hollander <w...@widodh.nl> wrote:

> On 08/25/2014 12:12 PM, Sebastien Goasguen wrote:
>
>> Folks,
>>
>> 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:
>>
>> https://issues.apache.org/jira/browse/CLOUDSTACK-7405
>>
>> Does anyone know where the settings for this web server are located in
>> the cloudstack code ?
>>
>>
> So I think that is done in systemvm/patches/debian/
> config/opt/cloud/bin/vmdata.py
>
> It adds a RewriteRule to the .htaccess like:
>
> entry = "RewriteRule ^meta-data/(.+)$  ../" + folder + "/%{REMOTE_ADDR}/$1
> [L,NC,QSA]"
>
> I'm not a big mod_rewrite guru however.
>
>
Adding a line with "RewriteRule ^meta-data$ ../" + folder
+"/%{REMOTE_ADDR}/$1 [L,NC,QSA]"
should suffice.


Tested on a VR with this config:

RewriteRule ^meta-data/(.+)$  ../metadata/%{REMOTE_ADDR}/$1 [L,NC,QSA]

RewriteRule ^meta-data/$  ../metadata/%{REMOTE_ADDR}/meta-data [L,NC,QSA]

RewriteRule ^meta-data$  ../metadata/%{REMOTE_ADDR}/meta-data [L,NC,QSA]


[root@jenkins ~]# curl 10.30.81.1/latest/meta-data

service-offering

availability-zone

local-ipv4

local-hostname

public-ipv4

public-hostname

instance-id

vm-id

public-keys

cloud-identifier


Erik


> Wido
>
>  -sebastien
>>
>>
>

Reply via email to