Getting started with fog + openstack

688 views
Skip to first unread message

Bryan Stearns

unread,
May 24, 2012, 6:55:42 PM5/24/12
to ruby...@googlegroups.com
I've used devstack to set up a simple OpenStack instance, and used its
web UI to successfully launch an instance that I can contact remotely.
Now I'm trying to use fog (installed from GitHub at 851e838d) to
manage instances, but I haven't gotten off the ground:

>> Compute.new({:provider => :openstack, :openstack_api_key => "123456", :openstack_username => "admin", :openstack_auth_url => "http://10.117.0.24:5000/v2.0/tokens"})
Excon::Errors::InternalServerError: Expected([200, 204]) <=>
Actual(500 InternalServerError)
  request => {:connect_timeout=>60,
:headers=>{"Content-Type"=>"application/json",
"Host"=>"10.117.0.24:5000", "Content-Length"=>71},
:instrumentor_name=>"excon", :mock=>false, :read_timeout=>60,
:retry_limit=>4,
:ssl_ca_file=>"/usr/local/rvm/gems/ruby-1.9.3-p125@chef/gems/excon-0.13.4/data/cacert.pem",
:ssl_verify_peer=>true, :write_timeout=>60, :host=>"10.117.0.24",
:path=>"/v2.0/tokens", :port=>"5000", :query=>nil, :scheme=>"http",
:expects=>[200, 204],
:body=>"{\"auth\":{\"passwordCredentials\":{\"username\":\"admin\",\"password\":123456}}}",
:method=>"POST"}
  response => #<Excon::Response:0x00000003367b28 @body="{\"error\":
{\"message\": \"An unexpected error prevented the server from
fulfilling your request. object of type 'int' has no len()\",
\"code\": 500, \"title\": \"Internal Server Error\"}}",
@headers={"Content-Type"=>"application/json", "Vary"=>"X-Auth-Token",
"Content-Length"=>"177", "Date"=>"Thu, 24 May 2012 22:39:55 GMT"},
@status=500>

I seem to be getting past authorization, because I got 401 Unuthorized
if I change the username or password.

I know that OpenStack is early and evolving, but is there a better
way? (Would I be better off trying to control it via its emulation of
the EC2 API?)

Any other suggestions?

Thanks,
...Bryan

geemus (Wesley Beary)

unread,
May 24, 2012, 7:27:42 PM5/24/12
to ruby...@googlegroups.com
Not sure why this would be (and maybe it was just an error in posting
the message here), but it appears that the password actually passed is
an integer instead of a string (which might explain the error related
to an integer instead of a string). Perhaps ensure that the api key
is passed as a string instead of an integer?
wes

Bryan Stearns

unread,
May 24, 2012, 8:15:48 PM5/24/12
to ruby...@googlegroups.com
Thanks - that got me pointed in the right direction: bundler was using the 1.3.1 version 
of the gem, not the git-HEAD version. All better now - I can talk to the server! ...Bryan

geemus (Wesley Beary)

unread,
May 25, 2012, 12:18:06 AM5/25/12
to ruby...@googlegroups.com
Great to hear. Just let us know if you have any other questions or concerns.
Thanks!
wes
Reply all
Reply to author
Forward
0 new messages