[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-API] Creating a VM from a record
Hi I am trying to use Zend XmlRbc to create a VM using a record. I am particularly using this method (VM ref) create (session_id s, VM record args) the way I am trying to do it is the follwing 1- start a vm 2- get the current vm record using VM.get_record 3- shutdown the vm4- create the VM using the the record we have from step 2 using the method VM.create(session_id s, VM record args) this does not work !! this is the error that returns by XMLRBC Array ( [Status] => Failure [ErrorDescription] => Array ( [0] => INTERNAL_ERROR [1] => 'list' object has no attribute 'items' ) ) and this is the output of xend.log ERROR (xmlrpclib2:166) Internal error handling VM.create Traceback (most recent call last): File "/usr/lib64/python2.6/site-packages/xen/util/xmlrpclib2.py", line 131, in _marshaled_dispatch response = self._dispatch(method, params) File "/usr/lib64/python2.6/SimpleXMLRPCServer.py", line 418, in _dispatch return func(*params) File "/usr/lib64/python2.6/site-packages/xen/xend/XendAPI.py", line 649, in <lambda> wrapped_f = (lambda *args: new_f(f, *args)) File "/usr/lib64/python2.6/site-packages/xen/xend/XendAPI.py", line 672, in <lambda> _ctor_event_dispatch(s, ctor, api_cls, session, args)) File "/usr/lib64/python2.6/site-packages/xen/xend/XendAPI.py", line 170, in _ctor_event_dispatch result = ctor(xenapi, session, *args) File "/usr/lib64/python2.6/site-packages/xen/xend/XendAPI.py", line 237, in f return func(self, *args, **kwargs) File "/usr/lib64/python2.6/site-packages/xen/xend/XendAPI.py", line 272, in check_session return func(self, session, *args, **kwargs) File "/usr/lib64/python2.6/site-packages/xen/xend/XendAPI.py", line 1820, in VM_create xendom.create_domain, vm_struct) File "/usr/lib64/python2.6/site-packages/xen/xend/XendTask.py", line 209, in log_progress retval = func(*args, **kwds) File "/usr/lib64/python2.6/site-packages/xen/xend/XendDomain.py", line 808, in create_domain raise XendError(str(e)) XendError: 'str' object has no attribute 'items' every thing else is working OK except this call and this is my xen version xen_major : 4 xen_minor : 0 xen_extra : .0_21091_06-0.1 xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p what I am doing wrong here example code that doesn't work include_once "Zend/XmlRpc/Client.php"; $client = new Zend_XmlRpc_Client('http://localhost:9363/'); $client->setSkipSystemLookup(true); $service = $client->getProxy();$result = $service->session->login_with_password($username, $password); $session = $result['Value']; $result= $this->service->VM->get_record($session,VMID); $record = $result['Value']; $this->service->VM->create($session,$record); thanks _______________________________________________ xen-api mailing list xen-api@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/mailman/listinfo/xen-api
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |