Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
NSX: Fix Routed Mode for Isolated and VPC networks
  • Loading branch information
Pearl1594 committed Jan 19, 2024
commit 10401563c7887fb722978e330dd24ab35a97d374
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import com.cloud.dc.VlanDetailsVO;
import com.cloud.dc.dao.VlanDetailsDao;
import com.cloud.network.dao.NsxProviderDao;
import com.cloud.network.element.NsxProviderVO;
import org.apache.cloudstack.acl.ControlledEntity.ACLType;
import org.apache.cloudstack.annotation.AnnotationService;
import org.apache.cloudstack.annotation.dao.AnnotationDao;
Expand Down Expand Up @@ -1750,10 +1751,15 @@ protected boolean reprogramNetworkRules(final long networkId, final Account call
}

//apply network ACLs
NsxProviderVO nsxProviderVO = nsxProviderDao.findByZoneId(zone.getId());
// Objects.isNull(nsxProviderVO) &&
Comment thread
nvazquez marked this conversation as resolved.
Outdated
if (!_networkACLMgr.applyACLToNetwork(networkId)) {
s_logger.warn("Failed to reapply network ACLs as a part of of network id=" + networkId + " restart");
success = false;
}
// else if (Objects.nonNull(nsxProviderVO)) {
// success = true;
// }

return success;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import com.cloud.network.guru.GuestNetworkGuru;
import com.cloud.network.vpc.VpcVO;
import com.cloud.offering.NetworkOffering;
import com.cloud.offerings.NetworkOfferingVO;
import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
import com.cloud.user.Account;
import com.cloud.user.dao.AccountDao;
Expand Down Expand Up @@ -227,7 +228,9 @@ public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfil
throw new CloudRuntimeException(msg);
}

if (isNull(network.getVpcId())) {
NetworkOfferingVO networkOfferingVO = networkOfferingDao.findById(network.getNetworkOfferingId());

if (isNull(network.getVpcId()) && networkOfferingVO.getNsxMode().equals(NetworkOffering.NsxMode.NATTED.name())) {
long domainId = domain.getId();
long accountId = account.getId();
long dataCenterId = zone.getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,9 @@ private Map<Service, Provider> getServicesAndProvidersForNSXNetwork(NetworkOffer
serviceProviderMap.put(Service.Dhcp, routerProvider);
serviceProviderMap.put(Service.Dns, routerProvider);
serviceProviderMap.put(Service.UserData, routerProvider);
if (nsxMode == NetworkOffering.NsxMode.ROUTED && forVpc) {
serviceProviderMap.put(Service.NetworkACL, Provider.Nsx);
}
if (nsxMode == NetworkOffering.NsxMode.NATTED) {
serviceProviderMap.put(Service.SourceNat, Provider.Nsx);
serviceProviderMap.put(Service.StaticNat, Provider.Nsx);
Expand Down