CLOUDSTACK-6327 updated uuid to id mapping

This commit is contained in:
Jayapal 2014-04-07 15:57:00 +05:30
parent cc2892c782
commit 78a29c0d41
3 changed files with 14 additions and 3 deletions

View File

@ -137,7 +137,12 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
String vmId = idIpsMap.get("vmid");
String vmIp = idIpsMap.get("vmip");
Long longVmId = new Long(vmId);
VirtualMachine lbvm = _entityMgr.findByUuid(VirtualMachine.class, vmId);
if (lbvm == null) {
throw new InvalidParameterValueException("Unable to find virtual machine ID: " + vmId);
}
Long longVmId = lbvm.getId();
List<String> ipsList = null;
if (vmIdIpsMap.containsKey(longVmId)) {

View File

@ -23,6 +23,7 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.ArrayList;
import com.cloud.vm.VirtualMachine;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand;
@ -126,7 +127,12 @@ public class RemoveFromLoadBalancerRuleCmd extends BaseAsyncCmd {
String vmId = idIpsMap.get("vmid");
String vmIp = idIpsMap.get("vmip");
Long longVmId = new Long(vmId);
VirtualMachine lbvm = _entityMgr.findByUuid(VirtualMachine.class, vmId);
if (lbvm == null) {
throw new InvalidParameterValueException("Unable to find virtual machine ID: " + vmId);
}
Long longVmId = lbvm.getId();
List<String> ipsList = null;
if (vmIdIpsMap.containsKey(longVmId)) {

View File

@ -1382,7 +1382,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
s_logger.warn("Unable to apply the load balancer config because resource is unavaliable.", e);
}
if (!success) {
CloudRuntimeException ex = new CloudRuntimeException("Failed to remove specified load balancer rule id for vms " + instanceIds);
CloudRuntimeException ex = new CloudRuntimeException("Failed to remove specified load balancer rule id for vms " + vmIds);
ex.addProxyObject(loadBalancer.getUuid(), "loadBalancerId");
throw ex;
}