On Oct 25, 2013, at 10:57 AM, Ryan Lei <ryan...@cht.com.tw> wrote: > I'm using Cloudmonkey 5.0.0 under CloudStack 4.2.0 + XenServer 6.2. > For now, the only way to change the ownership of a VM is by the > assignVirtualMachine API. > > But executing this API using Cloudmonkey leads to the following error that > crashes the program: > >> assign virtualmachine > virtualmachineid=7fe548bb-b2a7-4aec-92c5-5012ef9fd4f4 account=domain1-user1 > domainid=cfc19b03-0858-4f39-9058-e0b67685bc2f > Traceback (most recent call last): > File "/usr/bin/cloudmonkey", line 9, in <module> > load_entry_point('cloudmonkey==5.0.0', 'console_scripts', > 'cloudmonkey')() > File > "/usr/lib/python2.6/site-packages/cloudmonkey-5.0.0-py2.6.egg/cloudmonkey/cloudmonkey.py", > line 536, in main > shell.cmdloop() > File > "/usr/lib/python2.6/site-packages/cloudmonkey-5.0.0-py2.6.egg/cloudmonkey/cloudmonkey.py", > line 106, in cmdloop > super(CloudMonkeyShell, self).cmdloop(intro="") > File "/usr/lib64/python2.6/cmd.py", line 142, in cmdloop > stop = self.onecmd(line) > File "/usr/lib64/python2.6/cmd.py", line 219, in onecmd > return func(arg) > File > "/usr/lib/python2.6/site-packages/cloudmonkey-5.0.0-py2.6.egg/cloudmonkey/cloudmonkey.py", > line 134, in grammar_closure > self.default("%s %s" % (cmd, args)) > File > "/usr/lib/python2.6/site-packages/cloudmonkey-5.0.0-py2.6.egg/cloudmonkey/cloudmonkey.py", > line 303, in default > result = self.make_request(apiname, args_dict, isasync) > File > "/usr/lib/python2.6/site-packages/cloudmonkey-5.0.0-py2.6.egg/cloudmonkey/cloudmonkey.py", > line 257, in make_request > self.timeout, self.protocol, self.path) > File > "/usr/lib/python2.6/site-packages/cloudmonkey-5.0.0-py2.6.egg/cloudmonkey/requester.py", > line 121, in monkeyrequest > responsekey = filter(lambda x: 'response' in x, response.keys())[0] > IndexError: list index out of range > [cs42]~# > > However, the account of VM DOES change successfully, checked from both the > UI and API. > And after the change, only the new VM owner and their admins and see this > VM. >
I am guessing this is an issue with the response object of the assignVirtualMachine API call. Can you check the java code for this API ? > ------------------------------------------------------------------------------------------- > Yu-Heng (Ryan) Lei, Associate Researcher > Chunghwa Telecom Laboratories / Cloud Computing Laboratory > ryan...@cht.com.tw<https://email.cht.com.tw/owa/redir.aspx?C=-wE1FEC3G0SWYpVkiWo8SsDdf3ZqO9AIuAPTzRnFYCUi-z4YljtI_hyVKkNHfn9F1Bn-vUWJnQ4.&URL=mailto%3aryanlei%40cht.com.tw> > or > ryanlei750...@gmail.com