From 1cd370fc36475dbd819934ddbdee0c1d2fbe171b Mon Sep 17 00:00:00 2001 From: edison Date: Tue, 5 Oct 2010 09:51:18 -0700 Subject: [PATCH] hypervisor type for deployvmCmd is optional, only deploying blankvm needs it. --- server/src/com/cloud/api/commands/DeployVMCmd.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/api/commands/DeployVMCmd.java b/server/src/com/cloud/api/commands/DeployVMCmd.java index 48761133a9c..5456e63e08f 100644 --- a/server/src/com/cloud/api/commands/DeployVMCmd.java +++ b/server/src/com/cloud/api/commands/DeployVMCmd.java @@ -59,7 +59,7 @@ public class DeployVMCmd extends BaseCmd { s_properties.add(new Pair(BaseCmd.Properties.DOMAIN_ID, Boolean.FALSE)); s_properties.add(new Pair(BaseCmd.Properties.NETWORK_GROUP_LIST, Boolean.FALSE)); s_properties.add(new Pair(BaseCmd.Properties.SIZE, Boolean.FALSE)); - s_properties.add(new Pair(BaseCmd.Properties.HYPERVISOR, Boolean.TRUE)); + s_properties.add(new Pair(BaseCmd.Properties.HYPERVISOR, Boolean.FALSE)); } @Override @@ -110,7 +110,10 @@ public class DeployVMCmd extends BaseCmd { if (template.getFormat().equals(ImageFormat.ISO)) { /*TODO:Hack here*/ - template.setHypervisorType(HypervisorType.XenServer); + if (hyperType == HypervisorType.None) { + throw new ServerApiException(BaseCmd.VM_INVALID_PARAM_ERROR, "Need hypervisorType to deploy blankvm"); + } + template.setHypervisorType(hyperType); } if (diskOfferingId != null) {