incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "marios@redhat.com" <mandr...@redhat.com>
Subject Re: [PATCH core 3/3] Fixed run_on_instance and launching instance with default HWP
Date Tue, 15 Feb 2011 20:50:16 GMT
On 15/02/11 22:33, Michal Fojtik wrote:
> Your instance needs to be in RUNNING state in order to execute some commands on it.
> This error usually happens if instance is not in RUNNING state or SSH is not started.
>
> Can you please try it again?
>

definitely in running state - same error


> Btw. testing code I'm used:
>
> require 'deltacloud'
>
> c = DeltaCloud::new('rackspace_user', 'api_key', 'http://localhost:3001/api')
> instance = c.instance('123456')
> puts instance.run('ls -lah /', :username =>  'root', :password =>  'password')
>
>    -- Michal
>

shouldn't matter what client we use for testing (in fact thats one of 
our arguments for REST right?). stacktrace:


[marios@marios deltacloud]$ curl  --user 'foo:bar' 
http://localhost:3001/api/instances?format=xml
<?xml version='1.0' encoding='utf-8' ?>
<instances>
   <instance href='http://localhost:3001/api/instances/615721' id='615721'>
     <name>TueFeb1522424402002011</name>
     <owner_id>mandreou</owner_id>
     <image href='http://localhost:3001/api/images/4' id='4'></image>
     <realm href='http://localhost:3001/api/realms/us' id='us'></realm>
     <state>RUNNING</state>
     <hardware_profile 
href='http://localhost:3001/api/hardware_profiles/1' id='1'>
     </hardware_profile>
     <actions>
       <link href='http://localhost:3001/api/instances/615721/reboot' 
method='post' rel='reboot' />
       <link href='http://localhost:3001/api/instances/615721/stop' 
method='post' rel='stop' />
     </actions>
     <public_addresses>
       <address>50.56.69.214</address>
     </public_addresses>
     <private_addresses>
       <address>10.181.83.165</address>
     </private_addresses>
   </instance>
</instances>


[marios@marios deltacloud]$ curl -id 'cmd=uname -a' -d 'password=bar' 
--user 'bla:bla' http://localhost:3001/api/instances/615721/run?format=xml
HTTP/1.1 500 Internal Server Error
X-Runtime: 9.498340
Content-Type: application/xml;charset=utf-8
Content-Length: 4872
Connection: keep-alive
Server: thin 1.2.7 codename No Hup

<error status='500' url='/api/instances/615721/run?format=xml'>
   <kind>backend_error</kind>
   <backend driver='rackspace'>
     <code>500</code>
     <cause>Deltacloud::Runner::InstanceSSHError</cause>
     <details><![CDATA[././lib/deltacloud/runner.rb:88:in `execute'
     ././lib/deltacloud/runner.rb:49:in `execute'
     ././lib/deltacloud/drivers/rackspace/rackspace_driver.rb:122:in 
`run_on_instance'
     ././lib/deltacloud/drivers/rackspace/rackspace_driver.rb:389:in `call'
     ././lib/deltacloud/drivers/rackspace/rackspace_driver.rb:389:in 
`safely'
     ././lib/deltacloud/drivers/rackspace/rackspace_driver.rb:121:in 
`run_on_instance'
     ././server.rb:389
     ././lib/sinatra/rabbit.rb:87:in `instance_eval'
     ././lib/sinatra/rabbit.rb:87:in `POST /api/instances/:id/run'

...


   </backend>
   <message><![CDATA[Timeout::Error: execution expired]]></message>
</error>





>>
>> On 15/02/11 13:40, mfojtik@redhat.com wrote:
>>> From: Michal Fojtik<mfojtik@redhat.com>
>>> @@ -85,25 +85,41 @@ class RackspaceDriver<   Deltacloud::BaseDriver
>>>       safely do
>>>         server = rs.create_server(:name =>   opts[:name] || Time.now.to_s,
>>>                          :imageId =>   image_id.to_i,
>>> -                       :flavorId =>   opts[:hwp_id].to_i || hardware_profiles(credentials).first.id.to_i)
>>> +                       :flavorId =>   opts[:hwp_id].length>0 ? opts[:hwp_id].to_i
: 1)
>>>         result = convert_instance_after_create(server, credentials.user, server.adminPass)
>>>       end
>>>       result
>>>     end
>>>
>>
>> getting an error here. (you are still not catching the case where opts[:hwp_id] is
nil):
>>
>>
>> [marios@marios deltacloud]$ curl -i -d 'image_id=4' --user 'foo:bar' http://localhost:3001/api/instances?format=xml
>> HTTP/1.1 500 Internal Server Error
>> X-Runtime: 4.845465
>> Content-Type: application/xml;charset=utf-8
>> Content-Length: 4739
>> Connection: keep-alive
>> Server: thin 1.2.7 codename No Hup
>>
>> <error status='500' url='/api/instances?format=xml'>
>>   <kind>backend_error</kind>
>>   <backend driver='rackspace'>
>>     <code>500</code>
>>     <cause>NoMethodError</cause>
>> <details><![CDATA[././lib/deltacloud/drivers/rackspace/rackspace_driver.rb:88:in
`create_instance'
>>     ././lib/deltacloud/drivers/rackspace/rackspace_driver.rb:389:in `call'
>>     ././lib/deltacloud/drivers/rackspace/rackspace_driver.rb:389:in `safely'
>>     ././lib/deltacloud/drivers/rackspace/rackspace_driver.rb:85:in `create_instance'
>>     ././server.rb:333
>>
>>
>> ...
>>
>> </backend>
>>   <message><![CDATA[undefined method `length' for nil:NilClass]]></message>
>>
>>
>>
>>
>>
>>
>>
>
> Michal Fojtik
> Software Engineer, Deltacloud API project
> http://www.deltacloud.org
> mfojtik@redhat.com
>
>


Mime
View raw message