Updated Branches:
  refs/heads/4.0 9d618380b -> 34e1fd844

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

Signed-off-by: Mice Xia <[email protected]>


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

Branch: refs/heads/4.0
Commit: 34e1fd8441887f246ad8a1eaff10d2fb0f1b6080
Parents: 14c0384
Author: Marcus Sorensen <[email protected]>
Authored: Thu Sep 27 10:07:15 2012 +0800
Committer: Edison Su <[email protected]>
Committed: Wed Sep 26 21:57:40 2012 -0700

----------------------------------------------------------------------
 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/34e1fd84/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);

Reply via email to