From eb4cfe063a0ac4d628c6c2b179540d198c806bad Mon Sep 17 00:00:00 2001 From: Abhinandan Prateek Date: Tue, 10 Jan 2012 10:49:18 +0530 Subject: [PATCH] bug 12916: warning user if he tried to move the VM across zones --- server/src/com/cloud/vm/UserVmManagerImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index dc77749901f..1333d65e633 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -3354,6 +3354,9 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager List securityGroupIdList = cmd.getSecurityGroupIdList(); if (zone.getNetworkType() == NetworkType.Basic) { + if (networkIdList != null && !networkIdList.isEmpty()) { + throw new InvalidParameterValueException("Can't move vm with network Ids; this is a basic zone VM"); + } //cleanup the network for the oldOwner _networkMgr.cleanupNics(vmOldProfile); _networkMgr.expungeNics(vmOldProfile);