You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mi...@apache.org on 2012/09/27 04:05:31 UTC

git commit: CLOUDSTACK-202 Can't create VM from ISO, when in VPC

Updated Branches:
  refs/heads/master 780769b76 -> 3c25d0ea6


CLOUDSTACK-202 Can't create VM from ISO, when in VPC

Signed-off-by: Mice Xia <mi...@tcloudcomputing.com>


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

Branch: refs/heads/master
Commit: 3c25d0ea679398cacb12c8869e628643c05348a0
Parents: 780769b
Author: Marcus Sorensen <sh...@gmail.com>
Authored: Thu Sep 27 10:07:15 2012 +0800
Committer: Mice Xia <mi...@tcloudcomputing.com>
Committed: Thu Sep 27 10:07:15 2012 +0800

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmManagerImpl.java |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/3c25d0ea/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 79eeb31..dbcbeb8 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -2253,12 +2253,17 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
                     throw new InvalidParameterValueException("Unable to find network by id " + networkIdList.get(0).longValue());
                 }
                 if (network.getVpcId() != null) {
-                    //Only XenServer, KVM, and VmWare hypervisors are supported for vpc networks
-                    if (!vpcSupportedHTypes.contains(template.getHypervisorType())) {
+                    //Only ISOs, XenServer, KVM, and VmWare template types are supported for vpc networks
+                    if (template.getFormat() != ImageFormat.ISO && !vpcSupportedHTypes.contains(template.getHypervisorType())) {
                         throw new InvalidParameterValueException("Can't create vm from template with hypervisor "
                                 + template.getHypervisorType() + " in vpc network " + network);
                     }
 
+                    //Only XenServer, KVM, and VMware hypervisors are supported for vpc networks
+                    if (!vpcSupportedHTypes.contains(hypervisor)) {
+                        throw new InvalidParameterValueException("Can't create vm of hypervisor type " + hypervisor + " in vpc network");
+                    }
+
                 }
                 
                 _networkMgr.checkNetworkPermissions(owner, network);