Repository: cloudstack
Updated Branches:
  refs/heads/master 08dc5c6f9 -> 55983d47c


CLOUDSTACK-7400: Allow migration of systemVms in LXC. USer Vms cannot be 
migrated


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/55983d47
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/55983d47
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/55983d47

Branch: refs/heads/master
Commit: 55983d47c02c2f55c9e4c8adb936a1bb9dbca0cf
Parents: 08dc5c6
Author: Kishan Kavala <kis...@apache.org>
Authored: Wed Aug 27 13:05:04 2014 +0530
Committer: Kishan Kavala <kis...@apache.org>
Committed: Wed Aug 27 13:05:04 2014 +0530

----------------------------------------------------------------------
 server/src/com/cloud/server/ManagementServerImpl.java | 6 +++++-
 server/src/com/cloud/vm/UserVmManagerImpl.java        | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/55983d47/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java 
b/server/src/com/cloud/server/ManagementServerImpl.java
index c320089..697d1c4 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -1123,13 +1123,17 @@ public class ManagementServerImpl extends ManagerBase 
implements ManagementServe
         }
 
         if (!vm.getHypervisorType().equals(HypervisorType.XenServer) && 
!vm.getHypervisorType().equals(HypervisorType.VMware) && 
!vm.getHypervisorType().equals(HypervisorType.KVM)
-                && !vm.getHypervisorType().equals(HypervisorType.Ovm) && 
!vm.getHypervisorType().equals(HypervisorType.Hyperv)) {
+                && !vm.getHypervisorType().equals(HypervisorType.Ovm) && 
!vm.getHypervisorType().equals(HypervisorType.Hyperv) && 
!vm.getHypervisorType().equals(HypervisorType.LXC)) {
             if (s_logger.isDebugEnabled()) {
                 s_logger.debug(vm + " is not XenServer/VMware/KVM/OVM/Hyperv, 
cannot migrate this VM.");
             }
             throw new InvalidParameterValueException("Unsupported Hypervisor 
Type for VM migration, we support " + "XenServer/VMware/KVM/Ovm/Hyperv only");
         }
 
+        if (vm.getType().equals(VirtualMachine.Type.User) && 
vm.getHypervisorType().equals(HypervisorType.LXC)) {
+            throw new InvalidParameterValueException("Unsupported Hypervisor 
Type for User VM migration, we support XenServer/VMware/KVM/Ovm/Hyperv only");
+        }
+
         long srcHostId = vm.getHostId();
         Host srcHost = _hostDao.findById(srcHostId);
         if (srcHost == null) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/55983d47/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java 
b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 0fbaca8..0ea2a89 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -3867,13 +3867,17 @@ public class UserVmManagerImpl extends ManagerBase 
implements UserVmManager, Vir
 
         if (!vm.getHypervisorType().equals(HypervisorType.XenServer) && 
!vm.getHypervisorType().equals(HypervisorType.VMware) && 
!vm.getHypervisorType().equals(HypervisorType.KVM)
                 && !vm.getHypervisorType().equals(HypervisorType.Ovm) && 
!vm.getHypervisorType().equals(HypervisorType.Hyperv)
-                && !vm.getHypervisorType().equals(HypervisorType.Simulator)) {
+                && !vm.getHypervisorType().equals(HypervisorType.LXC) && 
!vm.getHypervisorType().equals(HypervisorType.Simulator)) {
             if (s_logger.isDebugEnabled()) {
                 s_logger.debug(vm + " is not XenServer/VMware/KVM/Ovm/Hyperv, 
cannot migrate this VM.");
             }
             throw new InvalidParameterValueException("Unsupported Hypervisor 
Type for VM migration, we support XenServer/VMware/KVM/Ovm/Hyperv only");
         }
 
+        if (vm.getType().equals(VirtualMachine.Type.User) && 
vm.getHypervisorType().equals(HypervisorType.LXC)) {
+            throw new InvalidParameterValueException("Unsupported Hypervisor 
Type for User VM migration, we support XenServer/VMware/KVM/Ovm/Hyperv only");
+        }
+
         if (isVMUsingLocalStorage(vm)) {
             if (s_logger.isDebugEnabled()) {
                 s_logger.debug(vm + " is using Local Storage, cannot migrate 
this VM.");

Reply via email to