Hi,<div><br></div><div>On one hand the problem is the template that you are using. You are asking for a disk linked to a storage resource and a nic linked to an existing network, so that the template should be:</div><meta charset="utf-8"><div>

<br></div><div><meta charset="utf-8"><span class="Apple-style-span" style="font-size: 13px; border-collapse: collapse; "><font class="Apple-style-span" face="'courier new', monospace"><COMPUTE><br>       <NAME>sl5.5</NAME><br>

<font class="Apple-style-span" color="#FF6666">       <DISK><br>               <STORAGE href="<a href="http://yourserver/storage/3">http://yourserver/storage/3</a>" /></font></font></span></div><div>

<span class="Apple-style-span" style="font-size: 13px; border-collapse: collapse; "><font class="Apple-style-span" face="'courier new', monospace" color="#FF6666">               <TARGET></font></span><span class="Apple-style-span" style="font-family: 'courier new', monospace; font-size: 13px; border-collapse: collapse; color: rgb(255, 102, 102); ">hda</span><span class="Apple-style-span" style="font-family: 'courier new', monospace; font-size: 13px; border-collapse: collapse; color: rgb(255, 102, 102); "></TARGET></span></div>

<div><font class="Apple-style-span" face="'courier new', monospace"><font class="Apple-style-span" color="#FF6666"><span class="Apple-style-span" style="border-collapse: collapse;">       </DISK></span><br>
<span class="Apple-style-span" style="border-collapse: collapse;">       <NIC></span><br>
<span class="Apple-style-span" style="border-collapse: collapse;">               <NETWORK href="<a href="http://yourserver/network/2">http://yourserver/network/2</a>" /></span><br><span class="Apple-style-span" style="border-collapse: collapse;">       </NIC></span></font><br>

<span class="Apple-style-span" style="border-collapse: collapse;">       <INSTANCE_TYPE>small</INSTANCE_TYPE></span><br><span class="Apple-style-span" style="border-collapse: collapse;">       <CONTEXT></span><br>

<span class="Apple-style-span" style="border-collapse: collapse;">               <HOSTNAME>onevm</HOSTNAME></span><br><span class="Apple-style-span" style="border-collapse: collapse;">               <FILES>/srv/cloud/one/context/</span><span class="Apple-style-span" style="border-collapse: collapse;">resources/software.tar.gz</span><br>

<span class="Apple-style-span" style="border-collapse: collapse;">/srv/cloud/one/context/</span><span class="Apple-style-span" style="border-collapse: collapse;">resources/init.sh</FILES></span><br><span class="Apple-style-span" style="border-collapse: collapse;">               <TARGET>hdb</TARGET></span><br>

<span class="Apple-style-span" style="border-collapse: collapse;">       </CONTEXT></span><br><span class="Apple-style-span" style="border-collapse: collapse;"></COMPUTE></span></font></div><div><br></div><div>

For more information about OCCI usage [1], [2]</div><div><br></div><div>On the other hand there is a bug using xml templates that defines their elements in more than one line, like this:</div><div><br></div><div><font class="Apple-style-span" face="'courier new', monospace"><COMPUTE></font></div>

<div><font class="Apple-style-span" face="'courier new', monospace">       <NAME></font></div><div><font class="Apple-style-span" face="'courier new', monospace">               foo</font></div><div>
<font class="Apple-style-span" face="'courier new', monospace">       </NAME></font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">       .....</font></div><div><font class="Apple-style-span" face="'courier new', monospace"></COMPUTE></font></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>

</font></div><div>I have opened a ticket regarding this issue [3]</div><div><br></div><div>Hope this helps.</div><div><br></div><div>[1] <a href="http://www.opennebula.org/documentation:rel2.0:occiug">http://www.opennebula.org/documentation:rel2.0:occiug</a></div>

<div>[2] <a href="http://www.opennebula.org/documentation:rel2.0:occidd">http://www.opennebula.org/documentation:rel2.0:occidd</a></div><div>[3] <a href="http://dev.opennebula.org/issues/454">http://dev.opennebula.org/issues/454</a></div>

<div><br><div class="gmail_quote">On 21 December 2010 10:36, 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;">

<div class="im">Hi.<br>
<br>
Thanks for helping.<br>
I have updated to the latest git-version but there is still the same<br>
"Wrong Type!" message.<br>
<br>
Perhaps it is really a problem about the occi syntax? Is there a way to<br>
validate it? Is it possible to manually add some debug-output to the<br>
ruby code: which file is responsible for parsing the xml 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 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>
</div><div><div></div><div class="h5">Hi,<br>
<br>
The reason of that error is a typo in the common.erb file. It was fixed<br>
in the last maintenance release. [1]<br>
<br>
In the python code, you have to use the VM template syntax [2], because<br>
you are interacting with the core using the xmlrpc api.<br>
<br>
Hope this helps.<br>
<br>
[1]<br>
<a href="http://dev.opennebula.org/projects/opennebula/repository/revisions/18361
ccfe643632aba5dd84e5128d8fbaa1774bb/diff/src/cloud/occi/etc/templates/co" target="_blank">http://dev.opennebula.org/projects/opennebula/repository/revisions/18361<br>
ccfe643632aba5dd84e5128d8fbaa1774bb/diff/src/cloud/occi/etc/templates/co</a><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 virtual<br>
machines<br>
        by interfacing OCCI.<br>
        Unfortunately I'm facing some problems with the occi 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 trying<br>
to PARSE<br>
<br>
        VM TEMPLATE Returned error code [1].. Reason: syntax error,<br>
unexpected<br>
        VARIABLE, expecting EQUAL or EQUAL_EMPTY at line 1, columns<br>
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"<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 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>
<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>
</div></div></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>