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 <pearl1954@gmail.com>
Co-authored-by: Nicolas Vazquez <nicovazquez90@gmail.com>
This commit is contained in:
Pearl Dsilva 2026-07-09 11:06:54 -04:00 committed by Pearl Dsilva
parent 98ae1c4899
commit 4ac23ee7b9
4 changed files with 31 additions and 1 deletions

View File

@ -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(),

View File

@ -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 a password reset, please ignore this email.', '', 'Regards,', 'The CloudStack Team'));
-- 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;

View File

@ -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;
}

View File

@ -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) {