This is an automated email from the ASF dual-hosted git repository.

Pearl1594 pushed a commit to branch netris-improvements
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 4ac23ee7b9663e19f3e5b22ab302523d8aa19eba
Author: Pearl Dsilva <[email protected]>
AuthorDate: Thu Jul 9 11:06:54 2026 -0400

    Update upgrade path to reclaim vnets of deleted netris networks, improve 
log and hide add upstream route for Netris routed networks
    
    * Update upgrade path to reclaim vnets of deleted netris networks, improve 
log and hide add upstream route for Netris routed networks
    
    * Apply suggestions from code review
    
    * hide upstream route banner for netris networks altogether
    
    * fix migration of netris VRs and fix reclaim vnet query
    
    ---------
    
    Co-authored-by: Pearl Dsilva <[email protected]>
    Co-authored-by: Nicolas Vazquez <[email protected]>
---
 .../engine/orchestration/NetworkOrchestrator.java           |  9 +++++++++
 .../src/main/resources/META-INF/db/schema-42200to42210.sql  |  8 ++++++++
 .../src/main/java/com/cloud/network/vpc/VpcManagerImpl.java |  2 +-
 ui/src/components/view/DetailsTab.vue                       | 13 +++++++++++++
 4 files changed, 31 insertions(+), 1 deletion(-)

diff --git 
a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
 
b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index 62e084ad2bf..c082cffb1fb 100644
--- 
a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ 
b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -2302,6 +2302,11 @@ public class NetworkOrchestrator extends ManagerBase 
implements NetworkOrchestra
         }
     }
 
+    private boolean isReservedForExternalProvider(Long vlanId) {
+        VlanDetailsVO vlanDetail = vlanDetailsDao.findDetail(vlanId, 
ApiConstants.NETRIS_DETAIL_KEY);
+        return vlanDetail != null && 
BooleanUtils.toBoolean(vlanDetail.getValue());
+    }
+
     /*
     Prepare All Nics for migration including the nics dynamically created and 
not stored in DB
     This is a temporary workaround work KVM migration
@@ -2350,6 +2355,10 @@ public class NetworkOrchestrator extends ManagerBase 
implements NetworkOrchestra
             final List<IPAddressVO> publicIps = 
_ipAddressDao.listByAssociatedNetwork(guestNetworkId, null);
             for (final IPAddressVO userIp : publicIps) {
                 final PublicIp publicIp = 
PublicIp.createFromAddrAndVlan(userIp, _vlanDao.findById(userIp.getVlanId()));
+                if (isReservedForExternalProvider(publicIp.getVlanId())) {
+                    logger.debug("Skipping public IP {} for migration NIC 
profile: managed by external network provider", publicIp.getAddress());
+                    continue;
+                }
                 final URI broadcastUri = 
BroadcastDomainType.Vlan.toUri(publicIp.getVlanTag());
                 final long ntwkId = publicIp.getNetworkId();
                 final Nic nic = 
_nicDao.findByNetworkIdInstanceIdAndBroadcastUri(ntwkId, vm.getId(),
diff --git 
a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql 
b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql
index baa20e9f0ad..bcbe96ef7cb 100644
--- a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql
+++ b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql
@@ -59,3 +59,11 @@ UPDATE `cloud`.`configuration`
 SET value = CONCAT_WS('\n', 'Hello {{username}}!', 'You have requested to 
reset your password. Please click the following link to reset your password:', 
'{{{resetLink}}}', 'If you did not request a password reset, please ignore this 
email.', '', 'Regards,', 'The CloudStack Team')
 WHERE name = 'user.password.reset.mail.template'
   AND value IN (CONCAT_WS('\n', 'Hello {{username}}!', 'You have requested to 
reset your password. Please click the following link to reset your password:', 
'http://{{{resetLink}}}', 'If you did not request a password reset, please 
ignore this email.', '', 'Regards,', 'The CloudStack Team'), CONCAT_WS('\n', 
'Hello {{username}}!', 'You have requested to reset your password. Please click 
the following link to reset your password:', '{{{domainUrl}}}{{{resetLink}}}', 
'If you did not request  [...]
+
+-- Reclaim VNETs belonging to Netris deleted networks
+UPDATE op_dc_vnet_alloc a
+    JOIN networks n ON n.broadcast_uri = CONCAT('netris://', a.vnet)
+    SET a.account_id = NULL,
+        a.reservation_id = NULL,
+        a.taken = NULL
+WHERE n.removed IS NOT NULL;
\ No newline at end of file
diff --git a/server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java 
b/server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java
index a4420fd270f..ffcd1fd00d3 100644
--- a/server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java
@@ -3798,7 +3798,7 @@ public class VpcManagerImpl extends ManagerBase 
implements VpcManager, VpcProvis
             return ipAddressForVR;
         } else if (ipAddress != null) {
             if (ipAddress.isSourceNat()) {
-                throw new InvalidParameterValueException("Vpn service can not 
be configured on the Source NAT IP of VPC id=" + ipAddress.getVpcId());
+                throw new InvalidParameterValueException(String.format("Vpn 
service can not be configured on the Source NAT IP of VPC id = %s. Please 
acquire another IP to setup VPN", ipAddress.getVpcId()));
             }
             return ipAddress;
         }
diff --git a/ui/src/components/view/DetailsTab.vue 
b/ui/src/components/view/DetailsTab.vue
index 135ea7384fa..bd980924018 100644
--- a/ui/src/components/view/DetailsTab.vue
+++ b/ui/src/components/view/DetailsTab.vue
@@ -381,7 +381,17 @@ export default {
       }
       return null
     },
+    isNetrisNetwork () {
+      if (!this.resource.service) {
+        return false
+      }
+      const networkAclService = this.resource.service.find(svc => svc.name === 
'NetworkACL')
+      return networkAclService && networkAclService.provider && 
networkAclService.provider.some(p => p.name === 'Netris')
+    },
     ip4routes () {
+      if (this.isNetrisNetwork) {
+        return null
+      }
       if (this.resource.ip4routes && this.resource.ip4routes.length > 0) {
         var routes = []
         for (var route of this.resource.ip4routes) {
@@ -392,6 +402,9 @@ export default {
       return null
     },
     ip6routes () {
+      if (this.isNetrisNetwork) {
+        return null
+      }
       if (this.resource.ip6routes && this.resource.ip6routes.length > 0) {
         var routes = []
         for (var route of this.resource.ip6routes) {

Reply via email to