Hi,<div><br></div><div>The reason of that error is a typo in the common.erb file. It was fixed in the last maintenance release. [1]</div><div><br></div><div>In the python code, you have to use the VM template syntax [2], because you are interacting with the core using the xmlrpc api.</div>

<div><br></div><div>Hope this helps.</div><div><br></div><div>[1] <a href="http://dev.opennebula.org/projects/opennebula/repository/revisions/18361ccfe643632aba5dd84e5128d8fbaa1774bb/diff/src/cloud/occi/etc/templates/common.erb">http://dev.opennebula.org/projects/opennebula/repository/revisions/18361ccfe643632aba5dd84e5128d8fbaa1774bb/diff/src/cloud/occi/etc/templates/common.erb</a></div>

<div>[2] <a href="http://www.opennebula.org/documentation:rel2.0:template">http://www.opennebula.org/documentation:rel2.0:template</a><br><br><div class="gmail_quote">On 20 December 2010 10:18, 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>
I want to use OpenNebula for dynamic instantiation of virtual machines<br>
by interfacing OCCI.<br>
Unfortunately I'm facing some problems with the occi template 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. '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>
                        /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 trying to PARSE<br>
<br>
VM TEMPLATE Returned error code [1].. Reason: syntax error, unexpected<br>
VARIABLE, expecting EQUAL or EQUAL_EMPTY at line 1, columns 15:19<br>
<br>
<br>
<br>
<br>
python source for xmlrpc request<br>
********************************<br>
$ cat xmlrpcDeploy.py<br>
import xmlrpclib<br>
server=xmlrpclib.ServerProxy("<a href="http://localhost:2633/RPC2" target="_blank">http://localhost:2633/RPC2</a>")<br>
oneAuth = "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>
'            /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 HTTP/1.1" 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 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>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
</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>