Skip to content

Commit 7071304

Browse files
author
Alena Prokharchyk
committed
VPC: CS-15774 - VPC and guest networks of VPC should belong to the same zone
1 parent 9be0a55 commit 7071304

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎server/src/com/cloud/network/NetworkManagerImpl.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2866,6 +2866,11 @@ protected Network createVpcGuestNetwork(long ntwkOffId, String name, String disp
28662866
if (networkDomain == null) {
28672867
networkDomain = vpc.getNetworkDomain();
28682868
}
2869+
2870+
if (vpc.getZoneId() != zoneId) {
2871+
throw new InvalidParameterValueException("New network doesn't belong to vpc zone", null);
2872+
}
2873+
28692874
//1) Validate if network can be created for VPC
28702875
_vpcMgr.validateGuestNtkwForVpc(_configMgr.getNetworkOffering(ntwkOffId), cidr, networkDomain, owner, vpc, null, gateway);
28712876
//2) Create network

0 commit comments

Comments
 (0)