File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
server/src/main/java/com/cloud/network/router Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -567,20 +567,18 @@ protected String getNoHypervisorsErrMsgDetails() {
567567 protected List <HypervisorType > getHypervisors (final RouterDeploymentDefinition routerDeploymentDefinition ) throws InsufficientServerCapacityException {
568568 final DeployDestination dest = routerDeploymentDefinition .getDest ();
569569 List <HypervisorType > hypervisors = new ArrayList <HypervisorType >();
570+ final HypervisorType defaults = _resourceMgr .getDefaultHypervisor (dest .getDataCenter ().getId ());
571+ if (defaults != HypervisorType .None ) {
572+ hypervisors .add (defaults );
573+ }
570574 if (dest .getCluster () != null ) {
571575 if (dest .getCluster ().getHypervisorType () == HypervisorType .Ovm ) {
572576 hypervisors .add (getClusterToStartDomainRouterForOvm (dest .getCluster ().getPodId ()));
573577 } else {
574578 hypervisors .add (dest .getCluster ().getHypervisorType ());
575579 }
576- } else {
577- final HypervisorType defaults = _resourceMgr .getDefaultHypervisor (dest .getDataCenter ().getId ());
578- if (defaults != HypervisorType .None ) {
579- hypervisors .add (defaults );
580- } else {
581- // if there is no default hypervisor, get it from the cluster
582- hypervisors = _resourceMgr .getSupportedHypervisorTypes (dest .getDataCenter ().getId (), true , routerDeploymentDefinition .getPlan ().getPodId ());
583- }
580+ } else if (defaults == HypervisorType .None ) {
581+ hypervisors = _resourceMgr .getSupportedHypervisorTypes (dest .getDataCenter ().getId (), true , routerDeploymentDefinition .getPlan ().getPodId ());
584582 }
585583
586584 filterSupportedHypervisors (hypervisors );
You can’t perform that action at this time.
0 commit comments