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

Signed-off-by: Mice Xia <mice_xia@tcloudcomputing.com>
This commit is contained in:
Marcus Sorensen 2012-09-27 10:07:15 +08:00 committed by Mice Xia
parent 780769b765
commit 3c25d0ea67
1 changed files with 7 additions and 2 deletions

View File

@ -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);