only check hypervisor type for security enabled advanced zone

This commit is contained in:
Anthony Xu 2013-05-29 11:32:15 -07:00
parent 8d1189c2ae
commit 9905f656a5

View File

@ -161,6 +161,7 @@ import com.cloud.vm.VMInstanceVO;
import com.cloud.vm.VirtualMachine.State; import com.cloud.vm.VirtualMachine.State;
import com.cloud.vm.VirtualMachineManager; import com.cloud.vm.VirtualMachineManager;
import com.cloud.vm.dao.VMInstanceDao; import com.cloud.vm.dao.VMInstanceDao;
import com.cloud.dc.DataCenter.NetworkType;
@Component @Component
@Local({ ResourceManager.class, ResourceService.class }) @Local({ ResourceManager.class, ResourceService.class })
@ -444,7 +445,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
+ cmd.getHypervisor() + " to a supported "); + cmd.getHypervisor() + " to a supported ");
} }
if (zone.isSecurityGroupEnabled()) { if (zone.isSecurityGroupEnabled() && zone.getNetworkType().equals(NetworkType.Advanced)) {
if (hypervisorType != HypervisorType.KVM && hypervisorType != HypervisorType.XenServer if (hypervisorType != HypervisorType.KVM && hypervisorType != HypervisorType.XenServer
&& hypervisorType != HypervisorType.Simulator) { && hypervisorType != HypervisorType.Simulator) {
throw new InvalidParameterValueException("Don't support hypervisor type " + hypervisorType + " in advanced security enabled zone"); throw new InvalidParameterValueException("Don't support hypervisor type " + hypervisorType + " in advanced security enabled zone");