Hi.

I want to use OpenNebula for dynamic instantiation of virtual machines
by interfacing OCCI.
Unfortunately I'm facing some problems with the occi template definition
syntax.
Can you please help with the "Wrong type!" error?

 


the problem:
************
$ occi-compute create occiTemplate.xml
Wrong type!

 
--> "Wrong type!" is the response of the OCCIServer. 'occi-compute'
works fine.

 

the template
*************
$ cat occiTemplate.xml
<COMPUTE>
        <NAME>sl5.5</NAME>
        <STORAGE>
                <DISK image="3" dev="hda" />
        </STORAGE>
        <NETWORK>
                <NIC network="2" />
        </NETWORK>
        <INSTANCE_TYPE>
                        small
        </INSTANCE_TYPE>
        <CONTEXT>
                <HOSTNAME>
                        onevm
                </HOSTNAME>
                <FILES>
                        /srv/cloud/one/context/resources/software.tar.gz
/srv/cloud/one/context/resources/init.sh
                </FILES>
                <TARGET>
                             hdb
                </TARGET>
        </CONTEXT>
</COMPUTE>



 

 

same template but this time as xmlrpc request
*********************************************
$ python xmlrpcDeploy.py
xmlrpc-response.status  = False
xmlrpc-response.message = [VirtualMachineAllocate] Error trying to PARSE

VM TEMPLATE Returned error code [1].. Reason: syntax error, unexpected 
VARIABLE, expecting EQUAL or EQUAL_EMPTY at line 1, columns 15:19


 

python source for xmlrpc request
********************************
$ cat xmlrpcDeploy.py
import xmlrpclib
server=xmlrpclib.ServerProxy("http://localhost:2633/RPC2";)
oneAuth = "oneadmin:7bc8559a8fe509e680562b85c337f170956fcb06"
template = (
'<COMPUTE>'
' <NAME>sl5.5</NAME>'
' <STORAGE>'
' <DISK image="3" dev="hda" />'
' </STORAGE>'
' <NETWORK>'
' <NIC network="2" />'
' </NETWORK>'
' <INSTANCE_TYPE>'
'        small'
' </INSTANCE_TYPE>'
' <CONTEXT>'
' <HOSTNAME>'
'            onevm'
' </HOSTNAME>'
' <FILES>'
'            /srv/cloud/one/context/resources/software.tar.gz
/srv/cloud/one/context/resources/init.sh'
' </FILES>'
' <TARGET>'
'            hdb'
' </TARGET>'
' </CONTEXT>'
'</COMPUTE>'
)

response = server.one.vm.allocate(oneAuth, str(template))
status = str(response[0])
message = str(response[1])
print 'xmlrpc-response.status  = ' + status
print 'xmlrpc-response.message = ' + message


 

occi-server.log
**************
(...)
127.0.0.1 - - [17/Dec/2010 16:51:27] "POST /compute HTTP/1.1" 500 11
0.0016
 

one_xmlrpc.log
**************
(...)
127.0.0.1 -  - [17/Dec/2010:17:43:54 +0100] "POST" 200 463



--> no more hints


 opennebula version
*******************
$ git log | head -n 3
commit 5f6b326c52a53fbc709c1c35bf1a301b1593a775
Author: Jaime Melis <j.me...@fdi.ucm.es>
Date:   Mon Nov 8 19:35:42 2010 +0100


python version
**************
$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2

 


thanks in advance
Marco

_______________________________________________
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org

Reply via email to