[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-4998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ryan Lei reopened CLOUDSTACK-4998:
----------------------------------


I have compiled from source in a new environment, but it still crashes 
Cloudmonkey. The error messages are exactly the same, and here's the new 
Cloudmonkey log:

2013-10-25 17:03:19,839 - requester.py:45 - [DEBUG] ======== START Request 
========
2013-10-25 17:03:19,840 - requester.py:45 - [DEBUG] Requesting 
command=assignVirtualMachine, args={'account': 'domain1-user2', 'domainid': 
'cfc19b03-0858-4f39-9058-e0b67685bc2f', 'virtualmachineid': 
'939f1c53-91e8-47a1-92d1-9ec9c2c1802c'}
2013-10-25 17:03:19,841 - requester.py:45 - [DEBUG] Request sent: 
http://localhost:8080/client/api?account=domain1-user2&apiKey=KbvOOFTETTNL8RbmSmA0d-zOw8BxRW1msmKTVj_2T8b42KrpMb5DoVwNrc2aKRonFFTZ7W6GsSeL2hvReek4WA&command=assignVirtualMachine&domainid=cfc19b03-0858-4f39-9058-e0b67685bc2f&response=json&virtualmachineid=939f1c53-91e8-47a1-92d1-9ec9c2c1802c&signature=gcqky6emSpV08QHZuavLZFS6Pcg%3D

2013-10-25 17:03:20,107 - requester.py:45 - [DEBUG] Response received: { 
"virtualmachine" :  { "virtualmachine" : 
{"id":"939f1c53-91e8-47a1-92d1-9ec9c2c1802c","name":"domain1-admin","displayname":"domain1-admin","account":"domain1-user2","domainid":"cfc19b03-0858-4f39-9058-e0b67685bc2f","domain":"domain1","created":"2013-10-25T15:15:03+0800","state":"Stopped","haenable":false,"zoneid":"6e0b2791-513e-49be-bbd8-62c2597640ef","zonename":"Zone-Xen","templateid":"855b7915-9739-4ad7-945e-8b8514040198","templatename":"CentOS-6.4-x86_64
 (scalable)","templatedisplaytext":"CentOS-6.4-x86_64 
(scalable)","passwordenabled":false,"serviceofferingid":"32f7668c-5edd-4152-b927-c7b744281dc2","serviceofferingname":"Small
 
Instance","cpunumber":1,"cpuspeed":500,"memory":512,"cpuused":"0%","networkkbsread":0,"networkkbswrite":1,"diskkbsread":0,"diskkbswrite":0,"diskioread":0,"diskiowrite":0,"guestosid":"f70b6aaa-37da-11e3-9cb9-46ca9f9b4d97","rootdeviceid":0,"rootdevicetype":"ROOT","securitygroup":[],"nic":[{"id":"2f2a6ff3-ab11-4127-8991-2813a9a1c3ba","networkid":"aad53b98-3a6c-4cd3-a1e3-cbb84834d8c1","networkname":"domain1-user2-network","netmask":"255.255.255.0","gateway":"10.1.1.1","ipaddress":"10.1.1.204","traffictype":"Guest","type":"Isolated","isdefault":true,"macaddress":"02:00:17:61:00:01"}],"hypervisor":"XenServer","tags":[],"affinitygroup":[],"displayvm":true,"isdynamicallyscalable":true}
 }  }
2013-10-25 17:03:20,108 - requester.py:45 - [DEBUG] ======== END Request 
========

> assignVirtualMachine API has wrong response string, causing Cloudmonkey to 
> crash
> --------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-4998
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-4998
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: API, Cloudmonkey
>    Affects Versions: 4.2.0
>         Environment: CloudStack 4.2.0, XenServer 6.2, Cloudmonkey 5.0.0
>            Reporter: Ryan Lei
>            Assignee: sebastien goasguen
>             Fix For: 4.2.1, 4.3.0
>
>
> From mailing list discussion:
> [~ryanleitaiwan] says:
> 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]~#
> Here's the assignVirtualMachine response json from log:
> http://apaste.info/9f1H
> [~sebgoa] says:
> I think the error is in the java code of AssignVirtualMachine:
> api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java:
> @APICommand(name = "assignVirtualMachine", description="Change ownership of a 
> VM from one account to another. This API is available for Basic zones with 
> security groups and Advanced zones with guest networks. A root administrator 
> can reassign a VM from any account to any other account in any domain. A 
> domain administrator can reassign a VM to any account in the same domain.", 
> responseObject=UserVmResponse.class, since="3.0.0")
> public class AssignVMCmd extends BaseCmd  {
>     public static final Logger s_logger = 
> Logger.getLogger(AssignVMCmd.class.getName());
>    private static final String s_name = "moveuservmresponse";
> }
> Shouldn't the string be "assignvirtualmachineresponse" ?



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to