mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-2900: Ubuntu 13.04 - Migrate Virtual Router fail - Unable to find the VM by id=
Changes: - Have to search the vm_instance table to find the instance
This commit is contained in:
parent
b0f241dfd2
commit
40d3b713ce
|
|
@ -3804,7 +3804,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
|
|||
"No permission to migrate VM, Only Root Admin can migrate a VM!");
|
||||
}
|
||||
|
||||
UserVmVO vm = _vmDao.findById(vmId);
|
||||
VMInstanceVO vm = _vmInstanceDao.findById(vmId);
|
||||
if (vm == null) {
|
||||
throw new InvalidParameterValueException(
|
||||
"Unable to find the VM by id=" + vmId);
|
||||
|
|
@ -3895,7 +3895,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
|
|||
+ " already has max Running VMs(count includes system VMs), cannot migrate to this host");
|
||||
}
|
||||
|
||||
collectVmDiskStatistics(vm);
|
||||
UserVmVO uservm = _vmDao.findById(vmId);
|
||||
if (uservm != null) {
|
||||
collectVmDiskStatistics(uservm);
|
||||
}
|
||||
VMInstanceVO migratedVm = _itMgr.migrate(vm, srcHostId, dest);
|
||||
return migratedVm;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue