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: CIMI MachineVolumes collection attach/detach volume
Date Thu, 29 Nov 2012 07:48:42 GMT
Hi Jesus:

On 29/11/12 03:41, Jesus nomellames wrote:
> The cimi-mock works well. However the cimi-fgcp driver return a 405
> code. After further inspection, seems that the whole volume collection
> is now broken for cimi-fgcp:
> 

thanks for testing this code. Actually these commits (attach/detach) did
not make the change which 'broke' the volumes collection for fgcp. As
Dies has correctly identified in a JIRA issue [1] - the problem is to do
with the parsing of 'created_time' from the volume returned by the
driver. In this case (and others) fgcp doesn't set a 'created_time'
which leads to the nullpointer "can't convert nil into String".

I had some fun (!) trying to track down when this change was made
(mostly out of curiosity) and saw that this change was actually made
over a month ago - i.e. 22 October with commit:
56257a27c68faa220174c22e4ef03a104745ea89

   def self.from_storage_volume(volume, context)
     self.new( { :name => volume.id,
                 :description => volume.id,
-                :created => volume.created,
+                :created => DateTime.parse(volume.created).xmlschema,

So the volumes collection has been 'broken' for fgcp since then. Since
we are fixing lots of nits in the CIMI frontend leading up to the f2f
you should be making sure everything is ok on your end with the latest
versions from git to prevent any nasty surprises at the last minute.

I'll be pushing the fix for the JIRA issue which addresses the problem here,

thanks again for having a look, marios

[1] https://issues.apache.org/jira/browse/DTACLOUD-383


> GET http://localhost:3004/cimi/volumes
> --------------------------
> <error status="500" url="/cimi/volumes">
> <kind>backend_error</kind>
> <message>
> <![CDATA[ can't convert nil into String ]]>
> </message>
> <backend driver="fgcp">
> <code>500</code>
> </backend>
> <backtrace>
> [ Abbreviated trace pass fulltrace=1 as query param to see everything
> $app = /home/jesus/deltacloud/server/lib ] ...
> $app/cimi/models/volume.rb:83:in `from_storage_volume'
> $app/cimi/models/volume.rb:44:in `block in find'
> $app/cimi/models/volume.rb:44:in `collect!'
> $app/cimi/models/volume.rb:44:in `find'
> $app/cimi/models/collection.rb:117:in `list'
> $app/cimi/collections/volumes.rb:26:in `block (3 levels) in
> <class:Volumes>' ... $app/sinatra/rack_accept.rb:164:in `call' ...
> $app/sinatra/rack_accept.rb:164:in `call' ...
> $app/sinatra/rack_accept.rb:164:in `call' ...
> $app/sinatra/rack_accept.rb:164:in `call' ...
> $app/sinatra/rack_accept.rb:164:in `call' ...
> $app/sinatra/rack_accept.rb:164:in `call' ...
> $app/sinatra/rack_accept.rb:164:in `call' ...
> $app/sinatra/rack_accept.rb:164:in `call' ...
> $app/sinatra/rack_accept.rb:164:in `call' ...
> $app/sinatra/rack_accept.rb:164:in `call' ...
> $app/sinatra/rack_accept.rb:164:in `call' ...
> $app/sinatra/rack_accept.rb:164:in `call' ...
> $app/sinatra/rack_accept.rb:164:in `call' ...
> $app/sinatra/rack_driver_select.rb:45:in `call'
> $app/sinatra/rack_matrix_params.rb:104:in `call'
> $app/sinatra/rack_etag.rb:41:in `call' $app/sinatra/rack_date.rb:31:in
> `call' $app/sinatra/rack_logger.rb:76:in `call'
> $app/sinatra/rack_accept.rb:164:in `call' ...
> $app/sinatra/rack_matrix_params.rb:104:in `call' ...
> </backtrace>
> </error>
> 
> On Wed, Nov 28, 2012 at 3:24 AM,  <marios@redhat.com> wrote:
>>
>> Attach volume to Machine
>>
>> XML:
>>
>> curl -v --user "mockuser:mockpassword" -H "Content-Type: application/xml"
>>     -H "Accept: application/xml" -X PUT -d
>>     '<MachineVolume xmlns="http://schemas.dmtf.org/cimi/1/MachineVolume">
>>       <initialLocation> /dev/sdf </initialLocation>
>>       <volume href="http://localhost:3001/cimi/volumes/vol2"/>
>>     </MachineVolume>'  http://localhost:3001/cimi/machines/inst1/volume_attach
>>
>> JSON:
>>
>> curl -v --user "mockuser:mockpassword" -H "Content-Type: application/json"
>>     -H "Accept: application/xml" -X PUT -d
>>     '{"resourceURI":"http://schemas.dmtf.org/cimi/1/MachineVolume",
>>     "initialLocation": "/dev/sdf",
>>     "volume": {"href":"http://localhost:3001/cimi/volumes/vol2"}}'
>>     http://localhost:3001/cimi/machines/inst1/volume_attach
>>
>> Detach volume (remove MachineVolume from the MachineVolumeCollection):
>>
>> curl -v --user "mockuser:mockpassword" -H "Accept: application/xml"
>>     -X DELETE http://localhost:3001/cimi/machines/inst1/volumes/vol2
>>
>>
>> write-up and more info @ http://mariosandreou.com/deltacloud/cloud_API/2012/11/28/cimi-machine-volumes-collection.html
>>
>> marios


Mime
View raw message