Hi,<div><br></div><div>Comments inline,<br><br><div class="gmail_quote">On 21 December 2010 16:04, Strutz, Marco <span dir="ltr"><<a href="mailto:marco.strutz@fokus-extern.fraunhofer.de">marco.strutz@fokus-extern.fraunhofer.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi.<br>
<br>
It works now. Thank you!!!<br>
<br>
Nevertheless the syntax is very restrictive.<br>
<TARGET>hda</TARGET><br>
produces "hda" as value BUT<br>
<TARGET><br>
hda<br>
</TARGET><br>
produces "/n hda/n"<br>
<br>
This can lead to serious problems during instantiate time during<br>
parameter parsing by opennebula/libvirt/etc.<br>
<br>
<br>
My final (working) template looks like this:<br>
<COMPUTE><br>
<NAME>sl5.5</NAME><br>
<DISK><br>
<STORAGE href="<a href="http://localhost/storage/3" target="_blank">http://localhost/storage/3</a>"/><br>
<TARGET>hda</TARGET><br>
</DISK><br>
<INSTANCE_TYPE>small</INSTANCE_TYPE><br>
<NIC><br>
<NETWORK href="<a href="http://localhost/network/2" target="_blank">http://localhost/network/2</a>" /><br>
</NIC> <CONTEXT> <HOSTNAME>onevm</HOSTNAME><br>
<FILES>/srv/cloud/one/context/resources/software.tar.gz<br>
/srv/cloud/one/context/resources/init.sh</FILES><br>
<TARGET>hdb</TARGET><br>
</CONTEXT><br>
</COMPUTE><br>
<br>
<br>
<br>
<br>
<br>
<br>
But: the first attempt with your new suggested template produced a new<br>
error message:<br>
<br>
$ occi-compute create template.xml<br>
No such file or directory - /srv/cloud/one/etc/occi_templates/common.erb<br>
<br>
I had manually copy it from the sources<br>
(./src/cloud/occi/etc/templates.common.erb) to<br>
/srv/cloud/one/etc/occi_templates/, although I previously run the update<br>
command:<br>
$ ./install -u oneadmin -g cloud -k -d /srv/cloud/one<br>
<br>
<br>
Perhaps is it a bug in the update script?<br>
Anyway, I'm glad the occi request works now.<br>
<br>
<br></blockquote><div> </div><div>There is no bug in this case, the problem is the -k flag that keeps the configuration files of existing OpenNebula installation. The common.erb file is included in these configuration files. If you don't want to miss your them you have to copy it manually.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
So the 'git pull' solved my occi problem but it produced a new one:<br>
My VM's cannot be instantiate anymore:<br>
Vm.log --> [VMM] [E]: No ARCH defined and no default provided<br>
<br>
I can resolve it by adding [1]<br>
OS = [ ARCH="x86_64"]<br>
to my one template BUT since "ARCH" is not part of the OGF OCCI<br>
specification this can be a big problem?!<br>
<br>
For my installation even the suggested modification (according to [2])<br>
by manually setting the ARCH type in<br>
$ONE_LOCATION/etc/vmm_ssh/vmm_ssh_kvm.conf<br>
to<br>
OS = [boot = "hd", ARCH="x86_64"]<br>
didn't worked and resulted in the same error in the vm.log<br>
"No ARCH defined and no default provided"<br>
<br></blockquote><div><br></div><div>The OCCI templates are ment to be customized by the administrator supplying this kind of info. If you want to share this attribute between all the templates you have to add it to the common.erb file, otherwise you can add it in a specific template. </div>
<div><br></div><div>BTW the default option should work.</div><div><br></div><div>Regards.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
[1]<br>
<a href="http://opennebula.org/documentation:rel2.0:template#os_and_boot_options_" target="_blank">http://opennebula.org/documentation:rel2.0:template#os_and_boot_options_</a><br>
section<br>
[2] <a href="http://www.mail-archive.com/users@lists.opennebula.org/msg01222.html" target="_blank">http://www.mail-archive.com/users@lists.opennebula.org/msg01222.html</a><br>
<br>
<br>
<br>
Marco<br>
<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:dmamolina@gmail.com">dmamolina@gmail.com</a> [mailto:<a href="mailto:dmamolina@gmail.com">dmamolina@gmail.com</a>] On Behalf Of<br>
Daniel Molina Aranda<br>
Sent: Tuesday, December 21, 2010 12:01 PM<br>
To: Strutz, Marco<br>
Cc: <a href="mailto:users@lists.opennebula.org">users@lists.opennebula.org</a><br>
Subject: Re: [one-users] OCCI syntax - [Wrong type! error]<br>
<br>
Hi,<br>
<br>
On one hand the problem is the template that you are using. You are<br>
asking for a disk linked to a storage resource and a nic linked to an<br>
existing network, so that the template should be:<br>
<br>
<COMPUTE><br>
<NAME>sl5.5</NAME><br>
<DISK><br>
<STORAGE href="<a href="http://yourserver/storage/3" target="_blank">http://yourserver/storage/3</a>" /><br>
<TARGET>hda</TARGET><br>
</DISK><br>
<NIC><br>
<NETWORK href="<a href="http://yourserver/network/2" target="_blank">http://yourserver/network/2</a>" /><br>
</NIC><br>
<INSTANCE_TYPE>small</INSTANCE_TYPE><br>
<CONTEXT><br>
<HOSTNAME>onevm</HOSTNAME><br>
<FILES>/srv/cloud/one/context/resources/software.tar.gz<br>
/srv/cloud/one/context/resources/init.sh</FILES><br>
<TARGET>hdb</TARGET><br>
</CONTEXT><br>
</COMPUTE><br>
<br>
For more information about OCCI usage [1], [2]<br>
<br>
On the other hand there is a bug using xml templates that defines their<br>
elements in more than one line, like this:<br>
<br>
<COMPUTE><br>
<NAME><br>
foo<br>
</NAME><br>
.....<br>
</COMPUTE><br>
<br>
<br>
I have opened a ticket regarding this issue [3]<br>
<br>
Hope this helps.<br>
<br>
[1] <a href="http://www.opennebula.org/documentation:rel2.0:occiug" target="_blank">http://www.opennebula.org/documentation:rel2.0:occiug</a><br>
[2] <a href="http://www.opennebula.org/documentation:rel2.0:occidd" target="_blank">http://www.opennebula.org/documentation:rel2.0:occidd</a><br>
[3] <a href="http://dev.opennebula.org/issues/454" target="_blank">http://dev.opennebula.org/issues/454</a><br>
<br>
On 21 December 2010 10:36, Strutz, Marco<br>
<<a href="mailto:marco.strutz@fokus-extern.fraunhofer.de">marco.strutz@fokus-extern.fraunhofer.de</a>> wrote:<br>
<br>
<br>
Hi.<br>
<br>
Thanks for helping.<br>
I have updated to the latest git-version but there is still the<br>
same<br>
"Wrong Type!" message.<br>
<br>
Perhaps it is really a problem about the occi syntax? Is there a<br>
way to<br>
validate it? Is it possible to manually add some debug-output to<br>
the<br>
ruby code: which file is responsible for parsing the xml<br>
description?<br>
<br>
<br>
Thanks<br>
Marco<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:dmamolina@gmail.com">dmamolina@gmail.com</a> [mailto:<a href="mailto:dmamolina@gmail.com">dmamolina@gmail.com</a>] On Behalf<br>
Of<br>
Daniel Molina Aranda<br>
Sent: Monday, December 20, 2010 11:18 AM<br>
To: Strutz, Marco<br>
Cc: <a href="mailto:users@lists.opennebula.org">users@lists.opennebula.org</a><br>
Subject: Re: [one-users] OCCI syntax - [Wrong type! error]<br>
<br>
<br>
Hi,<br>
<br>
The reason of that error is a typo in the common.erb file. It<br>
was fixed<br>
in the last maintenance release. [1]<br>
<br>
In the python code, you have to use the VM template syntax [2],<br>
because<br>
you are interacting with the core using the xmlrpc api.<br>
<br>
Hope this helps.<br>
<br>
[1]<br>
<br>
<a href="http://dev.opennebula.org/projects/opennebula/repository/revisions/18361" target="_blank">http://dev.opennebula.org/projects/opennebula/repository/revisions/18361</a><br>
<br>
ccfe643632aba5dd84e5128d8fbaa1774bb/diff/src/cloud/occi/etc/templates/co<br>
<<a href="http://dev.opennebula.org/projects/opennebula/repository/revisions/1836" target="_blank">http://dev.opennebula.org/projects/opennebula/repository/revisions/1836</a><br>
1<br>
ccfe643632aba5dd84e5128d8fbaa1774bb/diff/src/cloud/occi/etc/templates/co<br>
><br>
mmon.erb<br>
[2] <a href="http://www.opennebula.org/documentation:rel2.0:template" target="_blank">http://www.opennebula.org/documentation:rel2.0:template</a><br>
<br>
<br>
On 20 December 2010 10:18, Strutz, Marco<br>
<<a href="mailto:marco.strutz@fokus-extern.fraunhofer.de">marco.strutz@fokus-extern.fraunhofer.de</a>> wrote:<br>
<br>
<br>
Hi.<br>
<br>
I want to use OpenNebula for dynamic instantiation of<br>
virtual<br>
machines<br>
by interfacing OCCI.<br>
Unfortunately I'm facing some problems with the occi<br>
template<br>
definition<br>
syntax.<br>
Can you please help with the "Wrong type!" error?<br>
<br>
<br>
<br>
<br>
the problem:<br>
************<br>
$ occi-compute create occiTemplate.xml<br>
Wrong type!<br>
<br>
<br>
--> "Wrong type!" is the response of the OCCIServer.<br>
'occi-compute'<br>
works fine.<br>
<br>
<br>
<br>
the template<br>
*************<br>
$ cat occiTemplate.xml<br>
<COMPUTE><br>
<NAME>sl5.5</NAME><br>
<STORAGE><br>
<DISK image="3" dev="hda" /><br>
</STORAGE><br>
<NETWORK><br>
<NIC network="2" /><br>
</NETWORK><br>
<INSTANCE_TYPE><br>
small<br>
</INSTANCE_TYPE><br>
<CONTEXT><br>
<HOSTNAME><br>
onevm<br>
</HOSTNAME><br>
<FILES><br>
<br>
/srv/cloud/one/context/resources/software.tar.gz<br>
/srv/cloud/one/context/resources/init.sh<br>
</FILES><br>
<TARGET><br>
hdb<br>
</TARGET><br>
</CONTEXT><br>
</COMPUTE><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
same template but this time as xmlrpc request<br>
*********************************************<br>
$ python xmlrpcDeploy.py<br>
xmlrpc-response.status = False<br>
xmlrpc-response.message = [VirtualMachineAllocate] Error<br>
trying<br>
to PARSE<br>
<br>
VM TEMPLATE Returned error code [1].. Reason: syntax<br>
error,<br>
unexpected<br>
VARIABLE, expecting EQUAL or EQUAL_EMPTY at line 1,<br>
columns<br>
15:19<br>
<br>
<br>
<br>
<br>
python source for xmlrpc request<br>
********************************<br>
$ cat xmlrpcDeploy.py<br>
import xmlrpclib<br>
<br>
server=xmlrpclib.ServerProxy("<a href="http://localhost:2633/RPC2" target="_blank">http://localhost:2633/RPC2</a>")<br>
oneAuth =<br>
"oneadmin:7bc8559a8fe509e680562b85c337f170956fcb06"<br>
template = (<br>
'<COMPUTE>'<br>
' <NAME>sl5.5</NAME>'<br>
' <STORAGE>'<br>
' <DISK image="3" dev="hda" />'<br>
' </STORAGE>'<br>
' <NETWORK>'<br>
' <NIC network="2" />'<br>
' </NETWORK>'<br>
' <INSTANCE_TYPE>'<br>
' small'<br>
' </INSTANCE_TYPE>'<br>
' <CONTEXT>'<br>
' <HOSTNAME>'<br>
' onevm'<br>
' </HOSTNAME>'<br>
' <FILES>'<br>
'<br>
/srv/cloud/one/context/resources/software.tar.gz<br>
/srv/cloud/one/context/resources/init.sh'<br>
' </FILES>'<br>
' <TARGET>'<br>
' hdb'<br>
' </TARGET>'<br>
' </CONTEXT>'<br>
'</COMPUTE>'<br>
)<br>
<br>
response = server.one.vm.allocate(oneAuth, str(template))<br>
status = str(response[0])<br>
message = str(response[1])<br>
print 'xmlrpc-response.status = ' + status<br>
print 'xmlrpc-response.message = ' + message<br>
<br>
<br>
<br>
<br>
occi-server.log<br>
**************<br>
(...)<br>
127.0.0.1 - - [17/Dec/2010 16:51:27] "POST /compute<br>
HTTP/1.1"<br>
500 11<br>
0.0016<br>
<br>
<br>
one_xmlrpc.log<br>
**************<br>
(...)<br>
127.0.0.1 - - [17/Dec/2010:17:43:54 +0100] "POST" 200<br>
463<br>
<br>
<br>
<br>
--> no more hints<br>
<br>
<br>
opennebula version<br>
*******************<br>
$ git log | head -n 3<br>
commit 5f6b326c52a53fbc709c1c35bf1a301b1593a775<br>
Author: Jaime Melis <<a href="mailto:j.melis@fdi.ucm.es">j.melis@fdi.ucm.es</a>><br>
Date: Mon Nov 8 19:35:42 2010 +0100<br>
<br>
<br>
python version<br>
**************<br>
$ python<br>
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)<br>
[GCC 4.4.3] on linux2<br>
<br>
<br>
<br>
<br>
thanks in advance<br>
Marco<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a><br>
<br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br>
<br>
<br>
<br>
<br>
--<br>
Daniel Molina, Cloud Technology Engineer/Researcher DSA Research<br>
Group:<br>
web <a href="http://dsa-research.org" target="_blank">http://dsa-research.org</a> and blog<br>
<a href="http://blog.dsa-research.org" target="_blank">http://blog.dsa-research.org</a><br>
OpenNebula Open Source Toolkit for Cloud Computing:<br>
<a href="http://www.OpenNebula.org" target="_blank">http://www.OpenNebula.org</a><br>
<font color="#888888"><br>
<br>
<br>
<br>
<br>
<br>
--<br>
Daniel Molina, Cloud Technology Engineer/Researcher DSA Research Group:<br>
web <a href="http://dsa-research.org" target="_blank">http://dsa-research.org</a> and blog <a href="http://blog.dsa-research.org" target="_blank">http://blog.dsa-research.org</a><br>
OpenNebula Open Source Toolkit for Cloud Computing:<br>
<a href="http://www.OpenNebula.org" target="_blank">http://www.OpenNebula.org</a><br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Daniel Molina, Cloud Technology Engineer/Researcher<br>DSA Research Group: web <a href="http://dsa-research.org" target="_blank">http://dsa-research.org</a> and blog <a href="http://blog.dsa-research.org" target="_blank">http://blog.dsa-research.org</a><br>
OpenNebula Open Source Toolkit for Cloud Computing: <a href="http://www.OpenNebula.org" target="_blank">http://www.OpenNebula.org</a><br>
</div>