cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kous...@apache.org
Subject git commit: updated refs/heads/master to e3c0815
Date Tue, 26 Aug 2014 13:16:03 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master cae4124dc -> e3c0815a0


CLOUDSTACK-7392: [Automation] NPE thrown during Migration of VM
NPE is thrown as invalid hostId (corresponding to SSVM) is passed as paramater.
Added validation to check that the host is of type 'Routing'


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

Branch: refs/heads/master
Commit: e3c0815a0c8ea65b24f8050e0e870773412604ab
Parents: cae4124
Author: Koushik Das <koushik@apache.org>
Authored: Tue Aug 26 18:43:38 2014 +0530
Committer: Koushik Das <koushik@apache.org>
Committed: Tue Aug 26 18:43:38 2014 +0530

----------------------------------------------------------------------
 .../apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e3c0815a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java
index ef9619e..d6d6272 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java
@@ -125,11 +125,11 @@ public class MigrateVMCmd extends BaseAsyncCmd {
     @Override
     public void execute() {
         if (getHostId() == null && getStoragePoolId() == null) {
-            throw new InvalidParameterValueException("either hostId or storageId must be
specified");
+            throw new InvalidParameterValueException("Either hostId or storageId must be
specified");
         }
 
         if (getHostId() != null && getStoragePoolId() != null) {
-            throw new InvalidParameterValueException("only one of hostId and storageId can
be specified");
+            throw new InvalidParameterValueException("Only one of hostId and storageId can
be specified");
         }
 
         UserVm userVm = _userVmService.getUserVm(getVirtualMachineId());
@@ -143,6 +143,9 @@ public class MigrateVMCmd extends BaseAsyncCmd {
             if (destinationHost == null) {
                 throw new InvalidParameterValueException("Unable to find the host to migrate
the VM, host id=" + getHostId());
             }
+            if (destinationHost.getType() != Host.Type.Routing) {
+                throw new InvalidParameterValueException("The specified host(" + destinationHost.getName()
+ ") is not suitable to migrate the VM, please specify another one");
+            }
             CallContext.current().setEventDetails("VM Id: " + getVirtualMachineId() + " to
host Id: " + getHostId());
         }
 


Mime
View raw message