Skip to content

Commit

Permalink
Allow creation of Shared Networks without IP range if network offerin…
Browse files Browse the repository at this point in the history
…g has no services - specifyvlan = true (#10168)
  • Loading branch information
Pearl1594 authored Jan 31, 2025
1 parent fbb1ff7 commit 5447950
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;

Expand Down Expand Up @@ -1634,6 +1635,10 @@ public Network createGuestNetwork(CreateNetworkCmd cmd) throws InsufficientCapac
throwInvalidIdException("Network offering with specified id doesn't support adding multiple ip ranges", ntwkOff.getUuid(), NETWORK_OFFERING_ID);
}

if (GuestType.Shared == ntwkOff.getGuestType() && !ntwkOff.isSpecifyVlan() && Objects.isNull(associatedNetworkId)) {
throw new CloudRuntimeException("Associated network must be provided when creating Shared networks when specifyVlan is false");
}

Pair<Integer, Integer> interfaceMTUs = validateMtuConfig(publicMtu, privateMtu, zone.getId());
mtuCheckForVpcNetwork(vpcId, interfaceMTUs, publicMtu, privateMtu);

Expand Down

0 comments on commit 5447950

Please sign in to comment.