bug 11634: add manual vm migration support for kvm

status 11634: resolved fixed
This commit is contained in:
Edison Su 2011-10-10 11:30:07 -07:00
parent fdaeb29290
commit 962bbcd5a0
3 changed files with 7 additions and 7 deletions

View File

@ -977,11 +977,11 @@ public class ManagementServerImpl implements ManagementServer {
throw new InvalidParameterValueException("VM is not Running, unable to migrate the vm " + vm);
}
if (!vm.getHypervisorType().equals(HypervisorType.XenServer) && !vm.getHypervisorType().equals(HypervisorType.VMware)) {
if (!vm.getHypervisorType().equals(HypervisorType.XenServer) && !vm.getHypervisorType().equals(HypervisorType.VMware) && !vm.getHypervisorType().equals(HypervisorType.KVM)) {
if (s_logger.isDebugEnabled()) {
s_logger.debug(vm + " is not XenServer/VMware, cannot migrate this VM.");
s_logger.debug(vm + " is not XenServer/VMware/KVM, cannot migrate this VM.");
}
throw new InvalidParameterValueException("Unsupported Hypervisor Type for VM migration, we support XenServer/VMware only");
throw new InvalidParameterValueException("Unsupported Hypervisor Type for VM migration, we support XenServer/VMware/KVM only");
}
ServiceOfferingVO svcOffering = _offeringsDao.findById(vm.getServiceOfferingId());
if (svcOffering.getUseLocalStorage()) {

View File

@ -3210,11 +3210,11 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
}
throw new InvalidParameterValueException("VM is not Running, unable to migrate the vm " + vm);
}
if (!vm.getHypervisorType().equals(HypervisorType.XenServer) && !vm.getHypervisorType().equals(HypervisorType.VMware)) {
if (!vm.getHypervisorType().equals(HypervisorType.XenServer) && !vm.getHypervisorType().equals(HypervisorType.VMware) && !vm.getHypervisorType().equals(HypervisorType.KVM)) {
if (s_logger.isDebugEnabled()) {
s_logger.debug(vm + " is not XenServer/VMware, cannot migrate this VM.");
s_logger.debug(vm + " is not XenServer/VMware/KVM, cannot migrate this VM.");
}
throw new InvalidParameterValueException("Unsupported Hypervisor Type for VM migration, we support XenServer only");
throw new InvalidParameterValueException("Unsupported Hypervisor Type for VM migration, we support XenServer/VMware/KVM only");
}
ServiceOfferingVO svcOffering = _serviceOfferingDao.findById(vm.getServiceOfferingId());

View File

@ -1957,7 +1957,7 @@ function vmBuildActionMenu(jsonObj, $thisTab, $midmenuItem1) {
buildActionLinkForTab("label.action.destroy.instance", vmActionMap, $actionMenu, $midmenuItem1, $thisTab);
if (isAdmin()
&& (jsonObj.rootdevicetype == 'NetworkFilesystem' || jsonObj.rootdevicetype == 'IscsiLUN' || jsonObj.rootdevicetype == 'PreSetup')
&& (jsonObj.hypervisor == 'XenServer' || jsonObj.hypervisor == 'VMware'))
&& (jsonObj.hypervisor == 'XenServer' || jsonObj.hypervisor == 'VMware' || jsonObj.hypervisor == 'KVM'))
{
buildActionLinkForTab("label.action.migrate.instance", vmActionMap, $actionMenu, $midmenuItem1, $thisTab);
}