CLOUDSTACK-3909: deployVM API - validate hypervisorType parameter when the vm is being deployed from ISO

This commit is contained in:
Alena Prokharchyk 2013-07-29 11:13:52 -07:00
parent a4cea4ebf2
commit 4c0053fb2d
1 changed files with 4 additions and 6 deletions

View File

@ -2361,16 +2361,14 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
"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)) {
} else if (template.getFormat() == ImageFormat.ISO && !vpcSupportedHTypes.contains(hypervisor)) {
// Only XenServer, KVM, and VMware hypervisors are supported
// for vpc networks
throw new InvalidParameterValueException(
"Can't create vm of hypervisor type "
+ hypervisor + " in vpc network");
}
}
_networkModel.checkNetworkPermissions(owner, network);