[one-users] EC2 urls

Daniel Molina dmolina at opennebula.org
Fri Nov 4 10:28:33 PDT 2011


Hi Robert,

On 28 October 2011 17:05, Robert Parrott <parrott at seas.harvard.edu> wrote:
> Hi Folks,
>
> I have a question about EC2 url formats with the econe-server.
>
> I'd like to map queries to the econe service from apache to
> localhost:4567, using a URL of the form
>
>  https://my-opennebula-host/ec2/  --> http://localhost:4567/
>
> This way the endpoints for the services would be on one port (443).
>
> But I can't seem to make any headway with that. Is this possible using
> econe-server?

Some changes are needed in the econe code in order to support this
kind of URLs. I will open a ticket for this feature.

I have tested the following configuration and it works for me.

 * Apache configuration:
-------------------------------------------
<Location /ec2/>
ProxyPass          http://localhost:4567/
ProxyPassReverse   http://localhost:4567/
</Location>

 * econe configuration:
-------------------------------------------
# Host and port where econe server will run
:server: localhost
:port: 4567

# SSL proxy that serves the API (set if is being used)
:ssl_server: my-opennebula-host

 * Code changes (to add path support, in this case the path is
hardcoded "/ec2/":
-------------------------------------------
diff --git a/src/cloud/common/CloudAuth/EC2CloudAuth.rb
b/src/cloud/common/CloudAuth/EC2CloudAuth.rb
index e60f653..9c07f1a 100644
--- a/src/cloud/common/CloudAuth/EC2CloudAuth.rb
+++ b/src/cloud/common/CloudAuth/EC2CloudAuth.rb
@@ -68,7 +68,8 @@ module EC2CloudAuth
        canonical_str = AWS.canonical_string(
                                params,
                                server_str,
-                                env['REQUEST_METHOD'])
+                                env['REQUEST_METHOD'],
+                                '/ec2/')

diff --git a/src/cloud/ec2/lib/EC2QueryClient.rb
b/src/cloud/ec2/lib/EC2QueryClient.rb
index f39e525..3b52900 100644
--- a/src/cloud/ec2/lib/EC2QueryClient.rb
+++ b/src/cloud/ec2/lib/EC2QueryClient.rb
@@ -76,7 +76,8 @@ module EC2QueryClient
                :secret_access_key => @access_key_secret,
                :server            => @uri.host,
                :port              => @uri.port,
-                :use_ssl           => @uri.scheme == 'https')
+                :use_ssl           => @uri.scheme == 'https',
+                :path              => @uri.path)
        end

 * Request:
-------------------------------------------
$ econe-describe-images -K user -S sha1_password -U
https://my-opennebula-host/ec2/


Tested using OpenNebula git master branch and amazon-ec2 (0.9.17) gem

Hope this helps

>
> Thanks,
> Rob
>
>
> --
> Robert E. Parrott, Ph.D. (Phys. '06)
> Director, Academic Computing
> Harvard University Sch. of Eng. and App. Sci.
> Maxwell-Dworkin  211,
> 33 Oxford St.
> Cambridge, MA 02138
> (617)-496-1520
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>



-- 
Daniel Molina
Project Engineer
OpenNebula - The Open Source Toolkit for Data Center Virtualization
www.OpenNebula.org | dmolina at opennebula.org | @OpenNebula



More information about the Users mailing list