From 962bbcd5a0d04278ef339b6893da1cb6affd9322 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Mon, 10 Oct 2011 11:30:07 -0700 Subject: [PATCH] bug 11634: add manual vm migration support for kvm status 11634: resolved fixed --- server/src/com/cloud/server/ManagementServerImpl.java | 6 +++--- server/src/com/cloud/vm/UserVmManagerImpl.java | 6 +++--- ui/scripts/cloud.core.instance.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 6f81f3813cc..ea46d0770f3 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -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()) { diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 864ec1611c8..81bbbf00f0f 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -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()); diff --git a/ui/scripts/cloud.core.instance.js b/ui/scripts/cloud.core.instance.js index c98d54fb444..56e9b0b568c 100755 --- a/ui/scripts/cloud.core.instance.js +++ b/ui/scripts/cloud.core.instance.js @@ -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); }