----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/17142/ -----------------------------------------------------------
Review request for cloudstack and Murali Reddy. Bugs: 5916 https://issues.apache.org/jira/browse/5916 Repository: cloudstack-git Description ------- associateIpAddress leaves an IP in allocating state (user_ip_address table), although the API command is executed on incorrectly. Steps to repro : 1) create a vpc tier. 2) Execute associateIpAddress" API on the vpc tier but do not specify the vpc id. #cloudmonkey >>associate ipaddress networkid=09ffc45f-beba-4690-8be7-425891915d44 Async job ea020246-d0e8-4e58-ac84-fccb55c3b646 failed Error 530, Can't assign ip to the network directly when network belongs to VPC.Specify vpcId to associate ip address to VPC accountid = a6ba35b3-7e76-11e3-8490-7614eba325e6 cmd = org.apache.cloudstack.api.command.user.address.AssociateIPAddrCmd created = 2014-01-21T10:46:46+0530 jobid = ea020246-d0e8-4e58-ac84-fccb55c3b646 jobprocstatus = 0 jobresult: errorcode = 530 errortext = Can't assign ip to the network directly when network belongs to VPC.Specify vpcId to associate ip address to VPC jobresultcode = 530 jobresulttype = object jobstatus = 2 userid = a6ba5844-7e76-11e3-8490-7614eba325e6 Expected behavior: There should be no allocation of IP . Actual behaviour: The public IP remains in 'Allocating' state The fix releases the IP incase of exception. Diffs ----- server/src/com/cloud/network/NetworkServiceImpl.java 056190f Diff: https://reviews.apache.org/r/17142/diff/ Testing ------- Tested the following scenarios: <ip>:8096/client/api?command=associateIpAddress&networkid=09ffc45f-beba-4690-8be7-425891915d44 There is no allocation of public IP (no IP is put in Allocating state in the db). <ip>:8096/client/api?command=associateIpAddress&networkid=09ffc45f-beba-4690-8be7-425891915d44&vpcid=1 Successfully associates the IP. Build passes successfully. Patch applies cleanly. Thanks, Saksham Srivastava