nvazquez commented on code in PR #10289: URL: https://github.com/apache/cloudstack/pull/10289#discussion_r1989191094
########## plugins/network-elements/internal-loadbalancer/src/main/java/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java: ########## @@ -732,6 +733,78 @@ public List<DomainRouterVO> findInternalLbVms(final long guestNetworkId, final I return internalLbVms; } + protected String getRouterTemplateForHypervisor(HypervisorType hypervisorType, long dataCenterId) { + String templateName = null; + if (XenServer.equals(hypervisorType)) { + templateName = VirtualNetworkApplianceManager.RouterTemplateXen.valueIn(dataCenterId); + } else if (KVM.equals(hypervisorType)) { + templateName = VirtualNetworkApplianceManager.RouterTemplateKvm.valueIn(dataCenterId); + } else if (VMware.equals(hypervisorType)) { + templateName = VirtualNetworkApplianceManager.RouterTemplateVmware.valueIn(dataCenterId); + } else if (Hyperv.equals(hypervisorType)) { + templateName = VirtualNetworkApplianceManager.RouterTemplateHyperV.valueIn(dataCenterId); + } else if (LXC.equals(hypervisorType)) { + templateName = VirtualNetworkApplianceManager.RouterTemplateLxc.valueIn(dataCenterId); + } + return templateName; + } + + protected DomainRouterVO createOrUpdateInternalLb(DomainRouterVO internalLbVm, final long id, Review Comment: Looks like this method is unused? ########## engine/schema/src/main/java/com/cloud/host/dao/HostDaoImpl.java: ########## @@ -1756,6 +1758,29 @@ public List<HypervisorType> listDistinctHypervisorTypes(final Long zoneId) { return customSearch(sc, null); } + @Override + public List<Pair<HypervisorType, CPU.CPUArch>> listDistinctHypervisorArchTypes(final Long zoneId) { + List<Pair<HypervisorType, CPU.CPUArch>> hypervisorArchList = new ArrayList<>(); + String selectSql = "SELECT DISTINCT hypervisor_type, arch FROM cloud.host WHERE removed IS NULL"; + if (zoneId != null) { + selectSql += " AND data_center_id=" + zoneId; + } + TransactionLegacy txn = TransactionLegacy.currentTxn(); + try { + PreparedStatement stmt = txn.prepareAutoCloseStatement(selectSql); + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + HypervisorType hypervisorType = HypervisorType.valueOf(rs.getString("hypervisor_type")); + CPU.CPUArch arch = CPU.CPUArch.fromType(rs.getString("arch")); + hypervisorArchList.add(new Pair<>(hypervisorType, arch)); + } + } catch (SQLException ex) { + logger.error("DB exception {}", ex.getMessage(), ex); + return Collections.emptyList(); + } + return hypervisorArchList; + } + Review Comment: If possible can we include this method on `GenericDaoBase` accepting a table as parameter so then it can be invoked on ClusterDaoImpl and here just passing the different table to query from? ########## engine/components-api/src/main/java/com/cloud/resource/ResourceManager.java: ########## @@ -61,6 +61,14 @@ public interface ResourceManager extends ResourceService, Configurable { + "To force-stop VMs, choose 'ForceStop' strategy", true, ConfigKey.Scope.Global, null, null, null, null, null, ConfigKey.Kind.Select, "Error,Migration,ForceStop"); + ConfigKey<String> SystemVmPreferredArchitecture = new ConfigKey<>("Advanced" + , String.class + , "system.vm.preferred.architecture" + , "" + , "Preferred architecture for the system VMs including virtual routers" + , true + , ConfigKey.Scope.Zone); Review Comment: Can we have the commas at the end of each line instead of at the begginning? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org