[one-users] occi-compute and common.erb scripts
Daniel Molina
dmolina at opennebula.org
Mon Mar 28 03:06:30 PDT 2011
Hi,
The OpenNebula Cloud will be updated today and this problem will be fixed.
Regards.
On 26 March 2011 19:13, PEDRO ASSIS <passis at eu.ipp.pt> wrote:
> Hi,
>
> From my debugging it looks like the error message
>
> “No such file or directory - /usr/local/one/etc/occi_templates/common.erb”
>
> is from the OpenNebula httpd (server side) and not from the client
> side. Check the contents of the return value of the http connection
> method of OCCIClient.rb,
>
> /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:87: if
> CloudClient::is_error?(res)
> (rdb:1) p res
> #<Net::HTTPInternalServerError 500 Internal Server Error readbody=true>
> (rdb:1) p res.body
> "No such file or directory - /usr/local/one/etc/occi_templates/common.erb"
>
> Presuming that my analysis is correct, is this a problem,
> misconfiguration, with the dummy OpenNebula installation and it will
> be fixed, or is it a limitation and it will not be changed soon?
>
> I am developing an interface module between OpenNebula OCCI interface
> and common NMS platforms, e.g., WBEM and SNMP, and for testing
> purposes I am relying on OpenNebula dummy installation. Can I do that,
> or should I run my own installation (which I rather not)?
>
> Follows the full debug session.
>
> Thanks,
>
> Pedro
> --
>
> [passis at virtualf .one]$ ruby -rdebug /usr/bin/occi-compute create
> compute.xml --url https://devel.cloud.opennebula.org --username passis
> --password XXX
> Debug.rb
>
> Emacs support available.
>
>
>
> /usr/bin/occi-compute:18:ONE_LOCATION=ENV["ONE_LOCATION"]
>
> (rdb:1) list 153
>
> [148, 157] in /usr/bin/occi-compute
>
> 148 if !vm_xml || !File.exists?(vm_xml)
>
> 149 puts "#{cmd_name} create: missing OCCI-XML or file
> not found"
>
> 150 exit(-1)
>
> 151 end
>
> 152
>
> 153 rc = occi_client.post_vms(vm_xml)
>
> 154
>
> 155 when 'show'
>
> 156 vm_id = ARGV[1]
>
> 157
>
> (rdb:1) b 153
>
> Set breakpoint 1 at /usr/bin/occi-compute:153
>
> (rdb:1) c
>
> Breakpoint 1, toplevel at /usr/bin/occi-compute:153
>
> /usr/bin/occi-compute:153: rc = occi_client.post_vms(vm_xml)
>
> (rdb:1) s
>
> /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:74: xml=File.read(xmlfile)
>
> (rdb:1) list
>
> [69, 78] in /usr/lib/one/ruby/cloud/occi/OCCIClient.rb
>
> 69 # Post a new VM to the VM Pool
>
> 70 # :instance_type
>
> 71 # :xmlfile
>
> 72 ######################################################################
>
> 73 def post_vms(xmlfile)
>
> => 74 xml=File.read(xmlfile)
>
> 75
>
> 76 url = URI.parse(@endpoint+"/compute")
>
> 77
>
> 78 req = Net::HTTP::Post.new(url.path)
>
> (rdb:1) b 78
>
> Set breakpoint 2 at /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:78
>
> (rdb:1) c
>
> Breakpoint 2, post_vms at /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:78
>
> /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:78: req =
> Net::HTTP::Post.new(url.path)
>
> (rdb:1) p url
>
> #<URI::HTTPS:0xb729dd3c URL:https://devel.cloud.opennebula.org/compute>
>
> (rdb:1) list
>
> [73, 82] in /usr/lib/one/ruby/cloud/occi/OCCIClient.rb
>
> 73 def post_vms(xmlfile)
>
> 74 xml=File.read(xmlfile)
>
> 75
>
> 76 url = URI.parse(@endpoint+"/compute")
>
> 77
>
> => 78 req = Net::HTTP::Post.new(url.path)
>
> 79 req.body=xml
>
> 80
>
> 81 req.basic_auth @occiauth[0], @occiauth[1]
>
> 82
>
> (rdb:1) b 81
>
> Set breakpoint 3 at /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:81
>
> (rdb:1) c
>
> Breakpoint 3, post_vms at /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:81
>
> /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:81:
> req.basic_auth @occiauth[0], @occiauth[1]
>
> (rdb:1) list
>
> [76, 85] in /usr/lib/one/ruby/cloud/occi/OCCIClient.rb
>
> 76 url = URI.parse(@endpoint+"/compute")
>
> 77
>
> 78 req = Net::HTTP::Post.new(url.path)
>
> 79 req.body=xml
>
> 80
>
> => 81 req.basic_auth @occiauth[0], @occiauth[1]
>
> 82
>
> 83 res = CloudClient::http_start(url, @timeout) do |http|
>
> 84 http.request(req)
>
> 85 end
>
> (rdb:1) b 83
>
> Set breakpoint 4 at /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:83
>
> (rdb:1) c
>
> Breakpoint 4, post_vms at /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:83
>
> /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:83: res =
> CloudClient::http_start(url, @timeout) do |http|
>
> (rdb:1) p req
>
> #<Net::HTTP::Post POST>
>
> (rdb:1) b 84
>
> Set breakpoint 5 at /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:84
>
> (rdb:1) c
>
> Breakpoint 5, post_vms at /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:84
>
> /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:84: http.request(req)
>
> (rdb:1) p http
>
> #<Net::HTTP devel.cloud.opennebula.org:443 open=true>
>
> (rdb:1) list
>
> [79, 88] in /usr/lib/one/ruby/cloud/occi/OCCIClient.rb
>
> 79 req.body=xml
>
> 80
>
> 81 req.basic_auth @occiauth[0], @occiauth[1]
>
> 82
>
> 83 res = CloudClient::http_start(url, @timeout) do |http|
>
> => 84 http.request(req)
>
> 85 end
>
> 86
>
> 87 if CloudClient::is_error?(res)
>
> 88 return res
>
> (rdb:1) b 87
>
> Set breakpoint 6 at /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:87
>
> (rdb:1) c
>
> Breakpoint 6, post_vms at /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:87
>
> /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:87: if
> CloudClient::is_error?(res)
>
> (rdb:1) p res
>
> #<Net::HTTPInternalServerError 500 Internal Server Error readbody=true>
>
> (rdb:1) p res.body
>
> "No such file or directory - /usr/local/one/etc/occi_templates/common.erb"
>
> (rdb:1) c
>
> Breakpoint 6, post_vms at /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:87
>
> /usr/lib/one/ruby/cloud/occi/OCCIClient.rb:87: if
> CloudClient::is_error?(res)
>
> (rdb:1) s
>
> /usr/lib/one/ruby/cloud/CloudClient.rb:128:
> value.class==CloudClient::Error
>
> (rdb:1) c
>
> No such file or directory - /usr/local/one/etc/occi_templates/common.erb
>
>
> --
> pfa
>
> Pedro Assis | Tel. +351 228 340 500 | Ext. 1141 | Fax +351 228 321 159
>
> Institute of Engineering of the Porto Polytechnic | pfa at isep.ipp.pt
> Porto Polytechnic EU Community | passis at eu.ipp.pt
> EuroCloud Portugal Association | pfa at eurocloud.pt
>
>
>
> 2011/3/25 PEDRO ASSIS <passis at eu.ipp.pt>:
>> Hi,
>>
>> I just upgrade my OpenNebula installation to the latest stable
>> version: 2.1.90, with Ruby version 1.9.2p180. Also, I'm running some
>> tests with OCCI client scripts. As I don't have an OCCI server
>> installed in my localhost, I'm targeting the dummy OpenNebula cloud:
>> https://devel.cloud.opennebula.org
>>
>> Running the following command:
>>
>> occi-compute create compute.xml --url
>> https://devel.cloud.opennebula.org --username passis --password XXX
>>
>> I get the error message:
>>
>> No such file or directory - /usr/local/one/etc/occi_templates/common.erb
>>
>>
>> This was true in the first trial, as the directory and files were both
>> missing. But, after a manual copy, I placed the following files at
>> the /usr/local/one/etc/occi_templates/ directory
>>
>> -rw-r--r-- 1 pfa pfa 1128 2011-03-25 11:15 common.erb
>>
>> -rw-r--r-- 1 pfa pfa 461 2011-03-25 11:15 custom.erb
>>
>> -rw-r--r-- 1 pfa pfa 213 2011-03-25 11:15 large.erb
>>
>> -rw-r--r-- 1 pfa pfa 215 2011-03-25 11:15 medium.erb
>>
>> -rw-r--r-- 1 pfa pfa 214 2011-03-25 11:15 small.erb
>>
>>
>> The compute.xml file is in the current directory and has the following content:
>>
>> <COMPUTE>
>>
>> <NAME>MyCompute 1</NAME>
>>
>> <INSTANCE_TYPE>large</INSTANCE_TYPE>
>>
>> <DISK><STORAGE href=https://devel.cloud.opennebula.org/storage/0 /></DISK>
>>
>> <NIC><NETWORK href=https://devel.cloud.opennebula.org/network/26 /><IP>192.168.1
>>
>> .1</IP></NIC>
>>
>> <!-- CONTEXT><HOSTNAME>MAINHOST</HOSTNAME><DATA>DATA1</DATA></CONTEXT -->
>>
>> </COMPUTE>
>>
>>
>> Also, I've run the same command under another system, Ruby 1.8.6 and
>> OpenNebula 2.0.1, and got the same result. I've reviewed the
>> installations procedures and searched the mailing list contents, but I
>> didn't found anything of relevance.
>>
>> Can someone in the list provide me with some hints?
>>
>> Meantime, I will try to run previous command with the -rdebug option.
>>
>> Thanks,
>>
>> Pedro
>>
>> --
>> pfa
>>
>> Pedro Assis | Tel. +351 228 340 500 | Ext. 1141 | Fax +351 228 321 159
>>
>> Institute of Engineering of the Porto Polytechnic | pfa at isep.ipp.pt
>> Porto Polytechnic EU Community | passis at eu.ipp.pt
>> EuroCloud Portugal Association | pfa at eurocloud.pt
>>
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
--
Daniel Molina, Cloud Technology Engineer/Researcher
Major Contributor
OpenNebula - The Open Source Toolkit for Cloud Computing
www.OpenNebula.org | dmolina at opennebula.org
More information about the Users
mailing list