From 727b3b0d5b26690d0eb6fbbdb9bc6ea8ee80ce4b Mon Sep 17 00:00:00 2001 From: Oleg Chuev <91337563+OlegChuev@users.noreply.github.com> Date: Fri, 20 Sep 2024 10:28:46 +0300 Subject: [PATCH 1/7] Removed deprecated instruction MAINTAINER (#8846) Co-authored-by: dahn Co-authored-by: Wei Zhou --- tools/docker/Dockerfile | 3 +-- tools/docker/Dockerfile.marvin | 3 +-- tools/docker/Dockerfile.smokedev | 3 +-- ui/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 319e8f9b158f..036054103a68 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -19,8 +19,7 @@ FROM ubuntu:22.04 -MAINTAINER "Apache CloudStack" -LABEL Vendor="Apache.org" License="ApacheV2" Version="4.18.3.0-SNAPSHOT" +LABEL Vendor="Apache.org" License="ApacheV2" Version="4.18.3.0-SNAPSHOT" Author="Apache CloudStack " ARG DEBIAN_FRONTEND=noninteractive diff --git a/tools/docker/Dockerfile.marvin b/tools/docker/Dockerfile.marvin index 52bdd6a1ec3e..1a670561237d 100644 --- a/tools/docker/Dockerfile.marvin +++ b/tools/docker/Dockerfile.marvin @@ -19,8 +19,7 @@ # build for cloudstack_home_dir not this folder FROM python:2 -MAINTAINER "Apache CloudStack" -LABEL Vendor="Apache.org" License="ApacheV2" Version="4.18.3.0-SNAPSHOT" +LABEL Vendor="Apache.org" License="ApacheV2" Version="4.18.3.0-SNAPSHOT" Author="Apache CloudStack " ENV WORK_DIR=/marvin diff --git a/tools/docker/Dockerfile.smokedev b/tools/docker/Dockerfile.smokedev index 881e10056788..f3d6f03a403d 100644 --- a/tools/docker/Dockerfile.smokedev +++ b/tools/docker/Dockerfile.smokedev @@ -19,8 +19,7 @@ FROM ubuntu:16.04 -MAINTAINER "Apache CloudStack" -LABEL Vendor="Apache.org" License="ApacheV2" Version="4.12.0-SNAPSHOT" +LABEL Vendor="Apache.org" License="ApacheV2" Version="4.12.0-SNAPSHOT" Author="Apache CloudStack " RUN apt-get -y update && apt-get install -y \ genisoimage \ diff --git a/ui/Dockerfile b/ui/Dockerfile index d636ae5657eb..f5556234e19b 100644 --- a/ui/Dockerfile +++ b/ui/Dockerfile @@ -19,11 +19,11 @@ FROM node:14-bullseye AS build -MAINTAINER "Apache CloudStack" LABEL Description="Apache CloudStack UI; Modern role-base progressive UI for Apache CloudStack" LABEL Vendor="Apache.org" LABEL License=ApacheV2 LABEL Version=0.5.0 +LABEL Author="Apache CloudStack " WORKDIR /build From ee1cd91e988a470a932d2dd7a5bf5484ffe1c15f Mon Sep 17 00:00:00 2001 From: Felipe <124818914+FelipeM525@users.noreply.github.com> Date: Fri, 20 Sep 2024 04:59:38 -0300 Subject: [PATCH 2/7] fixed an issue where requests to the api createDomain were being sent with the field networkdomain as an empty string whenever the user typed something in the form and cleared it causing an exception (#9637) --- ui/src/views/iam/DomainActionForm.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/src/views/iam/DomainActionForm.vue b/ui/src/views/iam/DomainActionForm.vue index 4d7c727d49e3..ab53a5974e40 100644 --- a/ui/src/views/iam/DomainActionForm.vue +++ b/ui/src/views/iam/DomainActionForm.vue @@ -237,6 +237,11 @@ export default { const resourceName = params.displayname || params.displaytext || params.name || this.resource.name let hasJobId = false + Object.keys(params).forEach(key => { + if (params[key] === '') { + delete params[key] + } + }) api(this.action.api, params).then(json => { for (const obj in json) { if (obj.includes('response')) { From 9ce7ef49cf997766d19892f8b0aa63a6f5ab3d4c Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Fri, 20 Sep 2024 10:17:12 +0200 Subject: [PATCH 3/7] build/packaging: build tungsten plugin only if noredist is passed (#9006) --- client/pom.xml | 21 ++--- plugins/hypervisors/kvm/pom.xml | 5 -- .../agent/api/SetupTfRouteCommand.java | 64 ++++++++++++++ .../api/SetupTungstenVRouterCommand.java | 77 +++++++++++++++++ .../UpdateTungstenLoadbalancerSslCommand.java | 83 +++++++++++++++++++ ...pdateTungstenLoadbalancerStatsCommand.java | 71 ++++++++++++++++ plugins/network-elements/tungsten/pom.xml | 7 -- plugins/pom.xml | 2 +- server/pom.xml | 11 --- .../com/cloud/network/NetworkServiceImpl.java | 6 +- 10 files changed, 306 insertions(+), 41 deletions(-) create mode 100644 plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/SetupTfRouteCommand.java create mode 100644 plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/SetupTungstenVRouterCommand.java create mode 100644 plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/UpdateTungstenLoadbalancerSslCommand.java create mode 100644 plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/UpdateTungstenLoadbalancerStatsCommand.java diff --git a/client/pom.xml b/client/pom.xml index 9173e3695609..53baebbc2b4d 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -27,18 +27,7 @@ cloudstack 4.19.2.0-SNAPSHOT - - - juniper-tungsten-api - https://github.com/radu-todirica/tungsten-api/raw/master - - - - net.juniper.tungsten - juniper-tungsten-api - 2.0 - javax.servlet javax.servlet-api @@ -282,11 +271,6 @@ cloud-plugin-network-ovs ${project.version} - - org.apache.cloudstack - cloud-plugin-network-tungsten - ${project.version} - org.apache.cloudstack cloud-plugin-network-elb @@ -1088,6 +1072,11 @@ cloud-plugin-network-cisco-vnmc ${project.version} + + org.apache.cloudstack + cloud-plugin-network-tungsten + ${project.version} + org.apache.cloudstack cloud-plugin-api-vmware-sioc diff --git a/plugins/hypervisors/kvm/pom.xml b/plugins/hypervisors/kvm/pom.xml index ad684b6e65fc..de5a02c7f7ec 100644 --- a/plugins/hypervisors/kvm/pom.xml +++ b/plugins/hypervisors/kvm/pom.xml @@ -83,11 +83,6 @@ ${project.version} compile - - org.apache.cloudstack - cloud-plugin-network-tungsten - ${project.version} - diff --git a/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/SetupTfRouteCommand.java b/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/SetupTfRouteCommand.java new file mode 100644 index 000000000000..8ccbff96d790 --- /dev/null +++ b/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/SetupTfRouteCommand.java @@ -0,0 +1,64 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.network.tungsten.agent.api; + +import com.cloud.agent.api.Command; + +import java.util.Objects; + +public class SetupTfRouteCommand extends Command { + private final String privateIp; + private final String publicIp; + private final String srcNetwork; + + public SetupTfRouteCommand(final String privateIp, final String publicIp, final String srcNetwork) { + this.privateIp = privateIp; + this.publicIp = publicIp; + this.srcNetwork = srcNetwork; + } + + public String getPrivateIp() { + return privateIp; + } + + public String getPublicIp() { + return publicIp; + } + + public String getSrcNetwork() { + return srcNetwork; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + if (!super.equals(o)) return false; + SetupTfRouteCommand that = (SetupTfRouteCommand) o; + return Objects.equals(privateIp, that.privateIp) && Objects.equals(publicIp, that.publicIp) && Objects.equals(srcNetwork, that.srcNetwork); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), privateIp, publicIp, srcNetwork); + } + + @Override + public boolean executeInSequence() { + return false; + } +} diff --git a/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/SetupTungstenVRouterCommand.java b/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/SetupTungstenVRouterCommand.java new file mode 100644 index 000000000000..00fc522363d3 --- /dev/null +++ b/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/SetupTungstenVRouterCommand.java @@ -0,0 +1,77 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.network.tungsten.agent.api; + +import com.cloud.agent.api.Command; + +import java.util.Objects; + +public class SetupTungstenVRouterCommand extends Command { + private final String oper; + private final String inf; + private final String subnet; + private final String route; + private final String vrf; + + public SetupTungstenVRouterCommand(final String oper, final String inf, final String subnet, final String route, + final String vrf) { + this.oper = oper; + this.inf = inf; + this.subnet = subnet; + this.route = route; + this.vrf = vrf; + } + + public String getOper() { + return oper; + } + + public String getInf() { + return inf; + } + + public String getSubnet() { + return subnet; + } + + public String getRoute() { + return route; + } + + public String getVrf() { + return vrf; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + if (!super.equals(o)) return false; + SetupTungstenVRouterCommand that = (SetupTungstenVRouterCommand) o; + return Objects.equals(oper, that.oper) && Objects.equals(inf, that.inf) && Objects.equals(subnet, that.subnet) && Objects.equals(route, that.route) && Objects.equals(vrf, that.vrf); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), oper, inf, subnet, route, vrf); + } + + @Override + public boolean executeInSequence() { + return false; + } +} diff --git a/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/UpdateTungstenLoadbalancerSslCommand.java b/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/UpdateTungstenLoadbalancerSslCommand.java new file mode 100644 index 000000000000..5ab24c18aa04 --- /dev/null +++ b/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/UpdateTungstenLoadbalancerSslCommand.java @@ -0,0 +1,83 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.network.tungsten.agent.api; + +import com.cloud.agent.api.Command; + +import java.util.Objects; + +public class UpdateTungstenLoadbalancerSslCommand extends Command { + private final String lbUuid; + private final String sslCertName; + private final String certificateKey; + private final String privateKey; + private final String privateIp; + private final String port; + + public UpdateTungstenLoadbalancerSslCommand(final String lbUuid, final String sslCertName, + final String certificateKey, final String privateKey, final String privateIp, final String port) { + this.lbUuid = lbUuid; + this.sslCertName = sslCertName; + this.certificateKey = certificateKey; + this.privateKey = privateKey; + this.privateIp = privateIp; + this.port = port; + } + + public String getLbUuid() { + return lbUuid; + } + + public String getSslCertName() { + return sslCertName; + } + + public String getCertificateKey() { + return certificateKey; + } + + public String getPrivateKey() { + return privateKey; + } + + public String getPrivateIp() { + return privateIp; + } + + public String getPort() { + return port; + } + + @Override + public boolean executeInSequence() { + return false; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + if (!super.equals(o)) return false; + UpdateTungstenLoadbalancerSslCommand that = (UpdateTungstenLoadbalancerSslCommand) o; + return Objects.equals(lbUuid, that.lbUuid) && Objects.equals(sslCertName, that.sslCertName) && Objects.equals(certificateKey, that.certificateKey) && Objects.equals(privateKey, that.privateKey) && Objects.equals(privateIp, that.privateIp) && Objects.equals(port, that.port); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), lbUuid, sslCertName, certificateKey, privateKey, privateIp, port); + } +} diff --git a/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/UpdateTungstenLoadbalancerStatsCommand.java b/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/UpdateTungstenLoadbalancerStatsCommand.java new file mode 100644 index 000000000000..d7b2088bcd7d --- /dev/null +++ b/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/network/tungsten/agent/api/UpdateTungstenLoadbalancerStatsCommand.java @@ -0,0 +1,71 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.network.tungsten.agent.api; + +import com.cloud.agent.api.Command; + +import java.util.Objects; + +public class UpdateTungstenLoadbalancerStatsCommand extends Command { + private final String lbUuid; + private final String lbStatsPort; + private final String lbStatsUri; + private final String lbStatsAuth; + + public UpdateTungstenLoadbalancerStatsCommand(final String lbUuid, final String lbStatsPort, + final String lbStatsUri, final String lbStatsAuth) { + this.lbUuid = lbUuid; + this.lbStatsPort = lbStatsPort; + this.lbStatsUri = lbStatsUri; + this.lbStatsAuth = lbStatsAuth; + } + + public String getLbUuid() { + return lbUuid; + } + + public String getLbStatsPort() { + return lbStatsPort; + } + + public String getLbStatsUri() { + return lbStatsUri; + } + + public String getLbStatsAuth() { + return lbStatsAuth; + } + + @Override + public boolean executeInSequence() { + return false; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + if (!super.equals(o)) return false; + UpdateTungstenLoadbalancerStatsCommand that = (UpdateTungstenLoadbalancerStatsCommand) o; + return Objects.equals(lbUuid, that.lbUuid) && Objects.equals(lbStatsPort, that.lbStatsPort) && Objects.equals(lbStatsUri, that.lbStatsUri) && Objects.equals(lbStatsAuth, that.lbStatsAuth); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), lbUuid, lbStatsPort, lbStatsUri, lbStatsAuth); + } +} diff --git a/plugins/network-elements/tungsten/pom.xml b/plugins/network-elements/tungsten/pom.xml index 2f0bb0f8076e..92e520a0ffd4 100644 --- a/plugins/network-elements/tungsten/pom.xml +++ b/plugins/network-elements/tungsten/pom.xml @@ -30,13 +30,6 @@ ../../pom.xml - - - juniper-tungsten-api - https://github.com/radu-todirica/tungsten-api/raw/master - - - net.juniper.tungsten diff --git a/plugins/pom.xml b/plugins/pom.xml index a7f0ebd5ed19..27d316f56c19 100755 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -111,7 +111,6 @@ network-elements/stratosphere-ssp network-elements/brocade-vcs network-elements/vxlan - network-elements/tungsten outofbandmanagement-drivers/ipmitool outofbandmanagement-drivers/nested-cloudstack @@ -230,6 +229,7 @@ hypervisors/vmware network-elements/cisco-vnmc network-elements/juniper-contrail + network-elements/tungsten diff --git a/server/pom.xml b/server/pom.xml index 782d194fe9ea..df4ebdb82374 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -26,12 +26,6 @@ cloudstack 4.19.2.0-SNAPSHOT - - - juniper-tungsten-api - https://github.com/radu-todirica/tungsten-api/raw/master - - @@ -187,11 +181,6 @@ metrics-jvm 3.0.2 - - net.juniper.tungsten - juniper-tungsten-api - 2.0 - diff --git a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java index 0fa5a0d6db38..d0711a9fcf90 100644 --- a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java @@ -4042,7 +4042,11 @@ public PhysicalNetworkVO doInTransaction(TransactionStatus status) { addDefaultInternalLbProviderToPhysicalNetwork(pNetwork.getId()); //Add tungsten network service provider - addDefaultTungstenProviderToPhysicalNetwork(pNetwork.getId()); + try { + addDefaultTungstenProviderToPhysicalNetwork(pNetwork.getId()); + } catch (Exception ex) { + s_logger.warn("Failed to add Tungsten provider to physical network due to:" + ex.getMessage()); + } // Add the config drive provider addConfigDriveToPhysicalNetwork(pNetwork.getId()); From 0a93dcec74281869c4b2f98f0a2889d3824cfe50 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 20 Sep 2024 17:23:28 +0530 Subject: [PATCH 4/7] ui: load project list with minimum details (#9711) This calls listProjects with details=min in the global header menu. Signed-off-by: Rohit Yadav --- ui/src/components/header/ProjectMenu.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/components/header/ProjectMenu.vue b/ui/src/components/header/ProjectMenu.vue index e2f365344d98..6fb0c3af350b 100644 --- a/ui/src/components/header/ProjectMenu.vue +++ b/ui/src/components/header/ProjectMenu.vue @@ -81,7 +81,7 @@ export default { const projects = [] const getNextPage = () => { this.loading = true - api('listProjects', { listAll: true, page: page, pageSize: 500, showIcon: true }).then(json => { + api('listProjects', { listAll: true, page: page, pageSize: 500, details: 'min', showIcon: true }).then(json => { if (json?.listprojectsresponse?.project) { projects.push(...json.listprojectsresponse.project) } From 9df783ca4be80ac028b4df985ddc9d723e024171 Mon Sep 17 00:00:00 2001 From: Vishesh Date: Fri, 20 Sep 2024 20:13:54 +0530 Subject: [PATCH 5/7] Filter out networks without access while getting networks with SG with free IPs (#9596) --- api/src/main/java/com/cloud/network/NetworkModel.java | 2 +- .../src/main/java/com/cloud/network/NetworkModelImpl.java | 8 +++++++- server/src/main/java/com/cloud/vm/UserVmManagerImpl.java | 4 ++-- .../test/java/com/cloud/network/MockNetworkModelImpl.java | 2 +- .../src/test/java/com/cloud/vpc/MockNetworkModelImpl.java | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/api/src/main/java/com/cloud/network/NetworkModel.java b/api/src/main/java/com/cloud/network/NetworkModel.java index 699dcbf6c508..ed3506c0da16 100644 --- a/api/src/main/java/com/cloud/network/NetworkModel.java +++ b/api/src/main/java/com/cloud/network/NetworkModel.java @@ -149,7 +149,7 @@ public interface NetworkModel { boolean areServicesSupportedByNetworkOffering(long networkOfferingId, Service... services); - Network getNetworkWithSGWithFreeIPs(Long zoneId); + Network getNetworkWithSGWithFreeIPs(Account account, Long zoneId); Network getNetworkWithSecurityGroupEnabled(Long zoneId); diff --git a/server/src/main/java/com/cloud/network/NetworkModelImpl.java b/server/src/main/java/com/cloud/network/NetworkModelImpl.java index 4088e9539ea5..23018ab72fd1 100644 --- a/server/src/main/java/com/cloud/network/NetworkModelImpl.java +++ b/server/src/main/java/com/cloud/network/NetworkModelImpl.java @@ -789,13 +789,19 @@ public NetworkVO getSystemNetworkByZoneAndTrafficType(long zoneId, TrafficType t } @Override - public NetworkVO getNetworkWithSGWithFreeIPs(Long zoneId) { + public NetworkVO getNetworkWithSGWithFreeIPs(Account account, Long zoneId) { List networks = _networksDao.listByZoneSecurityGroup(zoneId); if (networks == null || networks.isEmpty()) { return null; } NetworkVO ret_network = null; for (NetworkVO nw : networks) { + try { + checkAccountNetworkPermissions(account, nw); + } catch (PermissionDeniedException e) { + continue; + } + List vlans = _vlanDao.listVlansByNetworkId(nw.getId()); for (VlanVO vlan : vlans) { if (_ipAddressDao.countFreeIpsInVlan(vlan.getId()) > 0) { diff --git a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java index 3b48378b9854..9d5a1be894b9 100644 --- a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java @@ -3653,7 +3653,7 @@ public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, Service // If no network is specified, find system security group enabled network if (networkIdList == null || networkIdList.isEmpty()) { - Network networkWithSecurityGroup = _networkModel.getNetworkWithSGWithFreeIPs(zone.getId()); + Network networkWithSecurityGroup = _networkModel.getNetworkWithSGWithFreeIPs(owner, zone.getId()); if (networkWithSecurityGroup == null) { throw new InvalidParameterValueException("No network with security enabled is found in zone id=" + zone.getUuid()); } @@ -8536,7 +8536,7 @@ private LinkedHashMap getVmOvfNetworkMapping(DataCenter zone, Acc private Network getNetworkForOvfNetworkMapping(DataCenter zone, Account owner) throws InsufficientCapacityException, ResourceAllocationException { Network network = null; if (zone.isSecurityGroupEnabled()) { - network = _networkModel.getNetworkWithSGWithFreeIPs(zone.getId()); + network = _networkModel.getNetworkWithSGWithFreeIPs(owner, zone.getId()); if (network == null) { throw new InvalidParameterValueException("No network with security enabled is found in zone ID: " + zone.getUuid()); } diff --git a/server/src/test/java/com/cloud/network/MockNetworkModelImpl.java b/server/src/test/java/com/cloud/network/MockNetworkModelImpl.java index 395be635aea3..79f6e8dad354 100644 --- a/server/src/test/java/com/cloud/network/MockNetworkModelImpl.java +++ b/server/src/test/java/com/cloud/network/MockNetworkModelImpl.java @@ -237,7 +237,7 @@ public boolean areServicesSupportedByNetworkOffering(long networkOfferingId, Ser * @see com.cloud.network.NetworkModel#getNetworkWithSGWithFreeIPs(java.lang.Long) */ @Override - public NetworkVO getNetworkWithSGWithFreeIPs(Long zoneId) { + public NetworkVO getNetworkWithSGWithFreeIPs(Account account, Long zoneId) { // TODO Auto-generated method stub return null; } diff --git a/server/src/test/java/com/cloud/vpc/MockNetworkModelImpl.java b/server/src/test/java/com/cloud/vpc/MockNetworkModelImpl.java index ad332c00fa4d..f0fb6d56a403 100644 --- a/server/src/test/java/com/cloud/vpc/MockNetworkModelImpl.java +++ b/server/src/test/java/com/cloud/vpc/MockNetworkModelImpl.java @@ -248,7 +248,7 @@ public boolean areServicesSupportedByNetworkOffering(long networkOfferingId, Ser * @see com.cloud.network.NetworkModel#getNetworkWithSGWithFreeIPs(java.lang.Long) */ @Override - public NetworkVO getNetworkWithSGWithFreeIPs(Long zoneId) { + public NetworkVO getNetworkWithSGWithFreeIPs(Account account, Long zoneId) { // TODO Auto-generated method stub return null; } From d15a074425166e94642a38318aca327af782140c Mon Sep 17 00:00:00 2001 From: dahn Date: Mon, 23 Sep 2024 10:26:29 +0200 Subject: [PATCH 6/7] Revert "list by displayname instead of name (#8503)" (#9720) This reverts commit 2e9986c6a63af0d07e3c416153ddfdebb9a9a74d. --- ui/src/config/section/compute.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js index 4dc1f1645145..9bf8c9491448 100644 --- a/ui/src/config/section/compute.js +++ b/ui/src/config/section/compute.js @@ -46,7 +46,7 @@ export default { return filters }, columns: () => { - const fields = ['displayname', 'state', 'ipaddress'] + const fields = ['name', 'state', 'ipaddress'] const metricsFields = ['cpunumber', 'cputotal', 'cpuused', 'memorytotal', { memoryused: (record) => { @@ -74,7 +74,7 @@ export default { fields.push('zonename') return fields }, - searchFilters: ['displayname', 'zoneid', 'domainid', 'account', 'groupid', 'tags'], + searchFilters: ['name', 'zoneid', 'domainid', 'account', 'groupid', 'tags'], details: () => { var fields = ['name', 'displayname', 'id', 'state', 'ipaddress', 'ip6address', 'templatename', 'ostypename', 'serviceofferingname', 'isdynamicallyscalable', 'haenable', 'hypervisor', 'boottype', 'bootmode', 'account', From 2398b5c8c99437745cbbbdc87373fbb1ed93538a Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Tue, 24 Sep 2024 09:18:05 +0200 Subject: [PATCH 7/7] server: apply network ACL even if there is no network ACLs in the ACL list (#9374) --- .../cloudstack/network/topology/AdvancedNetworkTopology.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/server/src/main/java/org/apache/cloudstack/network/topology/AdvancedNetworkTopology.java b/server/src/main/java/org/apache/cloudstack/network/topology/AdvancedNetworkTopology.java index fc29fcca9980..8ee5d12c69a6 100644 --- a/server/src/main/java/org/apache/cloudstack/network/topology/AdvancedNetworkTopology.java +++ b/server/src/main/java/org/apache/cloudstack/network/topology/AdvancedNetworkTopology.java @@ -228,11 +228,6 @@ public boolean associatePublicIP(final Network network, final List rules, final VirtualRouter router, final boolean isPrivateGateway) throws ResourceUnavailableException { - if (rules == null || rules.isEmpty()) { - s_logger.debug("No network ACLs to be applied for network " + network.getId()); - return true; - } - s_logger.debug("APPLYING NETWORK ACLs RULES"); final String typeString = "network acls";